re PR target/87598 (Rejects "%a0" with constant)
authorJakub Jelinek <jakub@redhat.com>
Thu, 6 Dec 2018 12:20:09 +0000 (13:20 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Thu, 6 Dec 2018 12:20:09 +0000 (13:20 +0100)
PR target/87598
* config/aarch64/aarch64.c (aarch64_print_address_internal): Don't
call output_operand_lossage on VOIDmode CONST_INTs.  After
output_operand_lossage do return false.

* gcc.target/aarch64/asm-5.c: New test.

From-SVN: r266852

gcc/ChangeLog
gcc/config/aarch64/aarch64.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/aarch64/asm-5.c [new file with mode: 0644]

index 168929181dd95e83043c9d6c9212c8fcea64eb1f..cded91e60bede88c66967ce14fc9a9fb05998501 100644 (file)
@@ -1,3 +1,10 @@
+2018-12-06  Jakub Jelinek  <jakub@redhat.com>
+
+       PR target/87598
+       * config/aarch64/aarch64.c (aarch64_print_address_internal): Don't
+       call output_operand_lossage on VOIDmode CONST_INTs.  After
+       output_operand_lossage do return false.
+
 2018-12-06  Richard Biener  <rguenther@suse.de>
 
        * df-problems.c (df_rd_local_compute): Use bitmap_release.
index 3d597ca95c711d7f32ac0ee726be35bbb3bc331e..490a2038b8e07502f385aa9237d59d8c2b9b31dd 100644 (file)
@@ -7635,8 +7635,13 @@ aarch64_print_address_internal (FILE *f, machine_mode mode, rtx x,
   unsigned int size;
 
   /* Check all addresses are Pmode - including ILP32.  */
-  if (GET_MODE (x) != Pmode)
-    output_operand_lossage ("invalid address mode");
+  if (GET_MODE (x) != Pmode
+      && (!CONST_INT_P (x)
+         || trunc_int_for_mode (INTVAL (x), Pmode) != INTVAL (x)))
+    {
+      output_operand_lossage ("invalid address mode");
+      return false;
+    }
 
   if (aarch64_classify_address (&addr, x, mode, true, type))
     switch (addr.type)
index 13d2e25a096563f8e4bcbb25f3de410505afe911..bda8476a4ad8e3e3def708bbe9ff83644a5c0f56 100644 (file)
@@ -1,5 +1,8 @@
 2018-12-06  Jakub Jelinek  <jakub@redhat.com>
 
+       PR target/87598
+       * gcc.target/aarch64/asm-5.c: New test.
+
        PR tree-optimization/85726
        * gcc.dg/tree-ssa/pr85726-1.c: New test.
        * gcc.dg/tree-ssa/pr85726-2.c: New test.
diff --git a/gcc/testsuite/gcc.target/aarch64/asm-5.c b/gcc/testsuite/gcc.target/aarch64/asm-5.c
new file mode 100644 (file)
index 0000000..1a5ebdc
--- /dev/null
@@ -0,0 +1,8 @@
+/* PR target/87598 */
+/* { dg-do compile } */
+
+void
+foo (void)
+{
+  __asm__ ("# %a0" : : "i" (0));
+}