[LLVMbugs] [Bug 17074] New: wrong code at -O3 on x86_64-linux-gnu

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Sep 2 23:18:00 PDT 2013


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

            Bug ID: 17074
           Summary: wrong code at -O3 on x86_64-linux-gnu
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: LLVM Codegen
          Assignee: unassignedclangbugs at nondot.org
          Reporter: su at cs.ucdavis.edu
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

The following code is miscompiled by current clang trunk and 3.3 on
x86_64-linux-gnu at -O3 (in both 32-bit and 64-bit modes). 

This is a regression from 3.2.


$ clang-trunk -v
clang version 3.4 (trunk 189735)
$ clang-trunk -O2 reduced.c
$ a.out
1
$ clang-trunk -O3 reduced.c
$ a.out
7
$ clang-3.3 -O3 reduced.c
$ a.out
7
$ clang-3.2 -O3 reduced.c
$ a.out
1
$ 


--------------------------------


int printf (const char *, ...);

int a, b = 7;
char c;

int main ()
{
 lbl: 
  {
    int *d = &b;
    *d &= 1;
    c--;
    if (a)
      ;
    else if (c)
      goto lbl;
  }
  printf ("%d\n", b);
  return 0;
}

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20130903/d216b66b/attachment.html>


More information about the llvm-bugs mailing list