summaryrefslogtreecommitdiff
path: root/gcc/config/sparc
diff options
context:
space:
mode:
authorbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2012-05-11 11:19:01 +0000
committerbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2012-05-11 11:19:01 +0000
commit10c7be7ea6e54fc16864f455ffd8e57404b1a467 (patch)
treeee70b35cdded91a6e9f721e4c5cbaedad09528ad /gcc/config/sparc
parentd59974987297588b3031ef2f2ae409c5bd858bd0 (diff)
downloadgcc-10c7be7ea6e54fc16864f455ffd8e57404b1a467.tar.gz
2012-05-11 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk rev 187397 using svnmerge gimple_seq are disappearing! [gcc/] 2012-05-11 Basile Starynkevitch <basile@starynkevitch.net> {{for merge with trunk svn 187397, since gimple_seq are disappearing in GCC 4.8}} * melt-runtime.h (melt_gt_ggc_mx_gimple_seq_d): New declaration (gt_ggc_mx_gimple_seq_d): Macro defined when GCC 4.8 only. * melt-runtime.c (melt_gt_ggc_mx_gimple_seq_d): New function, defined for GCC 4.8 only. * melt/warmelt-debug.melt (melt_debug_fun): Add cast in our warning diagnostic to avoid a warning. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@187401 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/sparc')
-rw-r--r--gcc/config/sparc/linux.h2
-rw-r--r--gcc/config/sparc/linux64.h4
-rw-r--r--gcc/config/sparc/sparc.c60
-rw-r--r--gcc/config/sparc/sparc.h9
-rw-r--r--gcc/config/sparc/sparc.md2
5 files changed, 49 insertions, 28 deletions
diff --git a/gcc/config/sparc/linux.h b/gcc/config/sparc/linux.h
index 60dc86976e3..ac6c537ed41 100644
--- a/gcc/config/sparc/linux.h
+++ b/gcc/config/sparc/linux.h
@@ -87,7 +87,7 @@ extern const char *host_detect_local_cpu (int argc, const char **argv);
#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
#undef LINK_SPEC
-#define LINK_SPEC "-m elf32_sparc -Y P,/usr/lib %{shared:-shared} \
+#define LINK_SPEC "-m elf32_sparc %{shared:-shared} \
%{!mno-relax:%{!r:-relax}} \
%{!shared: \
%{!static: \
diff --git a/gcc/config/sparc/linux64.h b/gcc/config/sparc/linux64.h
index 14966b97fc3..f932e98a342 100644
--- a/gcc/config/sparc/linux64.h
+++ b/gcc/config/sparc/linux64.h
@@ -105,7 +105,7 @@ along with GCC; see the file COPYING3. If not see
{ "link_arch_default", LINK_ARCH_DEFAULT_SPEC }, \
{ "link_arch", LINK_ARCH_SPEC },
-#define LINK_ARCH32_SPEC "-m elf32_sparc -Y P,%R/usr/lib %{shared:-shared} \
+#define LINK_ARCH32_SPEC "-m elf32_sparc %{shared:-shared} \
%{!shared: \
%{!static: \
%{rdynamic:-export-dynamic} \
@@ -113,7 +113,7 @@ along with GCC; see the file COPYING3. If not see
%{static:-static}} \
"
-#define LINK_ARCH64_SPEC "-m elf64_sparc -Y P,%R/usr/lib64 %{shared:-shared} \
+#define LINK_ARCH64_SPEC "-m elf64_sparc %{shared:-shared} \
%{!shared: \
%{!static: \
%{rdynamic:-export-dynamic} \
diff --git a/gcc/config/sparc/sparc.c b/gcc/config/sparc/sparc.c
index 11bd1fe90ff..4cb381e60e9 100644
--- a/gcc/config/sparc/sparc.c
+++ b/gcc/config/sparc/sparc.c
@@ -1,7 +1,7 @@
/* Subroutines for insn-output.c for SPARC.
Copyright (C) 1987, 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
- 2011
+ 2011, 2012
Free Software Foundation, Inc.
Contributed by Michael Tiemann (tiemann@cygnus.com)
64-bit SPARC-V9 support by Michael Tiemann, Jim Wilson, and Doug Evans,
@@ -2724,7 +2724,12 @@ emit_soft_tfmode_libcall (const char *func_name, int nargs, rtx *operands)
if (GET_CODE (this_arg) == MEM
&& ! force_stack_temp)
- this_arg = XEXP (this_arg, 0);
+ {
+ tree expr = MEM_EXPR (this_arg);
+ if (expr)
+ mark_addressable (expr);
+ this_arg = XEXP (this_arg, 0);
+ }
else if (CONSTANT_P (this_arg)
&& ! force_stack_temp)
{
@@ -3861,7 +3866,7 @@ sparc_legitimize_pic_address (rtx orig, rtx reg)
if (GET_CODE (offset) == CONST_INT)
{
if (SMALL_INT (offset))
- return plus_constant (base, INTVAL (offset));
+ return plus_constant (Pmode, base, INTVAL (offset));
else if (can_create_pseudo_p ())
offset = force_reg (Pmode, offset);
else
@@ -4600,7 +4605,7 @@ sparc_emit_probe_stack_range (HOST_WIDE_INT first, HOST_WIDE_INT size)
emit_move_insn (g1, GEN_INT (first));
emit_insn (gen_rtx_SET (VOIDmode, g1,
gen_rtx_MINUS (Pmode, stack_pointer_rtx, g1)));
- emit_stack_probe (plus_constant (g1, -size));
+ emit_stack_probe (plus_constant (Pmode, g1, -size));
}
/* The run-time loop is made up of 10 insns in the generic case while the
@@ -4620,11 +4625,12 @@ sparc_emit_probe_stack_range (HOST_WIDE_INT first, HOST_WIDE_INT size)
for (i = 2 * PROBE_INTERVAL; i < size; i += PROBE_INTERVAL)
{
emit_insn (gen_rtx_SET (VOIDmode, g1,
- plus_constant (g1, -PROBE_INTERVAL)));
+ plus_constant (Pmode, g1, -PROBE_INTERVAL)));
emit_stack_probe (g1);
}
- emit_stack_probe (plus_constant (g1, (i - PROBE_INTERVAL) - size));
+ emit_stack_probe (plus_constant (Pmode, g1,
+ (i - PROBE_INTERVAL) - size));
}
/* Otherwise, do the same as above, but in a loop. Note that we must be
@@ -4677,7 +4683,7 @@ sparc_emit_probe_stack_range (HOST_WIDE_INT first, HOST_WIDE_INT size)
that SIZE is equal to ROUNDED_SIZE. */
if (size != rounded_size)
- emit_stack_probe (plus_constant (g4, rounded_size - size));
+ emit_stack_probe (plus_constant (Pmode, g4, rounded_size - size));
}
/* Make sure nothing is scheduled before we are done. */
@@ -4754,7 +4760,8 @@ emit_save_or_restore_regs (unsigned int low, unsigned int high, rtx base,
{
if (save_p (i, leaf_function))
{
- mem = gen_frame_mem (DImode, plus_constant (base, offset));
+ mem = gen_frame_mem (DImode, plus_constant (Pmode,
+ base, offset));
if (action_true == SORR_SAVE)
{
insn = emit_move_insn (mem, gen_rtx_REG (DImode, i));
@@ -4779,7 +4786,7 @@ emit_save_or_restore_regs (unsigned int low, unsigned int high, rtx base,
if (fp_offset >= 0)
{
- mem = gen_frame_mem (DImode, plus_constant (base, fp_offset));
+ mem = gen_frame_mem (DImode, plus_constant (Pmode, base, fp_offset));
emit_move_insn (hard_frame_pointer_rtx, mem);
}
}
@@ -4815,7 +4822,7 @@ emit_save_or_restore_regs (unsigned int low, unsigned int high, rtx base,
continue;
}
- mem = gen_frame_mem (mode, plus_constant (base, offset));
+ mem = gen_frame_mem (mode, plus_constant (Pmode, base, offset));
if (action_true == SORR_SAVE)
{
insn = emit_move_insn (mem, gen_rtx_REG (mode, regno));
@@ -4823,12 +4830,14 @@ emit_save_or_restore_regs (unsigned int low, unsigned int high, rtx base,
if (mode == DImode)
{
rtx set1, set2;
- mem = gen_frame_mem (SImode, plus_constant (base, offset));
+ mem = gen_frame_mem (SImode, plus_constant (Pmode, base,
+ offset));
set1 = gen_rtx_SET (VOIDmode, mem,
gen_rtx_REG (SImode, regno));
RTX_FRAME_RELATED_P (set1) = 1;
mem
- = gen_frame_mem (SImode, plus_constant (base, offset + 4));
+ = gen_frame_mem (SImode, plus_constant (Pmode, base,
+ offset + 4));
set2 = gen_rtx_SET (VOIDmode, mem,
gen_rtx_REG (SImode, regno + 1));
RTX_FRAME_RELATED_P (set2) = 1;
@@ -4918,7 +4927,7 @@ emit_window_save (rtx increment)
/* The CFA is %fp, the hard frame pointer. */
add_reg_note (insn, REG_CFA_DEF_CFA,
- plus_constant (hard_frame_pointer_rtx,
+ plus_constant (Pmode, hard_frame_pointer_rtx,
INCOMING_FRAME_SP_OFFSET));
return insn;
@@ -5140,7 +5149,7 @@ sparc_flat_expand_prologue (void)
add_reg_note (insn, REG_CFA_ADJUST_CFA,
gen_rtx_SET (VOIDmode, hard_frame_pointer_rtx,
- plus_constant (stack_pointer_rtx,
+ plus_constant (Pmode, stack_pointer_rtx,
size)));
}
@@ -6731,10 +6740,10 @@ sparc_struct_value_rtx (tree fndecl, int incoming)
rtx mem;
if (incoming)
- mem = gen_frame_mem (Pmode, plus_constant (frame_pointer_rtx,
+ mem = gen_frame_mem (Pmode, plus_constant (Pmode, frame_pointer_rtx,
STRUCT_VALUE_OFFSET));
else
- mem = gen_frame_mem (Pmode, plus_constant (stack_pointer_rtx,
+ mem = gen_frame_mem (Pmode, plus_constant (Pmode, stack_pointer_rtx,
STRUCT_VALUE_OFFSET));
/* Only follow the SPARC ABI for fixed-size structure returns.
@@ -6765,7 +6774,8 @@ sparc_struct_value_rtx (tree fndecl, int incoming)
it's an unimp instruction (the most significant 10 bits
will be zero). */
emit_move_insn (scratch, gen_rtx_MEM (SImode,
- plus_constant (ret_reg, 8)));
+ plus_constant (Pmode,
+ ret_reg, 8)));
/* Assume the size is valid and pre-adjust */
emit_insn (gen_add3_insn (ret_reg, ret_reg, GEN_INT (4)));
emit_cmp_and_jump_insns (scratch, size_rtx, EQ, const0_rtx, SImode,
@@ -7413,7 +7423,12 @@ sparc_emit_float_lib_cmp (rtx x, rtx y, enum rtx_code comparison)
if (TARGET_ARCH64)
{
if (MEM_P (x))
- slot0 = x;
+ {
+ tree expr = MEM_EXPR (x);
+ if (expr)
+ mark_addressable (expr);
+ slot0 = x;
+ }
else
{
slot0 = assign_stack_temp (TFmode, GET_MODE_SIZE(TFmode), 0);
@@ -7421,7 +7436,12 @@ sparc_emit_float_lib_cmp (rtx x, rtx y, enum rtx_code comparison)
}
if (MEM_P (y))
- slot1 = y;
+ {
+ tree expr = MEM_EXPR (y);
+ if (expr)
+ mark_addressable (expr);
+ slot1 = y;
+ }
else
{
slot1 = assign_stack_temp (TFmode, GET_MODE_SIZE(TFmode), 0);
@@ -10405,7 +10425,7 @@ emit_and_preserve (rtx seq, rtx reg, rtx reg2)
HOST_WIDE_INT size = SPARC_STACK_ALIGN (offset + 2*UNITS_PER_WORD);
rtx slot
- = gen_rtx_MEM (word_mode, plus_constant (stack_pointer_rtx,
+ = gen_rtx_MEM (word_mode, plus_constant (Pmode, stack_pointer_rtx,
SPARC_STACK_BIAS + offset));
emit_insn (gen_stack_pointer_dec (GEN_INT (size)));
diff --git a/gcc/config/sparc/sparc.h b/gcc/config/sparc/sparc.h
index a1919b4e7e7..a2bf09f1c81 100644
--- a/gcc/config/sparc/sparc.h
+++ b/gcc/config/sparc/sparc.h
@@ -1273,11 +1273,11 @@ do { \
return an rtx for the address of the word in the frame
that holds the dynamic chain--the previous frame's address. */
#define DYNAMIC_CHAIN_ADDRESS(frame) \
- plus_constant (frame, 14 * UNITS_PER_WORD + SPARC_STACK_BIAS)
+ plus_constant (Pmode, frame, 14 * UNITS_PER_WORD + SPARC_STACK_BIAS)
/* Given an rtx for the frame pointer,
return an rtx for the address of the frame. */
-#define FRAME_ADDR_RTX(frame) plus_constant (frame, SPARC_STACK_BIAS)
+#define FRAME_ADDR_RTX(frame) plus_constant (Pmode, frame, SPARC_STACK_BIAS)
/* The return address isn't on the stack, it is in a register, so we can't
access it from the current frame pointer. We can access it from the
@@ -1299,7 +1299,7 @@ do { \
((count == -1) \
? gen_rtx_REG (Pmode, RETURN_ADDR_REGNUM) \
: gen_rtx_MEM (Pmode, \
- memory_address (Pmode, plus_constant (frame, \
+ memory_address (Pmode, plus_constant (Pmode, frame, \
15 * UNITS_PER_WORD \
+ SPARC_STACK_BIAS))))
@@ -1309,7 +1309,8 @@ do { \
is something you can return to. */
#define INCOMING_RETURN_ADDR_REGNUM 15
#define INCOMING_RETURN_ADDR_RTX \
- plus_constant (gen_rtx_REG (word_mode, INCOMING_RETURN_ADDR_REGNUM), 8)
+ plus_constant (word_mode, \
+ gen_rtx_REG (word_mode, INCOMING_RETURN_ADDR_REGNUM), 8)
#define DWARF_FRAME_RETURN_COLUMN \
DWARF_FRAME_REGNUM (INCOMING_RETURN_ADDR_REGNUM)
diff --git a/gcc/config/sparc/sparc.md b/gcc/config/sparc/sparc.md
index 4c7a2b0b232..aafff5598d1 100644
--- a/gcc/config/sparc/sparc.md
+++ b/gcc/config/sparc/sparc.md
@@ -6436,7 +6436,7 @@
instruction (the most significant 10 bits will be zero). If so,
update the return address to skip the unimp instruction. */
emit_move_insn (value,
- gen_rtx_MEM (SImode, plus_constant (rtnreg, 8)));
+ gen_rtx_MEM (SImode, plus_constant (SImode, rtnreg, 8)));
emit_insn (gen_lshrsi3 (value, value, GEN_INT (22)));
emit_insn (gen_update_return (rtnreg, value));
}