[llvm-commits] [llvm-gcc-4.0] r45983 - /llvm-gcc-4.0/trunk/gcc/fold-const.c

Chris Lattner sabre at nondot.org
Mon Jan 14 15:12:32 PST 2008


Author: lattner
Date: Mon Jan 14 17:12:30 2008
New Revision: 45983

URL: http://llvm.org/viewvc/llvm-project?rev=45983&view=rev
Log:
Fix PR1904, which involves merging the (GPL2) patch for PR28045 
into llvm-gcc 4.0.  llvm-gcc 4.2 already has this fix.

Modified:
    llvm-gcc-4.0/trunk/gcc/fold-const.c

Modified: llvm-gcc-4.0/trunk/gcc/fold-const.c
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.0/trunk/gcc/fold-const.c?rev=45983&r1=45982&r2=45983&view=diff

==============================================================================
--- llvm-gcc-4.0/trunk/gcc/fold-const.c (original)
+++ llvm-gcc-4.0/trunk/gcc/fold-const.c Mon Jan 14 17:12:30 2008
@@ -2377,6 +2377,11 @@
   if (TYPE_UNSIGNED (TREE_TYPE (arg0)) != TYPE_UNSIGNED (TREE_TYPE (arg1)))
     return 0;
 
+  /* If both types don't have the same precision, then it is not safe
+   to strip NOPs.  */
+  if (TYPE_PRECISION (TREE_TYPE (arg0)) != TYPE_PRECISION (TREE_TYPE (arg1)))
+    return 0;
+  
   STRIP_NOPS (arg0);
   STRIP_NOPS (arg1);
 





More information about the llvm-commits mailing list