RFA: Allow RTX_FRAME_RELATED_P to accept SEQUENCEs
Nick Clifton
nickc@cambridge.redhat.com
Thu May 16 08:17:00 GMT 2002
Hi Guys,
The arm-elf port is currently failing to be because it attempts to
set RTX_FRAME_RELATED_P on a SEQUENCE and this is not allowed. The
insn is being generated in arm.c:emit_multi_reg_push() and there is
a comment there to explain why:
/* For the body of the insn we are going to generate an UNSPEC in
parallel with several USEs. This allows the insn to be recognised
by the push_multi pattern in the arm.md file. The insn looks
something like this:
(parallel [
(set (mem:BLK (pre_dec:BLK (reg:SI sp)))
(unspec:BLK [(reg:SI r4)] UNSPEC_PUSH_MULT))
(use (reg:SI 11 fp))
(use (reg:SI 12 ip))
(use (reg:SI 14 lr))
(use (reg:SI 15 pc))
])
For the frame note however, we try to be more explicit and actually
show each register being stored into the stack frame, plus a (single)
decrement of the stack pointer. We do it this way in order to be
friendly to the stack unwinding code, which only wants to see a single
stack decrement per instruction. The RTL we generate for the note looks
something like this:
(sequence [
(set (reg:SI sp) (plus:SI (reg:SI sp) (const_int -20)))
(set (mem:SI (reg:SI sp)) (reg:SI r4))
(set (mem:SI (plus:SI (reg:SI sp) (const_int 4))) (reg:SI fp))
(set (mem:SI (plus:SI (reg:SI sp) (const_int 8))) (reg:SI ip))
(set (mem:SI (plus:SI (reg:SI sp) (const_int 12))) (reg:SI lr))
])
This sequence is used both by the code to support stack unwinding for
exceptions handlers and the code to generate dwarf2 frame debugging. */
So - I would like permission to apply the following patch which
amends the definition of RTX_FRAME_RELATED_P to accept SEQUENCEs.
Cheers
Nick
2002-05-16 Nick Clifton <nickc@cambridge.redhat.com>
* rtl.h (RTX_FRAME_RELATED_P): Accept SEQUENCEs.
Index: gcc/rtl.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/rtl.h,v
retrieving revision 1.347
diff -c -3 -p -w -r1.347 rtl.h
*** gcc/rtl.h 13 May 2002 04:50:11 -0000 1.347
--- gcc/rtl.h 16 May 2002 14:54:59 -0000
*************** do { \
*** 520,527 ****
#define RTX_UNCHANGING_P(RTX) \
(RTL_FLAG_CHECK3("RTX_UNCHANGING_P", (RTX), REG, MEM, CONCAT)->unchanging)
#define RTX_FRAME_RELATED_P(RTX) \
! (RTL_FLAG_CHECK5("RTX_FRAME_RELATED_P", (RTX), INSN, CALL_INSN, \
! JUMP_INSN, BARRIER, SET)->frame_related)
/* 1 if RTX is an insn that has been deleted. */
#define INSN_DELETED_P(RTX) \
--- 520,527 ----
#define RTX_UNCHANGING_P(RTX) \
(RTL_FLAG_CHECK3("RTX_UNCHANGING_P", (RTX), REG, MEM, CONCAT)->unchanging)
#define RTX_FRAME_RELATED_P(RTX) \
! (RTL_FLAG_CHECK6("RTX_FRAME_RELATED_P", (RTX), INSN, CALL_INSN, \
! JUMP_INSN, BARRIER, SET, SEQUENCE)->frame_related)
/* 1 if RTX is an insn that has been deleted. */
#define INSN_DELETED_P(RTX) \
More information about the Gcc-patches
mailing list