This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Fix ICE with -Wduplicated-branches (PR c/79199)


On Fri, Jan 27, 2017 at 02:18:10PM +0100, Andreas Schwab wrote:
> FAIL: c-c++-common/Wduplicated-branches-13.c  -std=gnu++98 (test for excess errors)
> Excess errors:
> /daten/aranym/gcc/gcc-20170127/gcc/testsuite/c-c++-common/Wduplicated-branches-13.c:11:7: warning: this decimal constant is unsigned only in ISO C90
> /daten/aranym/gcc/gcc-20170127/gcc/testsuite/c-c++-common/Wduplicated-branches-13.c:18:7: warning: this decimal constant is unsigned only in ISO C90

Fixed thusly, tested on x86_64-linux -m32/-m64, committed to trunk as
obvious.

2017-01-27  Jakub Jelinek  <jakub@redhat.com>

	PR c/79199
	* c-c++-common/Wduplicated-branches-13.c: Require int32plus effective
	target.  Use 4294967293U instead of 4294967293.

--- gcc/testsuite/c-c++-common/Wduplicated-branches-13.c.jj	2017-01-26 13:20:49.000000000 +0100
+++ gcc/testsuite/c-c++-common/Wduplicated-branches-13.c	2017-01-27 14:22:18.418565985 +0100
@@ -1,5 +1,5 @@
 /* PR c/79199 */
-/* { dg-do compile } */
+/* { dg-do compile { target int32plus } } */
 /* { dg-options "-Wduplicated-branches" } */
 
 unsigned int a, b, c, d, e;
@@ -8,14 +8,14 @@ fn1 (void)
 {
   if (0) /* { dg-warning "this condition has identical branches" } */
     {
-      if (d > 4294967293)
+      if (d > 4294967293U)
 	(void) 5;
       c = d;
       b = e | a;
     }
   else
     {
-      if (d > 4294967293)
+      if (d > 4294967293U)
 	(void) 5;
       c = d;
       b = e | a;


	Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]