This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Fix for incompletely duplicated code in strength_reduce
- To: Joern Rennecke <amylaar at cygnus dot co dot uk>
- Subject: Fix for incompletely duplicated code in strength_reduce
- From: Michael Hayes <m dot hayes at elec dot canterbury dot ac dot nz>
- Date: Tue, 15 Dec 1998 18:25:41 +1300 (NZDT)
- Cc: wilson at cygnus dot com, law at cygnus dot com, egcs-patches at cygnus dot com
- References: <199812150059.AAA28150@phal.cygnus.co.uk>
Joern Rennecke writes:
> After strength_reduce has called consec_sets_giv to verify a giv for a
> register that is set multiple times, it duplicates some code from
> the called function to determine the insn that actually sets the value of
> the giv. However, the replication is incomplete, and if any insn that
> doesn't set the giv is between insns that do set it, the loop stops too
> early.
>
> Here is a patch to remove the code duplication:
I'm finding that this patch causes a segfault for the c4x target,
since last_consec_insn is being referenced before it is set.
The following function triggers this.
int ccopy1(const __complex__ float *a, __complex__ float *b, int size)
{
int i;
for (i = 0; i < size; i++)
b[i] = a[i];
return 1;
}