[LLVMbugs] [Bug 8554] New: clang fails GCC test 20020614.c: illegal simplifications when folding constants

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Nov 5 10:26:40 PDT 2010


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

           Summary: clang fails GCC test 20020614.c: illegal
                    simplifications when folding constants
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: jpbonn-keyword-llvmbug.a51747 at corniceresearch.com
                CC: llvmbugs at cs.uiuc.edu


This test fails with clang v118276 on Intel OSX (and probably others).  I
haven't looked at it at all. It's from the GCC testsuite:
gcc.c-torture/execute/20020614.c

/* PR c/6677 */
/* Verify that GCC doesn't perform illegal simplifications
   when folding constants.  */

#include <limits.h>

extern void abort (void);
extern void exit (int);

int main (void)
{
  int i;
  signed char j;
  unsigned char k;

  i = SCHAR_MAX;

  j = ((signed char) (i << 1)) / 2;

  if (j != -1)
    abort();

  j = ((signed char) (i * 2)) / 2;

  if (j != -1)
    abort();

  i = UCHAR_MAX;

  k = ((unsigned char) (i << 1)) / 2;

  if (k != UCHAR_MAX/2)
    abort();

  k = ((unsigned char) (i * 2)) / 2;

  if (k != UCHAR_MAX/2)
    abort();

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