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

            Bug ID: 16386
           Summary: store forwarding across operator new() call
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Scalar Optimizations
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]
    Classification: Unclassified

int x;
volatile int z;
int *f() {
  x = 1;
  int *p = new int;
  z = x;
  return p;
}

clang -O2:

  store i32 1, i32* @x, align 4, !tbaa !0
  %call = tail call noalias i8* @_Znwm(i64 4)
  %0 = bitcast i8* %call to i32*
  store volatile i32 1, i32* @z, align 4, !tbaa !0

This does not allow overloading operator new() to access 'x'.

-fno-sane-operator-new disables this optimization.

AFAIU, it should be always disabled.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to