This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: basic_induction_var change
- To: mark at codesourcery dot com
- Subject: Re: basic_induction_var change
- From: Joern Rennecke <amylaar at cygnus dot co dot uk>
- Date: Wed, 26 May 1999 20:36:55 +0100 (BST)
- Cc: egcs-patches at egcs dot cygnus dot com, amylaar at cygnus dot co dot uk
> The deal is that basic_induction_var is being called with
> `x' equal to `(const_int 1)'. We decide this is a legitimate
> increment, but fail to set the output parameter LOCATION. As a
> result, a later call to validate_change
>
> if (! validate_change (next->insn, next->location, add_val, 0))
>
> crashes. I guessed that what was wanted for LOCATION was the address
> of the `(const_int 1)'.
It's not an increment, but sets the register to a constant.
The biv->giv conversion code is not actually meant to operate on such sets.
Wed May 26 20:34:53 1999 J"orn Rennecke <amylaar@cygnus.co.uk>
* loop.c (strength_reduce): Don't do biv->giv conversion on constants.
Index: loop.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/loop.c,v
retrieving revision 1.158
diff -p -r1.158 loop.c
*** loop.c 1999/05/24 13:43:22 1.158
--- loop.c 1999/05/26 19:34:18
*************** strength_reduce (scan_start, end, loop_t
*** 4193,4198 ****
--- 4193,4200 ----
|| ! next->always_executed
|| next->maybe_multiple
|| ! CONSTANT_P (next->add_val)
+ || v->mult_val != const1_rtx
+ || next->mult_val != const1_rtx
|| ! (biv_dead_after_loop
|| no_jumps_between_p (v->insn, next->insn)))
{