From owner-svn-src-head@freebsd.org Sat Oct 10 11:37:46 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 57DED9D2AFD; Sat, 10 Oct 2015 11:37:46 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-ig0-x230.google.com (mail-ig0-x230.google.com [IPv6:2607:f8b0:4001:c05::230]) (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 23CBA1470; Sat, 10 Oct 2015 11:37:46 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by igbni9 with SMTP id ni9so17484242igb.1; Sat, 10 Oct 2015 04:37:45 -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=HbyikW+X326hDCgrq1ihrQeik0KFoftrMm85g+gStDs=; b=dIoFWDLorEYygCDmtBuGmdyTMKNcwywUJ87ce4XgfKJrWgDDgsIMB70k8ftIDjcmzo 1QHsYxoTKB9G8m3rSRj8StFmsrj+GAT1Hw5lqtLfVltcnh3YUNNMWh/EGJ2l4dZsESXu 0+npVNQjXBUZzirBZYb8DxqJZilXWS6jc0nKmlsMxlccuhZJKxiuipVxRwTUkYBbhcvc 7OzYzqyRGGDrUFez/BIkmCA5AhUmCfoPGIuS6cCbV8FsMcyYguCFz6kUnVT6sZ4Bb5R7 KJTiqVgzHYrvN2GFPN81fgTqEWDwrDmk3oOx7nHO31dxksF05mPicflq09p6boxTbaWn j8RQ== X-Received: by 10.50.134.168 with SMTP id pl8mr3601380igb.33.1444477065464; Sat, 10 Oct 2015 04:37:45 -0700 (PDT) MIME-Version: 1.0 Sender: carpeddiem@gmail.com Received: by 10.107.158.75 with HTTP; Sat, 10 Oct 2015 04:37:26 -0700 (PDT) In-Reply-To: <20151010060846.GA2257@kib.kiev.ua> References: <201510091821.t99ILjHI054211@repo.freebsd.org> <20151010060846.GA2257@kib.kiev.ua> From: Ed Maste Date: Sat, 10 Oct 2015 11:37:26 +0000 X-Google-Sender-Auth: 78xZ9tH_VvVnTGk7MLvy6vB-wFY 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 11:37:46 -0000 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. 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.