This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [Patch,AVR]: Fix rtx_costs of SYMBOL_REF
- From: Richard Henderson <rth at redhat dot com>
- To: Georg-Johann Lay <avr at gjlay dot de>
- Cc: gcc-patches at gcc dot gnu dot org, Anatoly Sokolov <aesok at post dot ru>, Denis Chertykov <chertykov at gmail dot com>, Eric Weddington <eric dot weddington at atmel dot com>
- Date: Wed, 20 Jul 2011 09:20:52 -0700
- Subject: Re: [Patch,AVR]: Fix rtx_costs of SYMBOL_REF
- References: <4E26E32B.5070505@gjlay.de>
On 07/20/2011 07:16 AM, Georg-Johann Lay wrote:
> case CONST_INT:
> case CONST_DOUBLE:
> + case SYMBOL_REF:
> /* Immediate constants are as cheap as registers. */
> *total = 0;
> return true;
> @@ -5348,7 +5349,6 @@ avr_rtx_costs (rtx x, int codearg, int o
> case MEM:
> case CONST:
> case LABEL_REF:
> - case SYMBOL_REF:
> *total = COSTS_N_INSNS (GET_MODE_SIZE (mode));
If you're going to change SYMBOL_REF, then you should also
change CONST and LABEL_REF.
Examine your test case with 'x[2+i]', which ought to be
folded to (const (plus (symbol_ref) (const_int 2))) and
printed as lo8(-(x+2)) etc.
r~