re PR target/56228 (Indirect call fails to assemble)
authorJakub Jelinek <jakub@redhat.com>
Thu, 7 Feb 2013 08:04:58 +0000 (09:04 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Thu, 7 Feb 2013 08:04:58 +0000 (09:04 +0100)
PR target/56228
* config/rs6000/rs6000.md (ptrm): New mode attr.
(call_indirect_aix<ptrsize>, call_indirect_aix<ptrsize>_nor11,
call_value_indirect_aix<pttrsize>,
call_value_indirect_aix<pttrsize>_nor11): Use <ptrm> instead of
m in constraints.

* gcc.dg/pr56228.c: New test.

From-SVN: r195840

gcc/ChangeLog
gcc/config/rs6000/rs6000.md
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/pr56228.c [new file with mode: 0644]

index 9634c059c2e58cd2d2e15d18bb61391b95d4a2a6..175b85bb2648d7a81d9cfd2cc5986cd81389b32b 100644 (file)
@@ -1,3 +1,12 @@
+2013-02-07  Jakub Jelinek  <jakub@redhat.com>
+
+       PR target/56228
+       * config/rs6000/rs6000.md (ptrm): New mode attr.
+       (call_indirect_aix<ptrsize>, call_indirect_aix<ptrsize>_nor11,
+       call_value_indirect_aix<pttrsize>,
+       call_value_indirect_aix<pttrsize>_nor11): Use <ptrm> instead of
+       m in constraints.
+
 2013-02-07  Michael Haubenwallner  <michael.haubenwallner@salomon.at>
 
        * collect2.c (main): Set aix64_flag for -G and -bsvr4 too, disable
index b3db6817647e08803c87524320975311d7b2ef55..a665fa50abfd159a40f80a510136ac66645a1641 100644 (file)
 (define_mode_attr ptrload [(SI "lwz")
                           (DI "ld")])
 
+(define_mode_attr ptrm [(SI "m")
+                       (DI "Y")])
+
 (define_mode_attr rreg [(SF   "f")
                        (DF   "ws")
                        (V4SF "wf")
 (define_insn "call_indirect_aix<ptrsize>"
   [(call (mem:SI (match_operand:P 0 "register_operand" "c,*l"))
         (match_operand 1 "" "g,g"))
-   (use (match_operand:P 2 "memory_operand" "m,m"))
-   (set (reg:P TOC_REGNUM) (match_operand:P 3 "memory_operand" "m,m"))
+   (use (match_operand:P 2 "memory_operand" "<ptrm>,<ptrm>"))
+   (set (reg:P TOC_REGNUM) (match_operand:P 3 "memory_operand" "<ptrm>,<ptrm>"))
    (use (reg:P STATIC_CHAIN_REGNUM))
    (clobber (reg:P LR_REGNO))]
   "DEFAULT_ABI == ABI_AIX && TARGET_POINTERS_TO_NESTED_FUNCTIONS"
 (define_insn "call_indirect_aix<ptrsize>_nor11"
   [(call (mem:SI (match_operand:P 0 "register_operand" "c,*l"))
         (match_operand 1 "" "g,g"))
-   (use (match_operand:P 2 "memory_operand" "m,m"))
-   (set (reg:P TOC_REGNUM) (match_operand:P 3 "memory_operand" "m,m"))
+   (use (match_operand:P 2 "memory_operand" "<ptrm>,<ptrm>"))
+   (set (reg:P TOC_REGNUM) (match_operand:P 3 "memory_operand" "<ptrm>,<ptrm>"))
    (clobber (reg:P LR_REGNO))]
   "DEFAULT_ABI == ABI_AIX && !TARGET_POINTERS_TO_NESTED_FUNCTIONS"
   "<ptrload> 2,%2\;b%T0l\;<ptrload> 2,%3"
   [(set (match_operand 0 "" "")
        (call (mem:SI (match_operand:P 1 "register_operand" "c,*l"))
              (match_operand 2 "" "g,g")))
-   (use (match_operand:P 3 "memory_operand" "m,m"))
-   (set (reg:P TOC_REGNUM) (match_operand:P 4 "memory_operand" "m,m"))
+   (use (match_operand:P 3 "memory_operand" "<ptrm>,<ptrm>"))
+   (set (reg:P TOC_REGNUM) (match_operand:P 4 "memory_operand" "<ptrm>,<ptrm>"))
    (use (reg:P STATIC_CHAIN_REGNUM))
    (clobber (reg:P LR_REGNO))]
   "DEFAULT_ABI == ABI_AIX && TARGET_POINTERS_TO_NESTED_FUNCTIONS"
   [(set (match_operand 0 "" "")
        (call (mem:SI (match_operand:P 1 "register_operand" "c,*l"))
              (match_operand 2 "" "g,g")))
-   (use (match_operand:P 3 "memory_operand" "m,m"))
-   (set (reg:P TOC_REGNUM) (match_operand:P 4 "memory_operand" "m,m"))
+   (use (match_operand:P 3 "memory_operand" "<ptrm>,<ptrm>"))
+   (set (reg:P TOC_REGNUM) (match_operand:P 4 "memory_operand" "<ptrm>,<ptrm>"))
    (clobber (reg:P LR_REGNO))]
   "DEFAULT_ABI == ABI_AIX && !TARGET_POINTERS_TO_NESTED_FUNCTIONS"
   "<ptrload> 2,%3\;b%T1l\;<ptrload> 2,%4"
index d3407fdcbf81b25f3aa033e5e23f290b7e87b37e..49f87f1f4a9f27ad7cb8bbb5ad51270223622d41 100644 (file)
@@ -1,3 +1,8 @@
+2013-02-07  Jakub Jelinek  <jakub@redhat.com>
+
+       PR target/56228
+       * gcc.dg/pr56228.c: New test.
+
 2013-02-07  Alan Modra  <amodra@gmail.com>
 
        PR target/54009
diff --git a/gcc/testsuite/gcc.dg/pr56228.c b/gcc/testsuite/gcc.dg/pr56228.c
new file mode 100644 (file)
index 0000000..ccdcbe1
--- /dev/null
@@ -0,0 +1,16 @@
+/* PR target/56228 */
+/* { dg-do assemble } */
+/* { dg-options "-O2" } */
+
+short a[14] = { 1, 2 };
+short b[15] = { 3, 4 };
+
+int
+foo ()
+{
+  void (*fna) (void) = (void (*) (void)) a;
+  void (*fnb) (void) = (void (*) (void)) b;
+  fna ();
+  fnb ();
+  return a[1] == b[1];
+}