Skip to content
Snippets Groups Projects
Commit 30038a20 authored by Vladimir N. Makarov's avatar Vladimir N. Makarov
Browse files

LRA: Update insn sp offset if its input reload changes SP

The patch fixes a bug when there is input reload changing SP.  The bug was
triggered by switching H8300 target to LRA.  The insn in question is

(insn 21 20 22 2 (set (mem/f:SI (pre_dec:SI (reg/f:SI 7 sp)) [3  S4 A32])
        (reg/f:SI 31)) "j.c":10:3 19 {*movsi}
     (expr_list:REG_DEAD (reg/f:SI 31)
        (expr_list:REG_ARGS_SIZE (const_int 4 [0x4])
            (nil))))

The memory address is reloaded but the SP offset for the original insn was not updated.

gcc/ChangeLog:

	* lra-int.h (lra_update_sp_offset): Add the prototype.
	* lra.cc (setup_sp_offset): Change the return type.  Use
	lra_update_sp_offset.
	* lra-eliminations.cc (lra_update_sp_offset): New function.
	(lra_process_new_insns): Push the current insn to reprocess if the
	input reload changes sp offset.
parent 2720bbd5
No related branches found
No related tags found
Loading
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