From 12651878c680a8568e4d6c03b72d05728f0637fc Mon Sep 17 00:00:00 2001 From: Marek Polacek Date: Fri, 2 Oct 2015 17:49:15 +0000 Subject: [PATCH] re PR c/67819 (-Wduplicated-cond should take macros into account) * genemit.c (gen_exp): Remove -Wduplicated-cond hack. * c.opt (Wduplicated-cond): Don't enable by -Wall anymore. * c-c++-common/Wduplicated-cond-2.c: Skip until PR67819 is resolved. From-SVN: r228405 --- gcc/ChangeLog | 4 ++++ gcc/c-family/ChangeLog | 4 ++++ gcc/c-family/c.opt | 2 +- gcc/genemit.c | 2 +- gcc/testsuite/ChangeLog | 4 ++++ gcc/testsuite/c-c++-common/Wduplicated-cond-2.c | 1 + 6 files changed, 15 insertions(+), 2 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index f9e53727168..6e4181092fe 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +2015-10-02 Marek Polacek + + * genemit.c (gen_exp): Remove -Wduplicated-cond hack. + 2015-10-02 Aditya Kumar * graphite-scop-detection.c (loop_ivs_can_be_represented): New. diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog index 8ab8964a8c5..78cc2bdc8b8 100644 --- a/gcc/c-family/ChangeLog +++ b/gcc/c-family/ChangeLog @@ -1,3 +1,7 @@ +2015-10-02 Marek Polacek + + * c.opt (Wduplicated-cond): Don't enable by -Wall anymore. + 2015-10-02 Marek Polacek PR c/64249 diff --git a/gcc/c-family/c.opt b/gcc/c-family/c.opt index a79b9f1a39f..c62eefb98c2 100644 --- a/gcc/c-family/c.opt +++ b/gcc/c-family/c.opt @@ -407,7 +407,7 @@ C ObjC C++ ObjC++ Var(warn_div_by_zero) Init(1) Warning Warn about compile-time integer division by zero Wduplicated-cond -C ObjC C++ ObjC++ Var(warn_duplicated_cond) Warning LangEnabledBy(C ObjC C++ ObjC++,Wall) +C ObjC C++ ObjC++ Var(warn_duplicated_cond) Init(0) Warning Warn about duplicated conditions in an if-else-if chain Weffc++ diff --git a/gcc/genemit.c b/gcc/genemit.c index 13f911955bc..e92f75750ec 100644 --- a/gcc/genemit.c +++ b/gcc/genemit.c @@ -182,7 +182,7 @@ gen_exp (rtx x, enum rtx_code subroutine_type, char *used) && INTVAL (x) <= MAX_SAVED_CONST_INT) printf ("const_int_rtx[MAX_SAVED_CONST_INT + (%d)]", (int) INTVAL (x)); - else if (STORE_FLAG_VALUE > 1 && INTVAL (x) == STORE_FLAG_VALUE) + else if (INTVAL (x) == STORE_FLAG_VALUE) printf ("const_true_rtx"); else { diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 58a0289a244..8211e03f943 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2015-10-02 Marek Polacek + + * c-c++-common/Wduplicated-cond-2.c: Skip until PR67819 is resolved. + 2015-10-02 Sebastian Pop PR tree-optimization/67754 diff --git a/gcc/testsuite/c-c++-common/Wduplicated-cond-2.c b/gcc/testsuite/c-c++-common/Wduplicated-cond-2.c index 90a866305bf..c424e766442 100644 --- a/gcc/testsuite/c-c++-common/Wduplicated-cond-2.c +++ b/gcc/testsuite/c-c++-common/Wduplicated-cond-2.c @@ -1,6 +1,7 @@ /* PR c/64249 */ /* { dg-do compile } */ /* { dg-options "-Wall" } */ +/* { dg-skip-if "PR67819" { *-*-* } } */ #ifndef __cplusplus # define bool _Bool -- 2.30.2