This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Fix ICE with -Wduplicated-branches (PR c/79199)
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Andreas Schwab <schwab at linux-m68k dot org>
- Cc: Marek Polacek <polacek at redhat dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 27 Jan 2017 14:25:55 +0100
- Subject: Re: Fix ICE with -Wduplicated-branches (PR c/79199)
- Authentication-results: sourceware.org; auth=none
- References: <20170126112102.GA6809@redhat.com> <87tw8kr699.fsf@linux-m68k.org>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
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