From owner-svn-src-all@freebsd.org Sat Oct 10 12:03:19 2015 Return-Path: Delivered-To: svn-src-all@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 DBCE1A10D6C; Sat, 10 Oct 2015 12:03:18 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 81A1E8CD; Sat, 10 Oct 2015 12:03:18 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id t9AC3BCp076310 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Sat, 10 Oct 2015 15:03:11 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua t9AC3BCp076310 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id t9AC3B3t076309; Sat, 10 Oct 2015 15:03:11 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 10 Oct 2015 15:03:11 +0300 From: Konstantin Belousov To: Ed Maste Cc: Dimitry Andric , "src-committers@freebsd.org" , "svn-src-all@freebsd.org" , "svn-src-head@freebsd.org" Subject: Re: svn commit: r289072 - in head/contrib: libc++/src llvm/lib/Transforms/Vectorize Message-ID: <20151010120311.GE2257@kib.kiev.ua> References: <201510091821.t99ILjHI054211@repo.freebsd.org> <20151010060846.GA2257@kib.kiev.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Oct 2015 12:03:19 -0000 On Sat, Oct 10, 2015 at 11:37:26AM +0000, Ed Maste wrote: > On 10 October 2015 at 06:08, Konstantin Belousov wrote: > > On Fri, Oct 09, 2015 at 06:21:45PM +0000, Dimitry Andric wrote: > >> Author: dim > >> Date: Fri Oct 9 18:21:45 2015 > >> New Revision: 289072 > >> URL: https://svnweb.freebsd.org/changeset/base/289072 > >> > >> Log: > >> Temporarily revert upstream llvm trunk r240144 (by Michael Zolotukhin): > > > > This might be indeed a clang bug, but probably not in the revision which > > you reverted. Or it might be a libc++ bug. > > Yes, the bug is almost certainly not r240144; reverting it is a > short-term workaround until the underlying issue is fixed. > > > The story, from what I understand from the discussion at some other > > place, is that the fault occurs on access to the common unaligned > > symbol. Apparently, ELF does allow to specify alignment of the common > > symbols, and static linker, when finally allocating .bss space for the > > object, must obey the requirement. The symbol value for the common > > symbol must be interpreted as the desired alignment. > > > > Could you look up the symbol reference in the .o files (again) and see > > which alignment is requested ? I think that it is probably clang which > > should set it to be at least 16 bytes to generate ABI-compliant code. > > 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. > > 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 ?