[LLVMbugs] [Bug 1904] New: Regression: llvm has gcc PR28045 bug

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Thu Jan 10 01:24:48 PST 2008


http://llvm.org/bugs/show_bug.cgi?id=1904

           Summary: Regression: llvm has gcc PR28045 bug
           Product: new-bugs
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: new bugs
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: edwintorok at gmail.com
                CC: llvmbugs at cs.uiuc.edu


After I updated to SVN r45831, I am getting this while ./configure in ClamAV:

checking for gcc bug PR28045... configure: error: your compiler has gcc PR28045
bug, use a different compiler, see
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28045

Previously I was not getting this error, and I was very happy that llvm has
avoided a gcc bug :)

llvm-gcc -O1 or greater exhibits this bug, however doing llvm-gcc -O0, and opt
-std-compile-opts doesn't show the bug. 
Does llvm-gcc -O1 use some (buggy) optimizations from gcc? (gcc 4.0.1 has this
bug)

Testcase and  output below.

$ gcc -O3 pr28045.c
$ ./a.out
--->no aborts here
$  gcc --version
gcc (GCC) 4.2.3 20080102 (prerelease) (Debian 4.2.2-5)
$ llvm-gcc -O3 pr28045.c
edwin at lightspeed2:~/clam/svn3/trunk$ ./a.out
Aborted
$ llvm-gcc -O1 pr28045.c
$ ./a.out
Aborted
$ llvm-gcc -O0 pr28045.c
$ ./a.out
--> no aborts here
$ llvm-gcc -O0 pr28045.c -emit-llvm -c -o pr28045.bc
$ opt -std-compile-opts pr28045.bc -o opt.bc
$ llvm-ld -native opt.bc 
$ ./a.out
---> no aborts here
$ llvm-gcc -O1 pr28045.c -emit-llvm -c -o pr28045.bc
$ llvm-ld -native opt.bc
$ ./a.out
Aborted


/* (C) Andrew Pinski */    
extern void abort(void);
struct a
{
   unsigned int bits : 1;
   signed long val : ((sizeof(long) * 8) - 1);
};
int Fnegate (struct a b)
{
  if ((-((long)b.val)) <= ((long) ((1UL << ((sizeof(long) * 8) - 2)) -1UL))
      && (-((long)b.val)) >= (-(((long) ((1UL << ((sizeof(long) * 8) - 2))
-1UL))) - 1))
     return 0 ;
  abort ();
}
int main ()
{ struct a b = {1, 1};
  Fnegate (b);
  return 0;
}


-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list