Commit bd379f73 by Pat Haugen Committed by Pat Haugen

reload.c (find_reloads_address_1): Try to preserve original base/index regclass of operands.

ChangeLog:

2007-09-06  Pat Haugen  <pthaugen@us.ibm.com>

	* reload.c (find_reloads_address_1): Try to preserve original
	base/index regclass of operands.
	* regrename.c (scan_rtx_address): Likewise.
	(replace_oldest_value_addr): Likewise.

From-SVN: r128183
parent 200809cb
2007-09-06 Pat Haugen <pthaugen@us.ibm.com>
* reload.c (find_reloads_address_1): Try to preserve original
base/index regclass of operands.
* regrename.c (scan_rtx_address): Likewise.
(replace_oldest_value_addr): Likewise.
2007-09-06 Richard Guenther <rguenther@suse.de>
PR tree-optimization/33302
......
......@@ -559,20 +559,19 @@ scan_rtx_address (rtx insn, rtx *loc, enum reg_class cl,
int index_op;
unsigned regno0 = REGNO (op0), regno1 = REGNO (op1);
if (REGNO_OK_FOR_INDEX_P (regno0)
&& regno_ok_for_base_p (regno1, mode, PLUS, REG))
if (REGNO_OK_FOR_INDEX_P (regno1)
&& regno_ok_for_base_p (regno0, mode, PLUS, REG))
index_op = 1;
else if (REGNO_OK_FOR_INDEX_P (regno0)
&& regno_ok_for_base_p (regno1, mode, PLUS, REG))
index_op = 0;
else if (REGNO_OK_FOR_INDEX_P (regno1)
&& regno_ok_for_base_p (regno0, mode, PLUS, REG))
else if (regno_ok_for_base_p (regno0, mode, PLUS, REG)
|| REGNO_OK_FOR_INDEX_P (regno1))
index_op = 1;
else if (regno_ok_for_base_p (regno1, mode, PLUS, REG))
index_op = 0;
else if (regno_ok_for_base_p (regno0, mode, PLUS, REG))
index_op = 1;
else if (REGNO_OK_FOR_INDEX_P (regno1))
index_op = 1;
else
index_op = 0;
index_op = 1;
locI = &XEXP (x, index_op);
locB = &XEXP (x, !index_op);
......@@ -1476,20 +1475,19 @@ replace_oldest_value_addr (rtx *loc, enum reg_class cl,
int index_op;
unsigned regno0 = REGNO (op0), regno1 = REGNO (op1);
if (REGNO_OK_FOR_INDEX_P (regno0)
&& regno_ok_for_base_p (regno1, mode, PLUS, REG))
if (REGNO_OK_FOR_INDEX_P (regno1)
&& regno_ok_for_base_p (regno0, mode, PLUS, REG))
index_op = 1;
else if (REGNO_OK_FOR_INDEX_P (regno0)
&& regno_ok_for_base_p (regno1, mode, PLUS, REG))
index_op = 0;
else if (REGNO_OK_FOR_INDEX_P (regno1)
&& regno_ok_for_base_p (regno0, mode, PLUS, REG))
else if (regno_ok_for_base_p (regno0, mode, PLUS, REG)
|| REGNO_OK_FOR_INDEX_P (regno1))
index_op = 1;
else if (regno_ok_for_base_p (regno1, mode, PLUS, REG))
index_op = 0;
else if (regno_ok_for_base_p (regno0, mode, PLUS, REG))
index_op = 1;
else if (REGNO_OK_FOR_INDEX_P (regno1))
index_op = 1;
else
index_op = 0;
index_op = 1;
locI = &XEXP (x, index_op);
locB = &XEXP (x, !index_op);
......
......@@ -5464,16 +5464,12 @@ find_reloads_address_1 (enum machine_mode mode, rtx x, int context,
else if (code0 == REG && code1 == REG)
{
if (REGNO_OK_FOR_INDEX_P (REGNO (op0))
&& regno_ok_for_base_p (REGNO (op1), mode, PLUS, REG))
if (REGNO_OK_FOR_INDEX_P (REGNO (op1))
&& regno_ok_for_base_p (REGNO (op0), mode, PLUS, REG))
return 0;
else if (REGNO_OK_FOR_INDEX_P (REGNO (op1))
&& regno_ok_for_base_p (REGNO (op0), mode, PLUS, REG))
else if (REGNO_OK_FOR_INDEX_P (REGNO (op0))
&& regno_ok_for_base_p (REGNO (op1), mode, PLUS, REG))
return 0;
else if (regno_ok_for_base_p (REGNO (op1), mode, PLUS, REG))
find_reloads_address_1 (mode, orig_op0, 1, PLUS, SCRATCH,
&XEXP (x, 0), opnum, type, ind_levels,
insn);
else if (regno_ok_for_base_p (REGNO (op0), mode, PLUS, REG))
find_reloads_address_1 (mode, orig_op1, 1, PLUS, SCRATCH,
&XEXP (x, 1), opnum, type, ind_levels,
......@@ -5482,16 +5478,20 @@ find_reloads_address_1 (enum machine_mode mode, rtx x, int context,
find_reloads_address_1 (mode, orig_op0, 0, PLUS, REG,
&XEXP (x, 0), opnum, type, ind_levels,
insn);
else if (regno_ok_for_base_p (REGNO (op1), mode, PLUS, REG))
find_reloads_address_1 (mode, orig_op0, 1, PLUS, SCRATCH,
&XEXP (x, 0), opnum, type, ind_levels,
insn);
else if (REGNO_OK_FOR_INDEX_P (REGNO (op0)))
find_reloads_address_1 (mode, orig_op1, 0, PLUS, REG,
&XEXP (x, 1), opnum, type, ind_levels,
insn);
else
{
find_reloads_address_1 (mode, orig_op0, 1, PLUS, SCRATCH,
find_reloads_address_1 (mode, orig_op0, 0, PLUS, REG,
&XEXP (x, 0), opnum, type, ind_levels,
insn);
find_reloads_address_1 (mode, orig_op1, 0, PLUS, REG,
find_reloads_address_1 (mode, orig_op1, 1, PLUS, SCRATCH,
&XEXP (x, 1), opnum, type, ind_levels,
insn);
}
......
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