From 6f5799be393e835b4cce70d070ae30039fdf38a7 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Fri, 23 Mar 2018 10:05:56 +0100 Subject: [PATCH] re PR inline-asm/85022 (internal compiler error: in write_dependence_p, at alias.c:3003) PR inline-asm/85022 * alias.c (write_dependence_p): Don't require for x_canonicalized non-VOIDmode if x has VOIDmode. * c-c++-common/torture/pr85022.c: New test. From-SVN: r258795 --- gcc/ChangeLog | 4 ++++ gcc/alias.c | 3 ++- gcc/testsuite/ChangeLog | 3 +++ gcc/testsuite/c-c++-common/torture/pr85022.c | 9 +++++++++ 4 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/c-c++-common/torture/pr85022.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 9b228657048..0be26ef2b16 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,9 @@ 2018-03-23 Jakub Jelinek + PR inline-asm/85022 + * alias.c (write_dependence_p): Don't require for x_canonicalized + non-VOIDmode if x has VOIDmode. + 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. diff --git a/gcc/alias.c b/gcc/alias.c index 5fa15cbd102..eac36a51519 100644 --- a/gcc/alias.c +++ b/gcc/alias.c @@ -2999,7 +2999,8 @@ write_dependence_p (const_rtx mem, int ret; gcc_checking_assert (x_canonicalized - ? (x_addr != NULL_RTX && x_mode != VOIDmode) + ? (x_addr != NULL_RTX + && (x_mode != VOIDmode || GET_MODE (x) == VOIDmode)) : (x_addr == NULL_RTX && x_mode == VOIDmode)); if (MEM_VOLATILE_P (x) && MEM_VOLATILE_P (mem)) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 87c8970d364..14e78332f97 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,8 @@ 2018-03-23 Jakub Jelinek + PR inline-asm/85022 + * c-c++-common/torture/pr85022.c: New test. + PR sanitizer/85029 * g++.dg/ubsan/pr85029.C: New test. diff --git a/gcc/testsuite/c-c++-common/torture/pr85022.c b/gcc/testsuite/c-c++-common/torture/pr85022.c new file mode 100644 index 00000000000..3ec2c781aa1 --- /dev/null +++ b/gcc/testsuite/c-c++-common/torture/pr85022.c @@ -0,0 +1,9 @@ +/* PR inline-asm/85022 */ + +extern struct B b; + +void +foo () +{ + __asm ("" : "+m" (b)); +} -- 2.30.2