[LLVMbugs] [Bug 11356] New: likely wrong code bug

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Nov 10 12:11:18 PST 2011


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

             Bug #: 11356
           Summary: likely wrong code bug
           Product: new-bugs
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: new bugs
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: regehr at cs.utah.edu
                CC: chenyang at cs.utah.edu, llvmbugs at cs.uiuc.edu
    Classification: Unclassified


Program should not crash.

[regehr at gamow tmp058]$ clang -v

clang version 3.1 (trunk 144292)
Target: x86_64-unknown-linux-gnu
Thread model: posix

[regehr at gamow tmp058]$ clang -O1 small.c ; ./a.out 
[regehr at gamow tmp058]$ clang -O3 small.c ; ./a.out 
Floating point exception

[regehr at gamow tmp058]$ cat small.c


int
func_31 (int si1, int si2)
{
  return 1 / si2;
}

int
func_38 (int left, int right)
{
  return right ? left : 0;
}

int
func_39 (int left, int right)
{
  return left;
}

int
func_47 (unsigned short left, int right)
{
  return left;
}

int g_3;
volatile int g_66[1];
int g_752;
int g_775;
int
func_58 ()
{
  return g_66[0];
}

int
func_20 (int p_22, int p_24)
{
lbl_1476:p_24 || func_58 ();
  if (0 >= g_775)
    {
    }
  else
    {
      for (; g_752; g_752 += 1)
    {
      int w = func_31 (0, p_22);
      if (func_38 (w, p_24) == g_752)
        break;
    }
      goto lbl_1476;
    }
  return 0;
}

int
func_4 (int p_5, int p_6, int p_7)
{
  int y = func_39 (p_6, 0);
  int x = func_47 (y, 0);
  func_20 (x, g_3);
  return 0;
}

int
main ()
{
  int l_2[1];
  l_2[0] = 0;
  func_4 (0, l_2[g_3], 0);
  return 0;
}

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