]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
rs6000.c (rs6000_option_override_internal): Replace "DEFAULT_ABI != ABI_AIX" test...
authorUlrich Weigand <uweigand@de.ibm.com>
Thu, 14 Nov 2013 18:36:48 +0000 (18:36 +0000)
committerUlrich Weigand <uweigand@gcc.gnu.org>
Thu, 14 Nov 2013 18:36:48 +0000 (18:36 +0000)
2013-11-14  Ulrich Weigand  <Ulrich.Weigand@de.ibm.com>

* config/rs6000/rs6000.c (rs6000_option_override_internal): Replace
"DEFAULT_ABI != ABI_AIX" test by testing for ABI_V4 or ABI_DARWIN.
(rs6000_savres_strategy): Likewise.
(rs6000_return_addr): Likewise.
(rs6000_emit_load_toc_table): Replace "DEFAULT_ABI != ABI_AIX" by
testing for ABI_V4 (since ABI_DARWIN is impossible here).
(rs6000_emit_prologue): Likewise.
(legitimate_lo_sum_address_p): Simplify DEFAULT_ABI test.
(rs6000_elf_declare_function_name): Remove duplicated test.
* config/rs6000/rs6000.md ("load_toc_v4_PIC_1"): Explicitly test
for ABI_V4 (instead of "DEFAULT_ABI != ABI_AIX" test).
("load_toc_v4_PIC_1_normal"): Likewise.
("load_toc_v4_PIC_1_476"): Likewise.
("load_toc_v4_PIC_1b"): Likewise.
("load_toc_v4_PIC_1b_normal"): Likewise.
("load_toc_v4_PIC_1b_476"): Likewise.
("load_toc_v4_PIC_2"): Likewise.
("load_toc_v4_PIC_3b"): Likewise.
("load_toc_v4_PIC_3c"): Likewise.
* config/rs6000/rs6000.h (RS6000_REG_SAVE): Simplify DEFAULT_ABI test.
(RS6000_SAVE_AREA): Likewise.
(FP_ARG_MAX_REG): Likewise.
(RETURN_ADDRESS_OFFSET): Likewise.
* config/rs6000/sysv.h (TARGET_TOC): Test for ABI_V4 instead
of ABI_AIX.
(SUBTARGET_OVERRIDE_OPTIONS): Likewise.
(MINIMAL_TOC_SECTION_ASM_OP): Likewise.

From-SVN: r204804

gcc/ChangeLog
gcc/config/rs6000/rs6000.c
gcc/config/rs6000/rs6000.h
gcc/config/rs6000/rs6000.md
gcc/config/rs6000/sysv4.h

index e27898dfa3f877ebd4021633da41baba92aeb2b8..db09713c8c9c3f13dba0f30740ce5603b26cb8a1 100644 (file)
@@ -1,3 +1,33 @@
+2013-11-14  Ulrich Weigand  <Ulrich.Weigand@de.ibm.com>
+
+       * config/rs6000/rs6000.c (rs6000_option_override_internal): Replace
+       "DEFAULT_ABI != ABI_AIX" test by testing for ABI_V4 or ABI_DARWIN.
+       (rs6000_savres_strategy): Likewise.
+       (rs6000_return_addr): Likewise.
+       (rs6000_emit_load_toc_table): Replace "DEFAULT_ABI != ABI_AIX" by
+       testing for ABI_V4 (since ABI_DARWIN is impossible here).
+       (rs6000_emit_prologue): Likewise.
+       (legitimate_lo_sum_address_p): Simplify DEFAULT_ABI test.
+       (rs6000_elf_declare_function_name): Remove duplicated test.
+       * config/rs6000/rs6000.md ("load_toc_v4_PIC_1"): Explicitly test
+       for ABI_V4 (instead of "DEFAULT_ABI != ABI_AIX" test).
+       ("load_toc_v4_PIC_1_normal"): Likewise.
+       ("load_toc_v4_PIC_1_476"): Likewise.
+       ("load_toc_v4_PIC_1b"): Likewise.
+       ("load_toc_v4_PIC_1b_normal"): Likewise.
+       ("load_toc_v4_PIC_1b_476"): Likewise.
+       ("load_toc_v4_PIC_2"): Likewise.
+       ("load_toc_v4_PIC_3b"): Likewise.
+       ("load_toc_v4_PIC_3c"): Likewise.
+       * config/rs6000/rs6000.h (RS6000_REG_SAVE): Simplify DEFAULT_ABI test.
+       (RS6000_SAVE_AREA): Likewise.
+       (FP_ARG_MAX_REG): Likewise.
+       (RETURN_ADDRESS_OFFSET): Likewise.
+       * config/rs6000/sysv.h (TARGET_TOC): Test for ABI_V4 instead
+       of ABI_AIX.
+       (SUBTARGET_OVERRIDE_OPTIONS): Likewise.
+       (MINIMAL_TOC_SECTION_ASM_OP): Likewise.
+
 2013-11-14  Ulrich Weigand  <Ulrich.Weigand@de.ibm.com>
 
        * config/rs6000/rs6000.c (rs6000_call_indirect_aix): Rename to ...
index e3ca62e7521261165126da8716c6aa2f1b852415..b959931844f1a39a17123685598414a1e8dcdd01 100644 (file)
@@ -3674,7 +3674,7 @@ rs6000_option_override_internal (bool global_init_p)
 
       /* We should always be splitting complex arguments, but we can't break
         Linux and Darwin ABIs at the moment.  For now, only AIX is fixed.  */
-      if (DEFAULT_ABI != ABI_AIX)
+      if (DEFAULT_ABI == ABI_V4 || DEFAULT_ABI == ABI_DARWIN)
        targetm.calls.split_complex_arg = NULL;
     }
 
@@ -6389,7 +6389,7 @@ legitimate_lo_sum_address_p (enum machine_mode mode, rtx x, int strict)
     {
       bool large_toc_ok;
 
-      if (DEFAULT_ABI != ABI_AIX && DEFAULT_ABI != ABI_DARWIN && flag_pic)
+      if (DEFAULT_ABI == ABI_V4 && flag_pic)
        return false;
       /* LRA don't use LEGITIMIZE_RELOAD_ADDRESS as it usually calls
         push_reload from reload pass code.  LEGITIMIZE_RELOAD_ADDRESS
@@ -19610,7 +19610,8 @@ rs6000_savres_strategy (rs6000_stack_t *info,
      by the static chain.  It would require too much fiddling and the
      static chain is rarely used anyway.  FPRs are saved w.r.t the stack
      pointer on Darwin, and AIX uses r1 or r12.  */
-  if (using_static_chain_p && DEFAULT_ABI != ABI_AIX)
+  if (using_static_chain_p
+      && (DEFAULT_ABI == ABI_V4 || DEFAULT_ABI == ABI_DARWIN))
     strategy |= ((DEFAULT_ABI == ABI_DARWIN ? 0 : SAVE_INLINE_FPRS)
                 | SAVE_INLINE_GPRS
                 | SAVE_INLINE_VRS | REST_INLINE_VRS);
@@ -20306,7 +20307,8 @@ rs6000_return_addr (int count, rtx frame)
   /* Currently we don't optimize very well between prolog and body
      code and for PIC code the code can be actually quite bad, so
      don't try to be too clever here.  */
-  if (count != 0 || (DEFAULT_ABI != ABI_AIX && flag_pic))
+  if (count != 0
+      || ((DEFAULT_ABI == ABI_V4 || DEFAULT_ABI == ABI_DARWIN) && flag_pic))
     {
       cfun->machine->ra_needs_full_frame = 1;
 
@@ -20454,7 +20456,7 @@ rs6000_emit_load_toc_table (int fromprolog)
   rtx dest;
   dest = gen_rtx_REG (Pmode, RS6000_PIC_OFFSET_TABLE_REGNUM);
 
-  if (TARGET_ELF && TARGET_SECURE_PLT && DEFAULT_ABI != ABI_AIX && flag_pic)
+  if (TARGET_ELF && TARGET_SECURE_PLT && DEFAULT_ABI == ABI_V4 && flag_pic)
     {
       char buf[30];
       rtx lab, tmp1, tmp2, got;
@@ -20482,7 +20484,7 @@ rs6000_emit_load_toc_table (int fromprolog)
       emit_insn (gen_load_toc_v4_pic_si ());
       emit_move_insn (dest, gen_rtx_REG (Pmode, LR_REGNO));
     }
-  else if (TARGET_ELF && DEFAULT_ABI != ABI_AIX && flag_pic == 2)
+  else if (TARGET_ELF && DEFAULT_ABI == ABI_V4 && flag_pic == 2)
     {
       char buf[30];
       rtx temp0 = (fromprolog
@@ -22312,7 +22314,7 @@ rs6000_emit_prologue (void)
         can use register 0.  This allows us to use a plain 'blr' to return
         from the procedure more often.  */
       int save_LR_around_toc_setup = (TARGET_ELF
-                                     && DEFAULT_ABI != ABI_AIX
+                                     && DEFAULT_ABI == ABI_V4
                                      && flag_pic
                                      && ! info->lr_save_p
                                      && EDGE_COUNT (EXIT_BLOCK_PTR->preds) > 0);
@@ -27620,8 +27622,7 @@ rs6000_elf_declare_function_name (FILE *file, const char *name, tree decl)
       fprintf (file, "%s:\n", desc_name);
       fprintf (file, "\t.long %s\n", orig_name);
       fputs ("\t.long _GLOBAL_OFFSET_TABLE_\n", file);
-      if (DEFAULT_ABI == ABI_AIX)
-       fputs ("\t.long 0\n", file);
+      fputs ("\t.long 0\n", file);
       fprintf (file, "\t.previous\n");
     }
   ASM_OUTPUT_LABEL (file, name);
index f13951eb23555305b8a069cced1c08b1ffe003a3..6dd0bcbf4c6bffbddeea7a76400049ccfc762610 100644 (file)
@@ -1528,15 +1528,12 @@ extern enum reg_class rs6000_constraints[RS6000_CONSTRAINT_MAX];
                              || (flag_sanitize & SANITIZE_ADDRESS) != 0)
 
 /* Size of the outgoing register save area */
-#define RS6000_REG_SAVE ((DEFAULT_ABI == ABI_AIX                       \
-                         || DEFAULT_ABI == ABI_DARWIN)                 \
-                        ? (TARGET_64BIT ? 64 : 32)                     \
-                        : 0)
+#define RS6000_REG_SAVE \
+  ((DEFAULT_ABI == ABI_V4 ? 0 : 32) << (TARGET_64BIT ? 1 : 0))
 
 /* Size of the fixed area on the stack */
 #define RS6000_SAVE_AREA \
-  (((DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_DARWIN) ? 24 : 8)    \
-   << (TARGET_64BIT ? 1 : 0))
+  ((DEFAULT_ABI == ABI_V4 ? 8 : 24) << (TARGET_64BIT ? 1 : 0))
 
 /* MEM representing address to save the TOC register */
 #define RS6000_SAVE_TOC gen_rtx_MEM (Pmode, \
@@ -1635,9 +1632,8 @@ extern enum reg_class rs6000_constraints[RS6000_CONSTRAINT_MAX];
 #define FP_ARG_MIN_REG 33
 #define        FP_ARG_AIX_MAX_REG 45
 #define        FP_ARG_V4_MAX_REG  40
-#define        FP_ARG_MAX_REG ((DEFAULT_ABI == ABI_AIX                         \
-                        || DEFAULT_ABI == ABI_DARWIN)                  \
-                       ? FP_ARG_AIX_MAX_REG : FP_ARG_V4_MAX_REG)
+#define        FP_ARG_MAX_REG (DEFAULT_ABI == ABI_V4                           \
+                       ? FP_ARG_V4_MAX_REG : FP_ARG_AIX_MAX_REG)
 #define FP_ARG_NUM_REG (FP_ARG_MAX_REG - FP_ARG_MIN_REG + 1)
 
 /* Minimum and maximum AltiVec registers used to hold arguments.  */
@@ -1793,11 +1789,8 @@ typedef struct rs6000_args
 /* Number of bytes into the frame return addresses can be found.  See
    rs6000_stack_info in rs6000.c for more information on how the different
    abi's store the return address.  */
-#define RETURN_ADDRESS_OFFSET                                          \
- ((DEFAULT_ABI == ABI_AIX                                              \
-   || DEFAULT_ABI == ABI_DARWIN)       ? (TARGET_32BIT ? 8 : 16) :     \
-  (DEFAULT_ABI == ABI_V4)              ? 4 :                           \
-  (internal_error ("RETURN_ADDRESS_OFFSET not supported"), 0))
+#define RETURN_ADDRESS_OFFSET \
+  ((DEFAULT_ABI == ABI_V4 ? 4 : 8) << (TARGET_64BIT ? 1 : 0))
 
 /* The current return address is in link register (65).  The return address
    of anything farther back is accessed normally at an offset of 8 from the
index b3311e6ea74c6277b6e563efc1e4e62f13d861a8..7a2fcfd5b2dfc739ac72bfb64526009029760e17 100644 (file)
   [(parallel [(set (reg:SI LR_REGNO)
                   (match_operand:SI 0 "immediate_operand" "s"))
              (use (unspec [(match_dup 0)] UNSPEC_TOC))])]
-  "TARGET_ELF && DEFAULT_ABI != ABI_AIX
+  "TARGET_ELF && DEFAULT_ABI == ABI_V4
    && (flag_pic == 2 || (flag_pic && TARGET_SECURE_PLT))"
   "")
 
   [(set (reg:SI LR_REGNO)
        (match_operand:SI 0 "immediate_operand" "s"))
    (use (unspec [(match_dup 0)] UNSPEC_TOC))]
-  "!TARGET_LINK_STACK && TARGET_ELF && DEFAULT_ABI != ABI_AIX
+  "!TARGET_LINK_STACK && TARGET_ELF && DEFAULT_ABI == ABI_V4
    && (flag_pic == 2 || (flag_pic && TARGET_SECURE_PLT))"
   "bcl 20,31,%0\\n%0:"
   [(set_attr "type" "branch")
   [(set (reg:SI LR_REGNO)
        (match_operand:SI 0 "immediate_operand" "s"))
    (use (unspec [(match_dup 0)] UNSPEC_TOC))]
-  "TARGET_LINK_STACK && TARGET_ELF && DEFAULT_ABI != ABI_AIX
+  "TARGET_LINK_STACK && TARGET_ELF && DEFAULT_ABI == ABI_V4
    && (flag_pic == 2 || (flag_pic && TARGET_SECURE_PLT))"
   "*
 {
                               (label_ref (match_operand 1 "" ""))]
                           UNSPEC_TOCPTR))
              (match_dup 1)])]
-  "TARGET_ELF && DEFAULT_ABI != ABI_AIX && flag_pic == 2"
+  "TARGET_ELF && DEFAULT_ABI == ABI_V4 && flag_pic == 2"
   "")
 
 (define_insn "load_toc_v4_PIC_1b_normal"
                    (label_ref (match_operand 1 "" ""))]
                UNSPEC_TOCPTR))
    (match_dup 1)]
-  "!TARGET_LINK_STACK && TARGET_ELF && DEFAULT_ABI != ABI_AIX && flag_pic == 2"
+  "!TARGET_LINK_STACK && TARGET_ELF && DEFAULT_ABI == ABI_V4 && flag_pic == 2"
   "bcl 20,31,$+8\;.long %0-$"
   [(set_attr "type" "branch")
    (set_attr "length" "8")])
                    (label_ref (match_operand 1 "" ""))]
                UNSPEC_TOCPTR))
    (match_dup 1)]
-  "TARGET_LINK_STACK && TARGET_ELF && DEFAULT_ABI != ABI_AIX && flag_pic == 2"
+  "TARGET_LINK_STACK && TARGET_ELF && DEFAULT_ABI == ABI_V4 && flag_pic == 2"
   "*
 {
   char name[32];
        (mem:SI (plus:SI (match_operand:SI 1 "gpc_reg_operand" "b")
                   (minus:SI (match_operand:SI 2 "immediate_operand" "s")
                             (match_operand:SI 3 "immediate_operand" "s")))))]
-  "TARGET_ELF && DEFAULT_ABI != ABI_AIX && flag_pic == 2"
+  "TARGET_ELF && DEFAULT_ABI == ABI_V4 && flag_pic == 2"
   "lwz %0,%2-%3(%1)"
   [(set_attr "type" "load")])
 
                 (high:SI
                   (minus:SI (match_operand:SI 2 "symbol_ref_operand" "s")
                             (match_operand:SI 3 "symbol_ref_operand" "s")))))]
-  "TARGET_ELF && TARGET_SECURE_PLT && DEFAULT_ABI != ABI_AIX && flag_pic"
+  "TARGET_ELF && TARGET_SECURE_PLT && DEFAULT_ABI == ABI_V4 && flag_pic"
   "addis %0,%1,%2-%3@ha")
 
 (define_insn "load_toc_v4_PIC_3c"
        (lo_sum:SI (match_operand:SI 1 "gpc_reg_operand" "b")
                   (minus:SI (match_operand:SI 2 "symbol_ref_operand" "s")
                             (match_operand:SI 3 "symbol_ref_operand" "s"))))]
-  "TARGET_ELF && TARGET_SECURE_PLT && DEFAULT_ABI != ABI_AIX && flag_pic"
+  "TARGET_ELF && TARGET_SECURE_PLT && DEFAULT_ABI == ABI_V4 && flag_pic"
   "addi %0,%1,%2-%3@l")
 
 ;; If the TOC is shared over a translation unit, as happens with all
index 0cc8ffb8cb37b140c1db6bb45ee9b67bd7b6625e..ba4ceb3ff2e1450bc3e4eb48185d371bb693298a 100644 (file)
@@ -45,7 +45,7 @@
                                      & (OPTION_MASK_RELOCATABLE        \
                                         | OPTION_MASK_MINIMAL_TOC))    \
                                     && flag_pic > 1)                   \
-                                || DEFAULT_ABI == ABI_AIX)
+                                || DEFAULT_ABI != ABI_V4)
 
 #define        TARGET_BITFIELD_TYPE    (! TARGET_NO_BITFIELD_TYPE)
 #define        TARGET_BIG_ENDIAN       (! TARGET_LITTLE_ENDIAN)
@@ -147,7 +147,7 @@ do {                                                                        \
             rs6000_sdata_name);                                        \
     }                                                                  \
                                                                        \
-  else if (flag_pic && DEFAULT_ABI != ABI_AIX                          \
+  else if (flag_pic && DEFAULT_ABI == ABI_V4                           \
           && (rs6000_sdata == SDATA_EABI                               \
               || rs6000_sdata == SDATA_SYSV))                          \
     {                                                                  \
@@ -173,14 +173,14 @@ do {                                                                      \
       error ("-mrelocatable and -mno-minimal-toc are incompatible");   \
     }                                                                  \
                                                                        \
-  if (TARGET_RELOCATABLE && rs6000_current_abi == ABI_AIX)             \
+  if (TARGET_RELOCATABLE && rs6000_current_abi != ABI_V4)              \
     {                                                                  \
       rs6000_isa_flags &= ~OPTION_MASK_RELOCATABLE;                    \
       error ("-mrelocatable and -mcall-%s are incompatible",           \
             rs6000_abi_name);                                          \
     }                                                                  \
                                                                        \
-  if (!TARGET_64BIT && flag_pic > 1 && rs6000_current_abi == ABI_AIX)  \
+  if (!TARGET_64BIT && flag_pic > 1 && rs6000_current_abi != ABI_V4)   \
     {                                                                  \
       flag_pic = 0;                                                    \
       error ("-fPIC and -mcall-%s are incompatible",                   \
@@ -193,7 +193,7 @@ do {                                                                        \
     }                                                                  \
                                                                        \
   /* Treat -fPIC the same as -mrelocatable.  */                                \
-  if (flag_pic > 1 && DEFAULT_ABI != ABI_AIX)                          \
+  if (flag_pic > 1 && DEFAULT_ABI == ABI_V4)                           \
     {                                                                  \
       rs6000_isa_flags |= OPTION_MASK_RELOCATABLE | OPTION_MASK_MINIMAL_TOC; \
       TARGET_NO_FP_IN_TOC = 1;                                         \
@@ -317,7 +317,7 @@ do {                                                                        \
 
 /* Put PC relative got entries in .got2.  */
 #define        MINIMAL_TOC_SECTION_ASM_OP \
-  (TARGET_RELOCATABLE || (flag_pic && DEFAULT_ABI != ABI_AIX)          \
+  (TARGET_RELOCATABLE || (flag_pic && DEFAULT_ABI == ABI_V4)           \
    ? "\t.section\t\".got2\",\"aw\"" : "\t.section\t\".got1\",\"aw\"")
 
 #define        SDATA_SECTION_ASM_OP "\t.section\t\".sdata\",\"aw\""