aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorUlrich Weigand <Ulrich.Weigand@de.ibm.com>2013-11-14 18:36:48 +0000
committerUlrich Weigand <Ulrich.Weigand@de.ibm.com>2013-11-14 18:36:48 +0000
commit75d677e5a0395a411f524ed7a122dfabbe39fb58 (patch)
treea5d397d505018a6b01fe93efc51ee350fdfd61da /gcc
parentbd356a5343f02a2ad64c3939869198d40a6bd296 (diff)
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. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@204804 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog30
-rw-r--r--gcc/config/rs6000/rs6000.c19
-rw-r--r--gcc/config/rs6000/rs6000.h21
-rw-r--r--gcc/config/rs6000/rs6000.md18
-rw-r--r--gcc/config/rs6000/sysv4.h12
5 files changed, 62 insertions, 38 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index e27898dfa3f..db09713c8c9 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,35 @@
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 ...
(rs6000_call_aix): ... this. Handle both direct and indirect calls.
Create call insn directly instead of via various gen_... routines.
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index e3ca62e7521..b959931844f 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -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);
diff --git a/gcc/config/rs6000/rs6000.h b/gcc/config/rs6000/rs6000.h
index f13951eb235..6dd0bcbf4c6 100644
--- a/gcc/config/rs6000/rs6000.h
+++ b/gcc/config/rs6000/rs6000.h
@@ -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
diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md
index b3311e6ea74..7a2fcfd5b2d 100644
--- a/gcc/config/rs6000/rs6000.md
+++ b/gcc/config/rs6000/rs6000.md
@@ -11845,7 +11845,7 @@
[(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))"
"")
@@ -11853,7 +11853,7 @@
[(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")
@@ -11863,7 +11863,7 @@
[(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))"
"*
{
@@ -11883,7 +11883,7 @@
(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"
@@ -11892,7 +11892,7 @@
(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")])
@@ -11903,7 +11903,7 @@
(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];
@@ -11921,7 +11921,7 @@
(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")])
@@ -11931,7 +11931,7 @@
(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"
@@ -11939,7 +11939,7 @@
(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
diff --git a/gcc/config/rs6000/sysv4.h b/gcc/config/rs6000/sysv4.h
index 0cc8ffb8cb3..ba4ceb3ff2e 100644
--- a/gcc/config/rs6000/sysv4.h
+++ b/gcc/config/rs6000/sysv4.h
@@ -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\""