diff mbox

Extend list of codes accepted by address_operand

Message ID 87mw1tyjdx.fsf@e105548-lin.cambridge.arm.com
State New
Headers show

Commit Message

Richard Sandiford April 27, 2015, 10:07 a.m. UTC
While testing the patch that I'm about to post, I found that the list
of address_operand codes in gensupport.c was incomplete.  This patch
fills in some "obvious" missing entries.

It isn't exactly clear which codes are allowed at the top level of
an address.  decompose_address is known to be general enough for all LRA
targets, but it also technically accepts any unary operator as the outer
code, whereas I think only SIGN_EXTEND and ZERO_EXTEND are used at the
top level.  The routine accepts ZERO_EXTRACT and SIGN_EXTRACT, but I
think in practice they're only used for index values and not full addresses.

Tested on x86_64-linux-gnu.  OK to install?

Thanks,
Richard


gcc/
	* gensupport.c (std_preds): Add missing codes to address_operand entry.

Comments

Jeff Law April 27, 2015, 6:14 p.m. UTC | #1
On 04/27/2015 04:07 AM, Richard Sandiford wrote:
> While testing the patch that I'm about to post, I found that the list
> of address_operand codes in gensupport.c was incomplete.  This patch
> fills in some "obvious" missing entries.
>
> It isn't exactly clear which codes are allowed at the top level of
> an address.  decompose_address is known to be general enough for all LRA
> targets, but it also technically accepts any unary operator as the outer
> code, whereas I think only SIGN_EXTEND and ZERO_EXTEND are used at the
> top level.  The routine accepts ZERO_EXTRACT and SIGN_EXTRACT, but I
> think in practice they're only used for index values and not full addresses.
>
> Tested on x86_64-linux-gnu.  OK to install?
>
> Thanks,
> Richard
>
>
> gcc/
> 	* gensupport.c (std_preds): Add missing codes to address_operand entry.
OK.
jeff
diff mbox

Patch

Index: gcc/gensupport.c
===================================================================
--- gcc/gensupport.c	2015-04-27 10:38:48.000000000 +0100
+++ gcc/gensupport.c	2015-04-27 10:40:59.044635383 +0100
@@ -2800,7 +2800,8 @@  struct std_pred_table
 
 static const struct std_pred_table std_preds[] = {
   {"general_operand", false, true, {SUBREG, REG, MEM}},
-  {"address_operand", true, true, {SUBREG, REG, MEM, PLUS, MINUS, MULT}},
+  {"address_operand", true, true, {SUBREG, REG, MEM, PLUS, MINUS, MULT,
+				   ZERO_EXTEND, SIGN_EXTEND, AND}},
   {"register_operand", false, false, {SUBREG, REG}},
   {"pmode_register_operand", true, false, {SUBREG, REG}},
   {"scratch_operand", false, false, {SCRATCH, REG}},