target/6569: sparc-sun-solaris2.7 C testsuite regression in compile/20011119-2.c

Mark Mitchell mark@codesourcery.com
Tue May 7 14:42:00 GMT 2002



--On Tuesday, May 07, 2002 11:04:11 PM +0200 Franz Sirl 
<Franz.Sirl-kernel@lauterbach.com> wrote:

> At 21:41 07.05.2002, Mark Mitchell wrote:
>
>
>> --On Tuesday, May 07, 2002 07:24:48 PM +0200 Franz Sirl
>> <Franz.Sirl-kernel@lauterbach.com> wrote:
>>
>> Don't worry; we'll get it fixed.
>>
>> The problem is that there are multiple declarations of functions
>> involved.
>>
>> If you say:
>>
>>  void f()
>>  void f() __attribute__((weak));
>>
>> The C front end makes two DECLs for f.  Then, it calls duplicate_decls to
>> smush them together; it always throws away the new one and keeps the old.
>> We're getting the new one on the weak_decls list sometimes, and that's
>> messing things up.
>
> The _old_ one is thrown away? I guess that was part of my confusion.

No, it keeps the old one and throws away the new.  That's why getting the
new one on the list is bad; you end up with this decl on the list that's
not the one used anywhere else in the compiler.

>> This patch will fix it; I'm testing on x86 now, and if someone can
>> kick off a SPARC run that would be great.  As a special bonus, this
>> also makes the warnings come out in the right place consistently.
>
> The patch looks good to me, I started a powerpc-linux-gnu bootstrap and
> will build a glibc with it tomorrow.

Thanks.  Does anyone else have a Solaris machine to throw at it sooner?
(The GNU/Linux results are good.)

--
Mark Mitchell                   mark@codesourcery.com
CodeSourcery, LLC               http://www.codesourcery.com



More information about the Gcc-bugs mailing list