Handling DWARF call frame labels in the middle of VLIW packets

Daniel Towner dant@picochip.com
Wed Mar 31 13:37:00 GMT 2004


Hi all,

I have written a port of gcc for a 16-bit embedded VLIW processor. I use 
the DFA scheduler to generate the VLIW packets. I have just started 
generating DWARF call frame information and have run into a problem 
whereby the call frame mechanism tries to output labels in the middle of 
VLIW packets. For example, given a VLIW packet containing the pseduo-code:

  FP := FP - 4  \
  R0 := R0 - 4

the DWARF call frame code detects that the first instruction is a stack 
adjustment, and emits a call frame label:

  FP := FP - 4  \
_LCFI3:
  R0 := R0 - 4

The assembler gets upset by the label appearing in the middle of the 
packet in this way. I can't change the assembler to accept a label in a 
VLIW packet, so the solution has to come from changing gcc. Two possible 
ways of fixing the problem are:

1) Change the VLIW scheduler pass so that stack adjustment instructions 
are always placed at the end of the VLIW packet. Thus, any call frame 
labels generated for those stack adjustments will appear after the VLIW 
packet, where they are legal. This method means either changing the DFA 
scheduler to the order of the instructions with stack adjustments at the 
end, or to write another pass which runs immediately after the DFA 
scheduler, and reorders the instructions.

2) Change ASM_OUTPUT_LABEL to detect when a call frame label is 
generated inside a VLIW packet. Instead of outputting the label 
immediately, it should store defer its output until the rest of the VLIW 
packet has been generated.

Any thoughts on which might be easier? I have already had to change 
final_prescan_insn and asm_output_opcode to support VLIW packets, so the 
second solution might be easier. However, other than this I can't see 
any clear argument for choosing one over the other.

thanks

dan.

============================================================================
Daniel Towner
picoChip Designs Ltd., Riverside Buildings, 108, Walcot Street, BATH,
BA1 5BG
dant@picochip.com
07786 702589 




More information about the Gcc mailing list