Commit 7310a2da by Stefan Schulze Frielinghaus Committed by Ulrich Weigand

configure.ac [spu-*-*]: Do not set skipdirs.

ChangeLog:

2008-10-29  Stefan Schulze Frielinghaus  <xxschulz@de.ibm.com>

	* configure.ac [spu-*-*]: Do not set skipdirs.
	* configure: Re-generate.

gcc/ChangeLog:

2008-10-29  Stefan Schulze Frielinghaus  <xxschulz@de.ibm.com>

	* config/spu/spu.h (FRAME_GROWS_DOWNWARD): Define.
	(INITIAL_FRAME_POINTER_OFFSET): Remove.
	* config/spu/spu.c (spu_initial_elimination_offset): Calculate new
	offset if eliminating soft frame pointer.
	* config/spu/spu.md (stack_protect_set, stack_protect_test)
	(stack_protect_test_si): Add initial machine description
	for Stack Smashing Protector

From-SVN: r141437
parent cdd6a337
2008-10-29 Stefan Schulze Frielinghaus <xxschulz@de.ibm.com>
* configure.ac [spu-*-*]: Do not set skipdirs.
* configure: Re-generate.
2008-10-29 Bernd Schmidt <bernd.schmidt@analog.com> 2008-10-29 Bernd Schmidt <bernd.schmidt@analog.com>
* MAINTAINERS (Various Maintainers): Add myself to reload. * MAINTAINERS (Various Maintainers): Add myself to reload.
......
...@@ -2656,7 +2656,6 @@ case "${target}" in ...@@ -2656,7 +2656,6 @@ case "${target}" in
sparc-*-solaris* | sparc64-*-solaris* | sparcv9-*-solaris*) sparc-*-solaris* | sparc64-*-solaris* | sparcv9-*-solaris*)
;; ;;
spu-*-*) spu-*-*)
skipdirs="target-libssp"
;; ;;
v810-*-*) v810-*-*)
noconfigdirs="$noconfigdirs bfd binutils gas gcc gdb ld target-libstdc++-v3 opcodes target-libgloss ${libgcj}" noconfigdirs="$noconfigdirs bfd binutils gas gcc gdb ld target-libstdc++-v3 opcodes target-libgloss ${libgcj}"
......
...@@ -892,7 +892,6 @@ case "${target}" in ...@@ -892,7 +892,6 @@ case "${target}" in
sparc-*-solaris* | sparc64-*-solaris* | sparcv9-*-solaris*) sparc-*-solaris* | sparc64-*-solaris* | sparcv9-*-solaris*)
;; ;;
spu-*-*) spu-*-*)
skipdirs="target-libssp"
;; ;;
v810-*-*) v810-*-*)
noconfigdirs="$noconfigdirs bfd binutils gas gcc gdb ld target-libstdc++-v3 opcodes target-libgloss ${libgcj}" noconfigdirs="$noconfigdirs bfd binutils gas gcc gdb ld target-libstdc++-v3 opcodes target-libgloss ${libgcj}"
......
2008-10-29 Stefan Schulze Frielinghaus <xxschulz@de.ibm.com>
* config/spu/spu.h (FRAME_GROWS_DOWNWARD): Define.
(INITIAL_FRAME_POINTER_OFFSET): Remove.
* config/spu/spu.c (spu_initial_elimination_offset): Calculate new
offset if eliminating soft frame pointer.
* config/spu/spu.md (stack_protect_set, stack_protect_test)
(stack_protect_test_si): Add initial machine description
for Stack Smashing Protector
2008-10-29 Manuel Lopez-Ibanez <manu@gcc.gnu.org> 2008-10-29 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
PR 11492 PR 11492
......
...@@ -1759,8 +1759,8 @@ direct_return (void) ...@@ -1759,8 +1759,8 @@ direct_return (void)
The stack frame looks like this: The stack frame looks like this:
+-------------+ +-------------+
| incoming | | incoming |
AP | args | | args |
+-------------+ AP -> +-------------+
| $lr save | | $lr save |
+-------------+ +-------------+
prev SP | back chain | prev SP | back chain |
...@@ -1770,10 +1770,10 @@ direct_return (void) ...@@ -1770,10 +1770,10 @@ direct_return (void)
+-------------+ +-------------+
| ... | | ... |
| saved regs | spu_saved_regs_size() bytes | saved regs | spu_saved_regs_size() bytes
+-------------+ FP -> +-------------+
| ... | | ... |
FP | vars | get_frame_size() bytes | vars | get_frame_size() bytes
+-------------+ HFP -> +-------------+
| ... | | ... |
| outgoing | | outgoing |
| args | crtl->outgoing_args_size bytes | args | crtl->outgoing_args_size bytes
...@@ -1781,8 +1781,8 @@ direct_return (void) ...@@ -1781,8 +1781,8 @@ direct_return (void)
| $lr of next | | $lr of next |
| frame | | frame |
+-------------+ +-------------+
SP | back chain | | back chain |
+-------------+ SP -> +-------------+
*/ */
void void
...@@ -3671,15 +3671,16 @@ spu_initial_elimination_offset (int from, int to) ...@@ -3671,15 +3671,16 @@ spu_initial_elimination_offset (int from, int to)
|| get_frame_size () || saved_regs_size) || get_frame_size () || saved_regs_size)
sp_offset = STACK_POINTER_OFFSET; sp_offset = STACK_POINTER_OFFSET;
if (from == FRAME_POINTER_REGNUM && to == STACK_POINTER_REGNUM) if (from == FRAME_POINTER_REGNUM && to == STACK_POINTER_REGNUM)
return (sp_offset + crtl->outgoing_args_size); return get_frame_size () + crtl->outgoing_args_size + sp_offset;
else if (from == FRAME_POINTER_REGNUM && to == HARD_FRAME_POINTER_REGNUM) else if (from == FRAME_POINTER_REGNUM && to == HARD_FRAME_POINTER_REGNUM)
return 0; return get_frame_size ();
else if (from == ARG_POINTER_REGNUM && to == STACK_POINTER_REGNUM) else if (from == ARG_POINTER_REGNUM && to == STACK_POINTER_REGNUM)
return sp_offset + crtl->outgoing_args_size return sp_offset + crtl->outgoing_args_size
+ get_frame_size () + saved_regs_size + STACK_POINTER_OFFSET; + get_frame_size () + saved_regs_size + STACK_POINTER_OFFSET;
else if (from == ARG_POINTER_REGNUM && to == HARD_FRAME_POINTER_REGNUM) else if (from == ARG_POINTER_REGNUM && to == HARD_FRAME_POINTER_REGNUM)
return get_frame_size () + saved_regs_size + sp_offset; return get_frame_size () + saved_regs_size + sp_offset;
return 0; else
gcc_unreachable ();
} }
rtx rtx
......
...@@ -251,6 +251,8 @@ targetm.resolve_overloaded_builtin = spu_resolve_overloaded_builtin; \ ...@@ -251,6 +251,8 @@ targetm.resolve_overloaded_builtin = spu_resolve_overloaded_builtin; \
#define STACK_GROWS_DOWNWARD #define STACK_GROWS_DOWNWARD
#define FRAME_GROWS_DOWNWARD 1
#define STARTING_FRAME_OFFSET (0) #define STARTING_FRAME_OFFSET (0)
#define STACK_POINTER_OFFSET 32 #define STACK_POINTER_OFFSET 32
...@@ -312,8 +314,6 @@ targetm.resolve_overloaded_builtin = spu_resolve_overloaded_builtin; \ ...@@ -312,8 +314,6 @@ targetm.resolve_overloaded_builtin = spu_resolve_overloaded_builtin; \
#define FRAME_POINTER_REQUIRED 0 #define FRAME_POINTER_REQUIRED 0
#define INITIAL_FRAME_POINTER_OFFSET(DEPTH) ((DEPTH) = 0)
#define ELIMINABLE_REGS \ #define ELIMINABLE_REGS \
{{ARG_POINTER_REGNUM, STACK_POINTER_REGNUM}, \ {{ARG_POINTER_REGNUM, STACK_POINTER_REGNUM}, \
{ARG_POINTER_REGNUM, HARD_FRAME_POINTER_REGNUM}, \ {ARG_POINTER_REGNUM, HARD_FRAME_POINTER_REGNUM}, \
......
...@@ -155,6 +155,8 @@ ...@@ -155,6 +155,8 @@
(UNSPEC_DFTSV 51) (UNSPEC_DFTSV 51)
(UNSPEC_FLOAT_EXTEND 52) (UNSPEC_FLOAT_EXTEND 52)
(UNSPEC_FLOAT_TRUNCATE 53) (UNSPEC_FLOAT_TRUNCATE 53)
(UNSPEC_SP_SET 54)
(UNSPEC_SP_TEST 55)
]) ])
(include "predicates.md") (include "predicates.md")
...@@ -5188,4 +5190,51 @@ DONE; ...@@ -5188,4 +5190,51 @@ DONE;
DONE; DONE;
}") }")
(define_insn "stack_protect_set"
[(set (match_operand:SI 0 "spu_mem_operand" "=m")
(unspec:SI [(match_operand:SI 1 "spu_mem_operand" "m")] UNSPEC_SP_SET))
(set (match_scratch:SI 2 "=&r") (const_int 0))]
""
"lq%p1\t%2,%1\;stq%p0\t%2,%0\;xor\t%2,%2,%2"
[(set_attr "length" "12")
(set_attr "type" "multi1")]
)
(define_expand "stack_protect_test"
[(match_operand 0 "spu_mem_operand" "")
(match_operand 1 "spu_mem_operand" "")
(match_operand 2 "" "")]
""
{
rtx compare_result;
rtx bcomp, loc_ref;
compare_result = gen_reg_rtx (SImode);
emit_insn (gen_stack_protect_test_si (compare_result,
operands[0],
operands[1]));
bcomp = gen_rtx_NE (SImode, compare_result, const0_rtx);
loc_ref = gen_rtx_LABEL_REF (VOIDmode, operands[2]);
emit_jump_insn (gen_rtx_SET (VOIDmode, pc_rtx,
gen_rtx_IF_THEN_ELSE (VOIDmode, bcomp,
loc_ref, pc_rtx)));
DONE;
})
(define_insn "stack_protect_test_si"
[(set (match_operand:SI 0 "spu_reg_operand" "=&r")
(unspec:SI [(match_operand:SI 1 "spu_mem_operand" "m")
(match_operand:SI 2 "spu_mem_operand" "m")]
UNSPEC_SP_TEST))
(set (match_scratch:SI 3 "=&r") (const_int 0))]
""
"lq%p1\t%0,%1\;lq%p2\t%3,%2\;ceq\t%0,%0,%3\;xor\t%3,%3,%3"
[(set_attr "length" "16")
(set_attr "type" "multi1")]
)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment