[LLVMbugs] [Bug 2299] New: -anders-aa and -gvn marks values as undefined incorrectly

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Thu May 8 14:11:35 PDT 2008


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

           Summary: -anders-aa and -gvn marks values as undefined
                    incorrectly
           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


Created an attachment (id=1622)
 --> (http://llvm.org/bugs/attachment.cgi?id=1622)
testcase

Using SVN r50866, opt -ander-aa -gvn marks some values as undefined, but that
is not correct:

This portion of IR:
        %buf2 = bitcast [8 x i32]* %buf12 to i8*                ; <i8*>
[#uses=1]
        %tmp4 = call i64 @fread( i8* noalias  %buf2, i64 32, i64 1,
%struct.FILE* noalias  %tmp1 ) nounwind             ; <i64> [#uses=0]
        %tmp7 = load i32* %buf12.sub, align 4           ; <i32> [#uses=1]
        %tmp9 = malloc i8, i32 %tmp7            ; <i8*> [#uses=1]

Gets turned into:

        %buf2 = bitcast [8 x i32]* %buf12 to i8*                ; <i8*>
[#uses=1]
        %tmp4 = call i64 @fread( i8* noalias  %buf2, i64 32, i64 1,
%struct.FILE* noalias  %tmp1 ) nounwind             ; <i64> [#uses=0]
        %tmp9 = malloc i8, i32 undef            ; <i8*> [#uses=1]


To reproduce:
../../../Debug/bin/opt -anders-aa -gvn z.bc -o -|llvm-dis

-basic-aa works, does it get confused by the noalias mark?
FWIW the original C code had no aliases:
 ...
 fread(buf,sizeof(buf),1,f);
 use( malloc(*(int*)buf) );
...


-- 
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