diff options
author | Jakub Jelinek <jakub@redhat.com> | 2018-03-29 12:37:58 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2018-03-29 12:37:58 +0200 |
commit | 063700a6d28128dcabfb1d54b5fea4e7408df56c (patch) | |
tree | c59d98270fe371507005e2bd264ca89f620eb47a /gcc/fold-const.c | |
parent | 52df8bd93305f5ccd6a78eeebef9eb85c2208fed (diff) | |
download | gcc-063700a6d28128dcabfb1d54b5fea4e7408df56c.zip gcc-063700a6d28128dcabfb1d54b5fea4e7408df56c.tar.gz gcc-063700a6d28128dcabfb1d54b5fea4e7408df56c.tar.bz2 |
re PR c/85094 (-g with any optimization suppresses -Wduplicated-branches)
PR c/85094
* fold-const.c (operand_equal_p): Handle DEBUG_BEGIN_STMT.
For STATEMENT_LIST, pass down OEP_LEXICOGRAPHIC and maybe
OEP_NO_HASH_CHECK for recursive call, to avoid exponential
checking.
* c-c++-common/Wduplicated-branches-14.c: New test.
From-SVN: r258950
Diffstat (limited to 'gcc/fold-const.c')
-rw-r--r-- | gcc/fold-const.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c index 87d00a5..014c7d4 100644 --- a/gcc/fold-const.c +++ b/gcc/fold-const.c @@ -3479,7 +3479,8 @@ operand_equal_p (const_tree arg0, const_tree arg1, unsigned int flags) if (tsi_end_p (tsi1) && tsi_end_p (tsi2)) return 1; if (!operand_equal_p (tsi_stmt (tsi1), tsi_stmt (tsi2), - OEP_LEXICOGRAPHIC)) + flags & (OEP_LEXICOGRAPHIC + | OEP_NO_HASH_CHECK))) return 0; } } @@ -3492,6 +3493,10 @@ operand_equal_p (const_tree arg0, const_tree arg1, unsigned int flags) if (flags & OEP_LEXICOGRAPHIC) return OP_SAME_WITH_NULL (0); return 0; + case DEBUG_BEGIN_STMT: + if (flags & OEP_LEXICOGRAPHIC) + return 1; + return 0; default: return 0; } |