Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 06 Jan 2013 11:39:35 -0500
From:      Nathan Whitehorn <nwhitehorn@freebsd.org>
To:        freebsd-current@freebsd.org
Subject:   Re: clang 3.2 RC2 miscompiles libgcc?
Message-ID:  <50E9A8C7.40600@freebsd.org>
In-Reply-To: <50E99848.6090209@freebsd.org>
References:  <20121227150724.GA1431@mole.fafoe.narf.at> <50DC65F5.6060004@freebsd.org> <50E0BD66.4070609@FreeBSD.org> <20130102135950.GA1464@mole.fafoe.narf.at> <20130104154940.GD1430@mole.fafoe.narf.at> <20130106141708.GA1418@mole.fafoe.narf.at> <50E9916F.3040500@FreeBSD.org> <50E99848.6090209@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On 01/06/13 10:29, Nathan Whitehorn wrote:
> On 01/06/13 09:59, Dimitry Andric wrote:
>> On 2013-01-06 15:17, Stefan Farfeleder wrote:
>>> On Fri, Jan 04, 2013 at 04:49:41PM +0100, Stefan Farfeleder wrote:
>>>> Here's a minimal test case that reproduces the bug:
>>> [...]
>>>
>>> Until someone fixes this bug, could we apply something like this as a
>>> work-around?
>>>
>>> Stefan
>>>
>>> Index: gnu/lib/libgcc/Makefile
>>> ===================================================================
>>> --- gnu/lib/libgcc/Makefile    (revision 245055)
>>> +++ gnu/lib/libgcc/Makefile    (working copy)
>>> @@ -6,6 +6,8 @@
>>>   SHLIB_NAME=    libgcc_s.so.1
>>>   SHLIBDIR?=    /lib
>>>
>>> +CC=    gcc
>>> +
>>>   .include <bsd.own.mk>
>>
>> I think this is a bit overkill approach.  We still don't know what the
>> exact cause of the problem is, and this just papers over it.
>>
>> Also, ince the bug is only reproducible by compiling the testcase with
>> g++, could you not compile your crashing programs with clang instead,
>> for now?  :-)
>>
> 
> I would very much support this patch. Whatever is going wrong is a
> critical problem -- although his testcase requires g++, I have lots of
> code that also crashes when built with clang. The fact that *any* code
> built with *any* compiler crashes when used with clang-built libgcc is
> an error. This is quite serious and breaks a *lot* of C++ code. If it
> can't be fixed now, papering it over is required.
> -Nathan

For whatever it's worth, I verified that this is the same bug I was
seeing earlier: only unwind-dw2.c is being miscompiled. The preprocessed
versions of this file are identical with both gcc and clang and the
problem occurs at all optimization levels with it is built with clang. I
tried replacing as many of the __builtin functions as a could with
thunks to the gcc versions, with no positive result. The ones I could
not replace are __builtin_return_address, __builtin_dwarf_cfa, and
__builtin_eh_return.
-Nathan




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?50E9A8C7.40600>