Skip to content
Snippets Groups Projects
Commit 083892ba authored by Georg-Johann Lay's avatar Georg-Johann Lay
Browse files

AVR: target/116781 - Fix ICE due to (clobber (match_dup)) in tablejump.

This patch avoids (clobber (match_dup)) in insn patterns for tablejump.
The machine description now uses a scratch_operand instead which is
possible since the clobbered entity is known in advance:

3-byte PC        : REG_Z
2-byte PC + JMP  : REG_Z
2-byte PC + RJMP : None, hence scratch:HI is used.

The avr-casesi pass and optimization has to be adjusted to the new patterns.

	PR target/116781
gcc/
	* config/avr/avr.md (*tablejump_split, *tablejump): Add
	operand 2 as a "scratch_operand" instead of a match_dup.
	(casesi): Adjust expander operands accordingly.  Use a scratch:HI
	when the jump address is not clobbered.  This is the case for a
	2-byte PC + has no JMP instruction.  In all the other cases, the
	affected operand is REG_Z (reg:HI 30).
	(casesi_<mode>_sequence): Adjust matcher to new anatomy.
	* config/avr/avr-passes.cc (avr_is_casesi_sequence)
	(avr_is_casesi_sequence, avr_optimize_casesi)
	(avr_casei_sequence_check_operands): Adjust to new anatomy.
parent 02d73709
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment