aboutsummaryrefslogtreecommitdiff
path: root/gcc/fold-const.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2019-03-15 10:23:11 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2019-03-15 10:23:11 +0100
commit4e6482d05be433b819e3ec9ab6f058d575f084ea (patch)
tree7dda386820bff124d8b717747e3aa2e9c0ba77c5 /gcc/fold-const.c
parent8eb2215d8dc2662c3edad179b842097e0dce2722 (diff)
downloadgcc-4e6482d05be433b819e3ec9ab6f058d575f084ea.zip
gcc-4e6482d05be433b819e3ec9ab6f058d575f084ea.tar.gz
gcc-4e6482d05be433b819e3ec9ab6f058d575f084ea.tar.bz2
re PR c++/89709 (ICE with constexpr and "-O")
PR c++/89709 * tree.c (inchash::add_expr): Strip any location wrappers. * fold-const.c (operand_equal_p): Move stripping of location wrapper after hash verification. * g++.dg/cpp0x/constexpr-89709.C: New test. From-SVN: r269702
Diffstat (limited to 'gcc/fold-const.c')
-rw-r--r--gcc/fold-const.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index dbc9679..ec28b43 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -2942,9 +2942,6 @@ combine_comparisons (location_t loc,
int
operand_equal_p (const_tree arg0, const_tree arg1, unsigned int flags)
{
- STRIP_ANY_LOCATION_WRAPPER (arg0);
- STRIP_ANY_LOCATION_WRAPPER (arg1);
-
/* When checking, verify at the outermost operand_equal_p call that
if operand_equal_p returns non-zero then ARG0 and ARG1 has the same
hash value. */
@@ -2967,6 +2964,9 @@ operand_equal_p (const_tree arg0, const_tree arg1, unsigned int flags)
return 0;
}
+ STRIP_ANY_LOCATION_WRAPPER (arg0);
+ STRIP_ANY_LOCATION_WRAPPER (arg1);
+
/* If either is ERROR_MARK, they aren't equal. */
if (TREE_CODE (arg0) == ERROR_MARK || TREE_CODE (arg1) == ERROR_MARK
|| TREE_TYPE (arg0) == error_mark_node