aboutsummaryrefslogtreecommitdiff
path: root/gcc/sanopt.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@gcc.gnu.org>2018-03-23 09:55:53 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2018-03-23 09:55:53 +0100
commitee3a999fe7dfddb2531b045738ff2c0c40e6eb4c (patch)
tree2e79f430a07b923b744e3898689ee65e1e67c75d /gcc/sanopt.c
parent631270a5cedfad8267a5e7b94901035212713b61 (diff)
downloadgcc-ee3a999fe7dfddb2531b045738ff2c0c40e6eb4c.zip
gcc-ee3a999fe7dfddb2531b045738ff2c0c40e6eb4c.tar.gz
gcc-ee3a999fe7dfddb2531b045738ff2c0c40e6eb4c.tar.bz2
re PR sanitizer/85029 (-fsanitize=undefined internal compiler error: in maybe_optimize_ubsan_ptr_ifn, at sanopt.c:493)
PR sanitizer/85029 * sanopt.c (maybe_optimize_ubsan_ptr_ifn): If DECL_REGISTER (base), just don't try to optimize it rather than assert it never happens. * g++.dg/ubsan/pr85029.C: New test. From-SVN: r258794
Diffstat (limited to 'gcc/sanopt.c')
-rw-r--r--gcc/sanopt.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/sanopt.c b/gcc/sanopt.c
index 116bc38..223c06a 100644
--- a/gcc/sanopt.c
+++ b/gcc/sanopt.c
@@ -488,9 +488,9 @@ maybe_optimize_ubsan_ptr_ifn (sanopt_ctx *ctx, gimple *stmt)
&unsignedp, &reversep, &volatilep);
if ((offset == NULL_TREE || TREE_CODE (offset) == INTEGER_CST)
&& DECL_P (base)
+ && !DECL_REGISTER (base)
&& pbitpos.is_constant (&bitpos))
{
- gcc_assert (!DECL_REGISTER (base));
offset_int expr_offset;
if (offset)
expr_offset = wi::to_offset (offset) + bitpos / BITS_PER_UNIT;