Commit d0b042c6 by Eric Botcazou Committed by Eric Botcazou

sparc.c (parc_delegitimize_address): Recognize the GOT register and decoded…

sparc.c (parc_delegitimize_address): Recognize the GOT register and decoded HIGH/LO_SUM combinations for labels in...

	* config/sparc/sparc.c (parc_delegitimize_address): Recognize the GOT
	register and decoded HIGH/LO_SUM combinations for labels in PIC mode.

From-SVN: r268145
parent a14e3083
2019-01-22 Eric Botcazou <ebotcazou@adacore.com>
* config/sparc/sparc.c (parc_delegitimize_address): Recognize the GOT
register and decoded HIGH/LO_SUM combinations for labels in PIC mode.
2019-01-22 Jakub Jelinek <jakub@redhat.com> 2019-01-22 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/88044 PR tree-optimization/88044
......
...@@ -4995,17 +4995,23 @@ sparc_delegitimize_address (rtx x) ...@@ -4995,17 +4995,23 @@ sparc_delegitimize_address (rtx x)
/* This is generated by mov{si,di}_pic_label_ref in PIC mode. */ /* This is generated by mov{si,di}_pic_label_ref in PIC mode. */
if (GET_CODE (x) == MINUS if (GET_CODE (x) == MINUS
&& sparc_pic_register_p (XEXP (x, 0)) && (XEXP (x, 0) == global_offset_table_rtx
&& GET_CODE (XEXP (x, 1)) == LO_SUM || sparc_pic_register_p (XEXP (x, 0))))
&& GET_CODE (XEXP (XEXP (x, 1), 1)) == UNSPEC {
&& XINT (XEXP (XEXP (x, 1), 1), 1) == UNSPEC_MOVE_PIC_LABEL) rtx y = XEXP (x, 1);
{
x = XVECEXP (XEXP (XEXP (x, 1), 1), 0, 0); if (GET_CODE (y) == LO_SUM)
gcc_assert (GET_CODE (x) == LABEL_REF y = XEXP (y, 1);
|| (GET_CODE (x) == CONST
&& GET_CODE (XEXP (x, 0)) == PLUS if (GET_CODE (y) == UNSPEC && XINT (y, 1) == UNSPEC_MOVE_PIC_LABEL)
&& GET_CODE (XEXP (XEXP (x, 0), 0)) == LABEL_REF {
&& GET_CODE (XEXP (XEXP (x, 0), 1)) == CONST_INT)); x = XVECEXP (y, 0, 0);
gcc_assert (GET_CODE (x) == LABEL_REF
|| (GET_CODE (x) == CONST
&& GET_CODE (XEXP (x, 0)) == PLUS
&& GET_CODE (XEXP (XEXP (x, 0), 0)) == LABEL_REF
&& GET_CODE (XEXP (XEXP (x, 0), 1)) == CONST_INT));
}
} }
return x; return x;
......
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