aboutsummaryrefslogtreecommitdiff
path: root/gcc/fold-const.c
diff options
context:
space:
mode:
authorMarek Polacek <polacek@redhat.com>2016-04-29 12:32:45 +0000
committerMarek Polacek <mpolacek@gcc.gnu.org>2016-04-29 12:32:45 +0000
commit500ecf4abd0f29d0cb4555de105a3f4152b6c423 (patch)
tree8749fd9d4a954d7caca29c71b93fd5d965172f0e /gcc/fold-const.c
parenta1f7021242e827f69cd1c2ed5d5eaf33ddfcd196 (diff)
downloadgcc-500ecf4abd0f29d0cb4555de105a3f4152b6c423.zip
gcc-500ecf4abd0f29d0cb4555de105a3f4152b6c423.tar.gz
gcc-500ecf4abd0f29d0cb4555de105a3f4152b6c423.tar.bz2
re PR sanitizer/70342 (g++ -fsanitize=undefined never finishes compiling (>24h) in qtxmlpatterns test suite)
PR sanitizer/70342 * fold-const.c (tree_single_nonzero_warnv_p): For TARGET_EXPR, use TARGET_EXPR_SLOT as a base. * g++.dg/ubsan/null-7.C: New test. Co-Authored-By: Jakub Jelinek <jakub@redhat.com> From-SVN: r235637
Diffstat (limited to 'gcc/fold-const.c')
-rw-r--r--gcc/fold-const.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index 69749a8..4aa2412 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -13534,6 +13534,9 @@ tree_single_nonzero_warnv_p (tree t, bool *strict_overflow_p)
if (!DECL_P (base))
base = get_base_address (base);
+ if (base && TREE_CODE (base) == TARGET_EXPR)
+ base = TARGET_EXPR_SLOT (base);
+
if (!base)
return false;