[LLVMbugs] [Bug 17073] New: wrong code (SIGFPE) at -O3 on x86_64-linux-gnu (in 32-bit mode)

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Sep 2 23:10:57 PDT 2013


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

            Bug ID: 17073
           Summary: wrong code (SIGFPE) at -O3 on x86_64-linux-gnu (in
                    32-bit mode)
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: LLVM Codegen
          Assignee: unassignedclangbugs at nondot.org
          Reporter: su at cs.ucdavis.edu
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

The following code is miscompiled by the current clang trunk, clang 3.2, and
clang 3.3 on x86_64-linux-gnu at -O3 in 32-bit mode, resulting in a SIGFPE. 

$ clang-trunk -v
clang version 3.4 (trunk 189735)
$ clang-trunk -m32 -O2 small.c
$ a.out
$ clang-trunk -m32 -O3 small.c
$ a.out
Floating point exception (core dumped)
$ clang-3.3 -m32 -O3 small.c
$ a.out
Floating point exception (core dumped)
$ clang-3.2 -m32 -O3 small.c
$ a.out
Floating point exception (core dumped)
$ clang-trunk -m64 -O3 small.c
$ a.out
$ 


------------------------------------

int a, b, d, e, *f = &b, g, i;
char c;

int 
foo (int p1, long long p2)
{
  return p2 == 0 ? 0 : p1 % p2;
}

void
bar (int p)
{
 lbl:
  if (*f)
    g = 0;
  int **l = &f;
  *l = 0;
  for (; i < 1; i++)
    {
      if (i)
    goto lbl;
      if (foo (2, d || p))
    {
      int **m = &f;
      *m = &e;
    }
    }
}

int
main ()
{
  bar (&c == (void *)&a);
  return 0;
}

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20130903/b6b8b6a4/attachment.html>


More information about the llvm-bugs mailing list