following testcase causes gpf on i386.

$ cat exe.c
extern void f() __attribute__((weak,visibility("hidden")));
extern int puts( char const* );
int main()
{
        f ? f() : puts( "f == null, skipped." );
        return 0;
}

$ gcc exe.c -fPIE --save-temps -m32 -O1 && ./a.out
Segmentation fault

this fails on i386 with gcc 3.4.5, 4.0, 4.1 and 4.2 (4.3 not tested).
x86_64 and ppc works fine, so it looks like a ix86 target bug.


-- 
           Summary: optimizer causes wrong code in pic/hidden/weak symbol
                    checking.
           Product: gcc
           Version: 4.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: pluto at agmk dot net
GCC target triplet: i386-gnu-linux


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32219

Reply via email to