[LLVMbugs] [Bug 2507] New: Anders-AA returns wrong mod/ ref info for external function call

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Mon Jun 30 02:32:02 PDT 2008


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

           Summary: Anders-AA returns wrong mod/ref info for external
                    function call
           Product: libraries
           Version: 2.3
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Interprocedural Analyses
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: hvdieren at elis.ugent.be
                CC: llvmbugs at cs.uiuc.edu


Created an attachment (id=1784)
 --> (http://llvm.org/bugs/attachment.cgi?id=1784)
failing test case

Hi,

When studying some alias analysis results, I found this wrong behavior in
Andersen's Alias Analysis. The C-code for the sample program is listed here,
the bc is attached:
#include <stdio.h>

int main( int argc, char * argv[] ) {
    int n, i, nelem, sum;
    char buf[128];
    int arr[256];

    i = 0;
    while( fgets( buf, sizeof(buf), stdin ) ) {
        n = atoi( buf );
        arr[i++] = n;
    }
    nelem = i;

    sum = 0;
    for( i=0; i < nelem; ++i ) {
        sum += arr[i];
        arr[i] = 0;
    }
    printf( "Sum is: %d\n", sum );
}

Running -anders-aa:
% opt -anders-aa -count-aa -count-aa-print-all-queries -aa-eval
-disable-inlining -disable-opt -f sample2.bc -o sample2.opt.bc  

I get, amongst others:
NoModRef:  Ptr: [128B] [128 x i8]* %buf <->     %tmp = call i32 (...)* @atoi(
[128 x i8]* %buf ) nounwind               ; <i32> [#uses=1]

This should be a Ref result instead of NoModRef.

Hans.


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