]> 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>
Fri, 22 Jun 2018 20:57:15 +0000 (22:57 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Fri, 22 Jun 2018 20:57:15 +0000 (22:57 +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: r261937

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

index 8320ac48e72bb80e9dc269c95511e7ff4865856f..546fbf3c80f4235a77271cd9c2960b6371a313d9 100644 (file)
@@ -1,6 +1,12 @@
 2018-06-22  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 e16e3501522e539f07759c4188aebb9f9ae859b6..e6d67b1200c90d6eaae5af18958999fd13f00801 100644 (file)
@@ -2997,7 +2997,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 13b3b3ceaee1d2df6a15334da18819f10a34874b..6a4fd900848b404ee47df5cf228102d42265a419 100644 (file)
@@ -1,6 +1,11 @@
 2018-06-22  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));
+}