[LLVMbugs] [Bug 2302] New: Incorrect optimization with recursive call to main

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Fri May 9 06:02:11 PDT 2008


           Summary: Incorrect optimization with recursive call to main
           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: sharparrow1 at yahoo.com
                CC: llvmbugs at cs.uiuc.edu

#include <stdio.h>
#include <stdlib.h>
int x;
int main() {
if (++x > 10) exit(0);
else main();
return 0;

This program should not print any text; compiled with llvm-gcc -O3, it does.

AFAIK, this is perfectly legal C code (although not legal C++).

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