]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
backport: re PR inline-asm/85022 (internal compiler error: in write_dependence_p...
authorJakub Jelinek <jakub@redhat.com>
Mon, 25 Jun 2018 17:37:40 +0000 (19:37 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Mon, 25 Jun 2018 17:37:40 +0000 (19:37 +0200)
Backported from mainline
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.

* c-c++-common/torture/pr85022.c: New test.

From-SVN: r262083

gcc/ChangeLog
gcc/alias.c
gcc/testsuite/ChangeLog
gcc/testsuite/c-c++-common/torture/pr85022.c [new file with mode: 0644]

index 922d742f05a6c66136848947cb834627a1c5ba58..0475fb013a04e047da349d261dc8121a8bece080 100644 (file)
@@ -1,6 +1,12 @@
 2018-06-25  Jakub Jelinek  <jakub@redhat.com>
 
        Backported from mainline
+       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.
+
        2018-03-22  Jakub Jelinek  <jakub@redhat.com>
 
        PR inline-asm/84941
index c581732d3a511319ba7fd8319525633b2ff35cd2..9a2b91dd603dfc13bedc6c26a33f0857b84eb671 100644 (file)
@@ -2978,7 +2978,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 6249ab542433e8d9434ed2611385289d1d4a6da6..810edf050d096040fd24d02a0f76f409176636e7 100644 (file)
@@ -1,6 +1,11 @@
 2018-06-25  Jakub Jelinek  <jakub@redhat.com>
 
        Backported from mainline
+       2018-03-23  Jakub Jelinek  <jakub@redhat.com>
+
+       PR inline-asm/85022
+       * c-c++-common/torture/pr85022.c: New test.
+
        2018-03-22  Jakub Jelinek  <jakub@redhat.com>
 
        PR inline-asm/84941
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));
+}