rpms/gcc/devel gcc43-pr37103.patch,NONE,1.1 gcc43.spec,1.37,1.38

Jakub Jelinek (jakub) fedora-extras-commits at redhat.com
Thu Aug 14 07:11:10 UTC 2008


Author: jakub

Update of /cvs/pkgs/rpms/gcc/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv23054

Modified Files:
	gcc43.spec 
Added Files:
	gcc43-pr37103.patch 
Log Message:
4.3.1-7

gcc43-pr37103.patch:

--- NEW FILE gcc43-pr37103.patch ---
2008-08-13  Jakub Jelinek  <jakub at redhat.com>

	PR middle-end/37103
	* fold-const.c (fold_widened_comparison): Do not allow
	sign changes that change the result even if shorter type
	is wider than arg1_unw's type.

	* gcc.c-torture/execute/20080813-1.c: New test.

--- gcc/fold-const.c.jj	2008-08-13 19:46:11.000000000 +0200
+++ gcc/fold-const.c	2008-08-13 20:18:21.000000000 +0200
@@ -6733,10 +6733,8 @@ fold_widened_comparison (enum tree_code 
   if ((code == EQ_EXPR || code == NE_EXPR
        || TYPE_UNSIGNED (TREE_TYPE (arg0)) == TYPE_UNSIGNED (shorter_type))
       && (TREE_TYPE (arg1_unw) == shorter_type
-	  || (TYPE_PRECISION (shorter_type)
-	      > TYPE_PRECISION (TREE_TYPE (arg1_unw)))
 	  || ((TYPE_PRECISION (shorter_type)
-	       == TYPE_PRECISION (TREE_TYPE (arg1_unw)))
+	       >= TYPE_PRECISION (TREE_TYPE (arg1_unw)))
 	      && (TYPE_UNSIGNED (shorter_type)
 		  == TYPE_UNSIGNED (TREE_TYPE (arg1_unw))))
 	  || (TREE_CODE (arg1_unw) == INTEGER_CST
--- gcc/testsuite/gcc.c-torture/execute/20080813-1.c.jj	2008-08-13 20:22:56.000000000 +0200
+++ gcc/testsuite/gcc.c-torture/execute/20080813-1.c	2008-08-13 20:22:10.000000000 +0200
@@ -0,0 +1,30 @@
+/* PR middle-end/37103 */
+
+extern void abort (void);
+
+void
+foo (unsigned short x)
+{
+  signed char y = -1;
+  if (x == y)
+    abort ();
+}
+
+void
+bar (unsigned short x)
+{
+  unsigned char y = -1;
+  if (x == y)
+    abort ();
+}
+
+int
+main (void)
+{
+  if (sizeof (int) == sizeof (short))
+    return 0;
+  foo (-1);
+  if (sizeof (short) > 1)
+    bar (-1);
+  return 0;
+}


Index: gcc43.spec
===================================================================
RCS file: /cvs/pkgs/rpms/gcc/devel/gcc43.spec,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -r1.37 -r1.38
--- gcc43.spec	12 Aug 2008 19:35:02 -0000	1.37
+++ gcc43.spec	14 Aug 2008 07:10:39 -0000	1.38
@@ -143,6 +143,7 @@
 Patch14: gcc43-rh251682.patch
 Patch15: gcc43-sparc-config-detection.patch
 Patch16: gcc43-libgomp-omp_h-multilib.patch
+Patch17: gcc43-pr37103.patch
 
 # On ARM EABI systems, we do want -gnueabi to be part of the
 # target triple.
@@ -443,6 +444,7 @@
 %patch14 -p0 -b .rh251682~
 %patch15 -p0 -b .sparc-config-detection~
 %patch16 -p0 -b .libgomp-omp_h-multilib~
+%patch17 -p0 -b .pr37103~
 
 tar xzf %{SOURCE4}
 
@@ -1664,13 +1666,14 @@
 %doc rpm.doc/changelogs/libmudflap/ChangeLog*
 
 %changelog
-* Tue Aug 12 2008 Jakub Jelinek <jakub at redhat.com> 4.3.1-7
+* Thu Aug 14 2008 Jakub Jelinek <jakub at redhat.com> 4.3.1-7
 - update from gcc-4_3-branch
   - PRs bootstrap/35752, c++/36688, c++/36999, c++/37016, c/35746,
 	fortran/36582, libgcj/31890, middle-end/35432, middle-end/36691,
 	middle-end/37014, middle-end/37026, middle-end/37042,
 	rtl-optimization/35542, rtl-optimization/36998, target/35659,
 	target/36613, tree-optimization/36991
+- fix folding of widened comparisons (PR middle-end/37103)
 
 * Fri Aug  1 2008 Jakub Jelinek <jakub at redhat.com> 4.3.1-6
 - update from gcc-4_3-branch




More information about the fedora-extras-commits mailing list