[LLVMbugs] [Bug 1823] New: 'noalias' attribute lost when compiling with optimization

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Sun Nov 25 06:14:09 PST 2007


           Summary: 'noalias' attribute lost when compiling with
           Product: new-bugs
           Version: unspecified
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: new bugs
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: baldrick at free.fr
                CC: llvmbugs at cs.uiuc.edu


#include <stdio.h>
#include <stdlib.h>

int power(int X) {
  if (X == 0) return 1;
  return X*power(X-1);

int main(int argc, char **argv) {
  printf("%d\n", power(atoi(argv[0])));

When compiled at -O0 the declaration of printf is:

declare i32 @printf(i8* noalias , ...) nounwind

When compiled at -O1 it is:

declare i32 @printf(i8*, ...) nounwind

Somehow the noalias attribute gets lost at -O1.

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