diff mbox

Fix --enable-checking=rtl bootstrap failure caused by ADDRESS changes (PR bootstrap/53021)

Message ID 20120420110004.GY16117@tyan-ft48-01.lab.bos.redhat.com
State New
Headers show

Commit Message

Jakub Jelinek April 20, 2012, 11 a.m. UTC
On Tue, Apr 17, 2012 at 09:11:37PM +0100, Richard Sandiford wrote:
> >>        * rtl.def (ADDRESS): Turn operand into a HOST_WIDE_INT.
> >>        * alias.c (reg_base_value): Expand and update comment.
> >>        (arg_base_value): New variable.
> >>        (unique_id): Move up file.
> >>        (unique_base_value, unique_base_value_p, known_base_value_p): New.
> >>        (find_base_value): Use arg_base_value and known_base_value_p.
> >>        (record_set): Document REG_NOALIAS handling.  Use unique_base_value.
> >>        (find_base_term): Use known_base_value_p.
> >>        (base_alias_check): Use unique_base_value_p.
> >>        (init_alias_target): Initialize arg_base_value.  Use unique_base_value.
> >>        (init_alias_analysis): Use 1 as the first id for REG_NOALIAS bases.

This also broke RTL checking bootstrap everywhere (and broke DSE silently
otherwise).

Here is a fix, bootstrapped/regtested on x86_64-linux and i686-linux,
ok for trunk?

2012-04-20  Jakub Jelinek  <jakub@redhat.com>

	PR bootstrap/53021
	* alias.h (UNIQUE_BASE_VALUE_SP, UNIQUE_BASE_VALUE_ARGP,
	UNIQUE_BASE_VALUE_FP, UNIQUE_BASE_VALUE_HFP): Define.
	* alias.c (init_alias_targets): Use UNIQUE_BASE_VALUE_*
	macros instead of constants.
	* dse.c (record_store): Check for SP ADDRESS by comparing
	XWINT to UNIQUE_BASE_VALUE_SP instead of expecting
	XEXP to be stack_pointer_rtx.



	Jakub

Comments

Richard Biener April 20, 2012, 11:58 a.m. UTC | #1
On Fri, 20 Apr 2012, Jakub Jelinek wrote:

> On Tue, Apr 17, 2012 at 09:11:37PM +0100, Richard Sandiford wrote:
> > >>        * rtl.def (ADDRESS): Turn operand into a HOST_WIDE_INT.
> > >>        * alias.c (reg_base_value): Expand and update comment.
> > >>        (arg_base_value): New variable.
> > >>        (unique_id): Move up file.
> > >>        (unique_base_value, unique_base_value_p, known_base_value_p): New.
> > >>        (find_base_value): Use arg_base_value and known_base_value_p.
> > >>        (record_set): Document REG_NOALIAS handling.  Use unique_base_value.
> > >>        (find_base_term): Use known_base_value_p.
> > >>        (base_alias_check): Use unique_base_value_p.
> > >>        (init_alias_target): Initialize arg_base_value.  Use unique_base_value.
> > >>        (init_alias_analysis): Use 1 as the first id for REG_NOALIAS bases.
> 
> This also broke RTL checking bootstrap everywhere (and broke DSE silently
> otherwise).
> 
> Here is a fix, bootstrapped/regtested on x86_64-linux and i686-linux,
> ok for trunk?

Ok.

Thanks,
Richard.

> 2012-04-20  Jakub Jelinek  <jakub@redhat.com>
> 
> 	PR bootstrap/53021
> 	* alias.h (UNIQUE_BASE_VALUE_SP, UNIQUE_BASE_VALUE_ARGP,
> 	UNIQUE_BASE_VALUE_FP, UNIQUE_BASE_VALUE_HFP): Define.
> 	* alias.c (init_alias_targets): Use UNIQUE_BASE_VALUE_*
> 	macros instead of constants.
> 	* dse.c (record_store): Check for SP ADDRESS by comparing
> 	XWINT to UNIQUE_BASE_VALUE_SP instead of expecting
> 	XEXP to be stack_pointer_rtx.
> 
> --- gcc/alias.h.jj	2011-06-14 13:11:24.000000000 +0200
> +++ gcc/alias.h	2012-04-20 10:46:02.611942631 +0200
> @@ -50,4 +50,11 @@ extern int nonoverlapping_memrefs_p (con
>     memory barriers, including an address of SCRATCH.  */
>  #define ALIAS_SET_MEMORY_BARRIER	((alias_set_type) -1)
>  
> +/* Values of XWINT (address, 0) of Pmode ADDRESS rtxes for special
> +   registers.  */
> +#define UNIQUE_BASE_VALUE_SP	-1
> +#define UNIQUE_BASE_VALUE_ARGP	-2
> +#define UNIQUE_BASE_VALUE_FP	-3
> +#define UNIQUE_BASE_VALUE_HFP	-4
> +
>  #endif /* GCC_ALIAS_H */
> --- gcc/alias.c.jj	2012-04-20 09:49:12.000000000 +0200
> +++ gcc/alias.c	2012-04-20 10:47:41.571585574 +0200
> @@ -2734,11 +2734,15 @@ init_alias_target (void)
>  	&& HARD_REGNO_MODE_OK (i, Pmode))
>        static_reg_base_value[i] = arg_base_value;
>  
> -  static_reg_base_value[STACK_POINTER_REGNUM] = unique_base_value (-1);
> -  static_reg_base_value[ARG_POINTER_REGNUM] = unique_base_value (-2);
> -  static_reg_base_value[FRAME_POINTER_REGNUM] = unique_base_value (-3);
> +  static_reg_base_value[STACK_POINTER_REGNUM]
> +    = unique_base_value (UNIQUE_BASE_VALUE_SP);
> +  static_reg_base_value[ARG_POINTER_REGNUM]
> +    = unique_base_value (UNIQUE_BASE_VALUE_ARGP);
> +  static_reg_base_value[FRAME_POINTER_REGNUM]
> +    = unique_base_value (UNIQUE_BASE_VALUE_FP);
>  #if !HARD_FRAME_POINTER_IS_FRAME_POINTER
> -  static_reg_base_value[HARD_FRAME_POINTER_REGNUM] = unique_base_value (-4);
> +  static_reg_base_value[HARD_FRAME_POINTER_REGNUM]
> +    = unique_base_value (UNIQUE_BASE_VALUE_HFP);
>  #endif
>  }
>  
> --- gcc/dse.c.jj	2012-03-29 16:48:36.000000000 +0200
> +++ gcc/dse.c	2012-04-20 10:44:37.427586834 +0200
> @@ -1503,7 +1503,7 @@ record_store (rtx body, bb_info_t bb_inf
>        if (!base_term
>  	  || (GET_CODE (base_term) == ADDRESS
>  	      && GET_MODE (base_term) == Pmode
> -	      && XEXP (base_term, 0) == stack_pointer_rtx))
> +	      && XWINT (base_term, 0) == UNIQUE_BASE_VALUE_SP))
>  	insn_info->stack_pointer_based = true;
>        insn_info->contains_cselib_groups = true;
>  
> 
> 
> 	Jakub
> 
>
Richard Sandiford April 20, 2012, 12:21 p.m. UTC | #2
Jakub Jelinek <jakub@redhat.com> writes:
> On Tue, Apr 17, 2012 at 09:11:37PM +0100, Richard Sandiford wrote:
>> >>        * rtl.def (ADDRESS): Turn operand into a HOST_WIDE_INT.
>> >>        * alias.c (reg_base_value): Expand and update comment.
>> >>        (arg_base_value): New variable.
>> >>        (unique_id): Move up file.
>> >>        (unique_base_value, unique_base_value_p, known_base_value_p): New.
>> >>        (find_base_value): Use arg_base_value and known_base_value_p.
>> >>        (record_set): Document REG_NOALIAS handling.  Use unique_base_value.
>> >>        (find_base_term): Use known_base_value_p.
>> >>        (base_alias_check): Use unique_base_value_p.
>> >>        (init_alias_target): Initialize arg_base_value.  Use unique_base_value.
>> >>        (init_alias_analysis): Use 1 as the first id for REG_NOALIAS bases.
>
> This also broke RTL checking bootstrap everywhere (and broke DSE silently
> otherwise).
>
> Here is a fix, bootstrapped/regtested on x86_64-linux and i686-linux,
> ok for trunk?
>
> 2012-04-20  Jakub Jelinek  <jakub@redhat.com>
>
> 	PR bootstrap/53021
> 	* alias.h (UNIQUE_BASE_VALUE_SP, UNIQUE_BASE_VALUE_ARGP,
> 	UNIQUE_BASE_VALUE_FP, UNIQUE_BASE_VALUE_HFP): Define.
> 	* alias.c (init_alias_targets): Use UNIQUE_BASE_VALUE_*
> 	macros instead of constants.
> 	* dse.c (record_store): Check for SP ADDRESS by comparing
> 	XWINT to UNIQUE_BASE_VALUE_SP instead of expecting
> 	XEXP to be stack_pointer_rtx.

Thanks, and sorry for messing this one up rather badly.

Richard
diff mbox

Patch

--- gcc/alias.h.jj	2011-06-14 13:11:24.000000000 +0200
+++ gcc/alias.h	2012-04-20 10:46:02.611942631 +0200
@@ -50,4 +50,11 @@  extern int nonoverlapping_memrefs_p (con
    memory barriers, including an address of SCRATCH.  */
 #define ALIAS_SET_MEMORY_BARRIER	((alias_set_type) -1)
 
+/* Values of XWINT (address, 0) of Pmode ADDRESS rtxes for special
+   registers.  */
+#define UNIQUE_BASE_VALUE_SP	-1
+#define UNIQUE_BASE_VALUE_ARGP	-2
+#define UNIQUE_BASE_VALUE_FP	-3
+#define UNIQUE_BASE_VALUE_HFP	-4
+
 #endif /* GCC_ALIAS_H */
--- gcc/alias.c.jj	2012-04-20 09:49:12.000000000 +0200
+++ gcc/alias.c	2012-04-20 10:47:41.571585574 +0200
@@ -2734,11 +2734,15 @@  init_alias_target (void)
 	&& HARD_REGNO_MODE_OK (i, Pmode))
       static_reg_base_value[i] = arg_base_value;
 
-  static_reg_base_value[STACK_POINTER_REGNUM] = unique_base_value (-1);
-  static_reg_base_value[ARG_POINTER_REGNUM] = unique_base_value (-2);
-  static_reg_base_value[FRAME_POINTER_REGNUM] = unique_base_value (-3);
+  static_reg_base_value[STACK_POINTER_REGNUM]
+    = unique_base_value (UNIQUE_BASE_VALUE_SP);
+  static_reg_base_value[ARG_POINTER_REGNUM]
+    = unique_base_value (UNIQUE_BASE_VALUE_ARGP);
+  static_reg_base_value[FRAME_POINTER_REGNUM]
+    = unique_base_value (UNIQUE_BASE_VALUE_FP);
 #if !HARD_FRAME_POINTER_IS_FRAME_POINTER
-  static_reg_base_value[HARD_FRAME_POINTER_REGNUM] = unique_base_value (-4);
+  static_reg_base_value[HARD_FRAME_POINTER_REGNUM]
+    = unique_base_value (UNIQUE_BASE_VALUE_HFP);
 #endif
 }
 
--- gcc/dse.c.jj	2012-03-29 16:48:36.000000000 +0200
+++ gcc/dse.c	2012-04-20 10:44:37.427586834 +0200
@@ -1503,7 +1503,7 @@  record_store (rtx body, bb_info_t bb_inf
       if (!base_term
 	  || (GET_CODE (base_term) == ADDRESS
 	      && GET_MODE (base_term) == Pmode
-	      && XEXP (base_term, 0) == stack_pointer_rtx))
+	      && XWINT (base_term, 0) == UNIQUE_BASE_VALUE_SP))
 	insn_info->stack_pointer_based = true;
       insn_info->contains_cselib_groups = true;