Commit d0b2266a by Trevor Saunders Committed by Trevor Saunders

always define HAVE_lo_sum

gcc/ChangeLog:

2015-05-23  Trevor Saunders  <tbsaunde+gcc@tbsaunde.org>

	* combine.c (find_split_point): Check the value of HAVE_lo_sum
	instead of if it is defined.
	(combine_simplify_rtx): Likewise.
	* lra-constraints.c (process_address_1): Likewise.
	* config/darwin.c: Adjust.
	* genconfig.c (main): Always define HAVE_lo_sum.

From-SVN: r223619
parent a63670fe
2015-05-23 Trevor Saunders <tbsaunde+gcc@tbsaunde.org>
* combine.c (find_split_point): Check the value of HAVE_lo_sum
instead of if it is defined.
(combine_simplify_rtx): Likewise.
* lra-constraints.c (process_address_1): Likewise.
* config/darwin.c: Adjust.
* genconfig.c (main): Always define HAVE_lo_sum.
2015-05-23 Prathamesh Kulkarni <prathamesh.kulkarni@linaro.org>
* genmatch.c (parser::parse_operation): Reject expanding operator-list inside 'for'.
......
......@@ -4785,11 +4785,10 @@ find_split_point (rtx *loc, rtx_insn *insn, bool set_src)
return find_split_point (&SUBREG_REG (x), insn, false);
case MEM:
#ifdef HAVE_lo_sum
/* If we have (mem (const ..)) or (mem (symbol_ref ...)), split it
using LO_SUM and HIGH. */
if (GET_CODE (XEXP (x, 0)) == CONST
|| GET_CODE (XEXP (x, 0)) == SYMBOL_REF)
if (HAVE_lo_sum && (GET_CODE (XEXP (x, 0)) == CONST
|| GET_CODE (XEXP (x, 0)) == SYMBOL_REF))
{
machine_mode address_mode = get_address_mode (x);
......@@ -4799,7 +4798,6 @@ find_split_point (rtx *loc, rtx_insn *insn, bool set_src)
XEXP (x, 0)));
return &XEXP (XEXP (x, 0), 0);
}
#endif
/* If we have a PLUS whose second operand is a constant and the
address is not valid, perhaps will can split it up using
......@@ -5857,16 +5855,14 @@ combine_simplify_rtx (rtx x, machine_mode op0_mode, int in_dest,
SUBST (XEXP (x, 0), XEXP (XEXP (x, 0), 0));
break;
#ifdef HAVE_lo_sum
case LO_SUM:
/* Convert (lo_sum (high FOO) FOO) to FOO. This is necessary so we
can add in an offset. find_split_point will split this address up
again if it doesn't match. */
if (GET_CODE (XEXP (x, 0)) == HIGH
if (HAVE_lo_sum && GET_CODE (XEXP (x, 0)) == HIGH
&& rtx_equal_p (XEXP (XEXP (x, 0), 0), XEXP (x, 1)))
return XEXP (x, 1);
break;
#endif
case PLUS:
/* (plus (xor (and <foo> (const_int pow2 - 1)) <c>) <-c>)
......
......@@ -149,8 +149,7 @@ int generating_for_darwin_version ;
section * darwin_sections[NUM_DARWIN_SECTIONS];
/* While we transition to using in-tests instead of ifdef'd code. */
#ifndef HAVE_lo_sum
#define HAVE_lo_sum 0
#if !HAVE_lo_sum
#define gen_macho_high(a,b) (a)
#define gen_macho_low(a,b,c) (a)
#endif
......
......@@ -360,6 +360,8 @@ main (int argc, char **argv)
if (have_lo_sum_flag)
printf ("#define HAVE_lo_sum 1\n");
else
printf ("#define HAVE_lo_sum 0\n");
if (have_rotate_flag)
printf ("#define HAVE_rotate 1\n");
......
......@@ -2962,42 +2962,42 @@ process_address_1 (int nop, bool check_only_p,
rtx addr = *ad.inner;
new_reg = lra_create_new_reg (Pmode, NULL_RTX, cl, "addr");
#ifdef HAVE_lo_sum
{
rtx_insn *insn;
rtx_insn *last = get_last_insn ();
/* addr => lo_sum (new_base, addr), case (2) above. */
insn = emit_insn (gen_rtx_SET
(new_reg,
gen_rtx_HIGH (Pmode, copy_rtx (addr))));
code = recog_memoized (insn);
if (code >= 0)
{
*ad.inner = gen_rtx_LO_SUM (Pmode, new_reg, addr);
if (! valid_address_p (ad.mode, *ad.outer, ad.as))
{
/* Try to put lo_sum into register. */
insn = emit_insn (gen_rtx_SET
(new_reg,
gen_rtx_LO_SUM (Pmode, new_reg, addr)));
code = recog_memoized (insn);
if (code >= 0)
{
*ad.inner = new_reg;
if (! valid_address_p (ad.mode, *ad.outer, ad.as))
{
*ad.inner = addr;
code = -1;
}
}
}
}
if (code < 0)
delete_insns_since (last);
}
#endif
if (HAVE_lo_sum)
{
rtx_insn *insn;
rtx_insn *last = get_last_insn ();
/* addr => lo_sum (new_base, addr), case (2) above. */
insn = emit_insn (gen_rtx_SET
(new_reg,
gen_rtx_HIGH (Pmode, copy_rtx (addr))));
code = recog_memoized (insn);
if (code >= 0)
{
*ad.inner = gen_rtx_LO_SUM (Pmode, new_reg, addr);
if (! valid_address_p (ad.mode, *ad.outer, ad.as))
{
/* Try to put lo_sum into register. */
insn = emit_insn (gen_rtx_SET
(new_reg,
gen_rtx_LO_SUM (Pmode, new_reg, addr)));
code = recog_memoized (insn);
if (code >= 0)
{
*ad.inner = new_reg;
if (! valid_address_p (ad.mode, *ad.outer, ad.as))
{
*ad.inner = addr;
code = -1;
}
}
}
}
if (code < 0)
delete_insns_since (last);
}
if (code < 0)
{
/* addr => new_base, case (2) above. */
......
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