]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR inline-asm/85022 (internal compiler error: in write_dependence_p, at alias...
authorJakub Jelinek <jakub@redhat.com>
Fri, 23 Mar 2018 09:05:56 +0000 (10:05 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Fri, 23 Mar 2018 09:05:56 +0000 (10:05 +0100)
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
gcc/alias.c
gcc/testsuite/ChangeLog
gcc/testsuite/c-c++-common/torture/pr85022.c [new file with mode: 0644]

index 9b22865704815d5c8173941dcf011b2682fe56aa..0be26ef2b1659b9fd8262f5c1afa4b27f6e2eff3 100644 (file)
@@ -1,5 +1,9 @@
 2018-03-23  Jakub Jelinek  <jakub@redhat.com>
 
+       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.
index 5fa15cbd1022961f8ffb0149d15ba39dd10e1984..eac36a515191519001881db42f6649a2294548f1 100644 (file)
@@ -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))
index 87c8970d364d5388b0b6ca34ee1c9e4e6b9e5301..14e78332f9767649115d9445bc7836642f524dfe 100644 (file)
@@ -1,5 +1,8 @@
 2018-03-23  Jakub Jelinek  <jakub@redhat.com>
 
+       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 (file)
index 0000000..3ec2c78
--- /dev/null
@@ -0,0 +1,9 @@
+/* PR inline-asm/85022 */
+
+extern struct B b;
+
+void
+foo ()
+{
+  __asm ("" : "+m" (b));
+}