aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/c-c++-common/Wduplicated-branches-13.c
diff options
context:
space:
mode:
authorMarek Polacek <polacek@redhat.com>2017-01-26 11:37:33 +0000
committerMarek Polacek <mpolacek@gcc.gnu.org>2017-01-26 11:37:33 +0000
commit0a38b341a8c6e6ee8357ca78c3105b7082337611 (patch)
tree882bcee393cd010c57edabcd8c3e0e1059edea07 /gcc/testsuite/c-c++-common/Wduplicated-branches-13.c
parent237499040f67c64bd509efe133f7463816bef933 (diff)
downloadgcc-0a38b341a8c6e6ee8357ca78c3105b7082337611.zip
gcc-0a38b341a8c6e6ee8357ca78c3105b7082337611.tar.gz
gcc-0a38b341a8c6e6ee8357ca78c3105b7082337611.tar.bz2
re PR c/79199 (ICE with -Wduplicated-branches)
PR c/79199 * fold-const.c (operand_equal_p) [COND_EXPR]: Use OP_SAME_WITH_NULL for the third operand. * c-c++-common/Wduplicated-branches-13.c: New test. From-SVN: r244928
Diffstat (limited to 'gcc/testsuite/c-c++-common/Wduplicated-branches-13.c')
-rw-r--r--gcc/testsuite/c-c++-common/Wduplicated-branches-13.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/gcc/testsuite/c-c++-common/Wduplicated-branches-13.c b/gcc/testsuite/c-c++-common/Wduplicated-branches-13.c
new file mode 100644
index 0000000..7aa5b37
--- /dev/null
+++ b/gcc/testsuite/c-c++-common/Wduplicated-branches-13.c
@@ -0,0 +1,23 @@
+/* PR c/79199 */
+/* { dg-do compile } */
+/* { dg-options "-Wduplicated-branches" } */
+
+unsigned int a, b, c, d, e;
+void
+fn1 (void)
+{
+ if (0) /* { dg-warning "this condition has identical branches" } */
+ {
+ if (d > 4294967293)
+ (void) 5;
+ c = d;
+ b = e | a;
+ }
+ else
+ {
+ if (d > 4294967293)
+ (void) 5;
+ c = d;
+ b = e | a;
+ }
+}