From owner-svn-src-head@freebsd.org Sat Oct 10 12:24:54 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 612A39D2120; Sat, 10 Oct 2015 12:24:54 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-ig0-x22f.google.com (mail-ig0-x22f.google.com [IPv6:2607:f8b0:4001:c05::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E75BC15D4; Sat, 10 Oct 2015 12:24:53 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by igbkq10 with SMTP id kq10so51198849igb.0; Sat, 10 Oct 2015 05:24:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=nVzB+GpRVdxyO/SSo8BtaTOQuMFtgzoDxCESmbdSEr0=; b=EFceXzjsaQ+olp3eV9gjLAjlPF5iQdwyNTLCA46Qb7rQzCXmDdN1Oe1p1lQ7iWpB08 LyOs6+Z0dZh1jyTZb1z7500HydshxFBtqFsm3j2npRAYT3kV82MPA8NVcs8cvhLNmQQ4 0t1j7NmBZs+9CY0eFTFgny0lpWH0o2VTvsxwBRB/Ujn4idMWcTHapl1xCrS0UyAwsyr8 XZOIhlMlaexD3PcXCLSnagKITRypkW0b4xnF0whvHL9lKffEYT2vm3rxAt+GWI14HWMd YlPG0eyY7EotoqY5gbkSxmXgb/4DbYAPNZF/5y8QDRda2BvhsK0IB/OpR3v0IbxHZJ65 lwJw== X-Received: by 10.50.92.38 with SMTP id cj6mr4105054igb.58.1444479892874; Sat, 10 Oct 2015 05:24:52 -0700 (PDT) MIME-Version: 1.0 Sender: carpeddiem@gmail.com Received: by 10.107.158.75 with HTTP; Sat, 10 Oct 2015 05:24:33 -0700 (PDT) In-Reply-To: <20151010120311.GE2257@kib.kiev.ua> References: <201510091821.t99ILjHI054211@repo.freebsd.org> <20151010060846.GA2257@kib.kiev.ua> <20151010120311.GE2257@kib.kiev.ua> From: Ed Maste Date: Sat, 10 Oct 2015 12:24:33 +0000 X-Google-Sender-Auth: WxuI2LU6CxtUAA3eS0cPcIFXMuw Message-ID: Subject: Re: svn commit: r289072 - in head/contrib: libc++/src llvm/lib/Transforms/Vectorize To: Konstantin Belousov Cc: Dimitry Andric , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Oct 2015 12:24:54 -0000 On 10 October 2015 at 12:03, Konstantin Belousov wrote: >> The declaration is extern ostream cout; which correctly has 8 byte alignment. > The alignment of the declaration does not matter, most likely. > I am not sure what you mean by saying that 8 byte alignment is desirable, > while compiler generates accesses (movdqa) which assume 16-byte alignment. I mean that this object is naturally expected to have 8-byte alignment. In previous versions of libc++.so shipped with FreeBSD it did, and can't be changed now (cout comes from the binary itself, via a copy relocation). >> In the implementation (contrib/libc++/src/iostream.cpp) it is defined >> as a char array which is where the 16-byte ABI alignment would arise, >> but explicitly specifies 8-byte alignment: >> _ALIGNAS_TYPE (ostream) _LIBCPP_FUNC_VIS char cout[sizeof(ostream)]; >> >> Compiling with -emit-llvm --save-temps shows the desired 8-byte >> alignment for cout in the LLVM IR but 16-byte in the assembly file. > Could somebody show the readelf -s iostream.So and readelf -s libc++.so.X > output lines for the symbol, please ? readelf -s iostream.So: 120: 0000000000000150 160 OBJECT GLOBAL DEFAULT 5 _ZNSt3__14coutE libc++.so.1.full 1280: 00000000002bb4a0 160 OBJECT GLOBAL DEFAULT 25 _ZNSt3__14coutE