]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blobdiff - src/patches/gcc-pr28045.patch
Updated ClamAV to 0.92
[people/pmueller/ipfire-2.x.git] / src / patches / gcc-pr28045.patch
diff --git a/src/patches/gcc-pr28045.patch b/src/patches/gcc-pr28045.patch
new file mode 100644 (file)
index 0000000..b38ff9e
--- /dev/null
@@ -0,0 +1,41 @@
+Index: fold-const.c
+===================================================================
+*** gcc4.0.3/gcc/fold-const.c  (revision 114755)
+--- gcc4.0.3/fold-const.c      (working copy)
+*************** operand_equal_p (tree arg0, tree arg1, u
+*** 2497,2502 ****
+--- 2497,2507 ----
+    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);
+  
+
+
+/* { dg-do run } */
+
+extern void abort(void);
+struct a
+{
+   unsigned int bits : 1;
+   signed long val : ((sizeof(long) * 8) - 1);
+};
+int Fnegate (struct a b)
+{
+  if ((-((long)b.val)) <= ((long) ((1UL << ((sizeof(long) * 8) - 2)) -1UL))
+      && (-((long)b.val)) >= (-(((long) ((1UL << ((sizeof(long) * 8) - 2)) -1UL))) - 1))
+     return 0 ;
+  abort ();
+}
+int main ()
+{
+  struct a b = {1, 1};
+  Fnegate (b);
+  return 0;
+}