Commit 44c5edc0 by Jakub Jelinek Committed by Jakub Jelinek

re PR rtl-optimization/5747 (ss20020218 fails to build binutils-2.11.93.0.2 on…

re PR rtl-optimization/5747 (ss20020218 fails to build binutils-2.11.93.0.2 on sparc-suse-linux - ICE in loop.c)

	PR optimization/5747
	* loop.c (scan_loop): Update reg info if move_movables created new
	pseudos.

	* gcc.dg/20020222-1.c: New test.

From-SVN: r49989
parent 31e2a00d
2002-02-23 Jakub Jelinek <jakub@redhat.com>
PR optimization/5747
* loop.c (scan_loop): Update reg info if move_movables created new
pseudos.
2002-02-23 David Edelsohn <edelsohn@gnu.org>
* gcc.c (init_gcc_spec): Revert last change.
......
......@@ -1102,7 +1102,25 @@ scan_loop (loop, flags)
optimizing for code size. */
if (! optimize_size)
move_movables (loop, movables, threshold, insn_count);
{
move_movables (loop, movables, threshold, insn_count);
/* Recalculate regs->array if move_movables has created new
registers. */
if (max_reg_num () > regs->num)
{
loop_regs_scan (loop, 0);
for (update_start = loop_start;
PREV_INSN (update_start)
&& GET_CODE (PREV_INSN (update_start)) != CODE_LABEL;
update_start = PREV_INSN (update_start))
;
update_end = NEXT_INSN (loop_end);
reg_scan_update (update_start, update_end, loop_max_reg);
loop_max_reg = max_reg_num ();
}
}
/* Now candidates that still are negative are those not moved.
Change regs->array[I].set_in_loop to indicate that those are not actually
......
2002-02-23 Jakub Jelinek <jakub@redhat.com>
* gcc.dg/20020222-1.c: New test.
2002-02-22 Jakub Jelinek <jakub@redhat.com>
* g++.dg/opt/anonunion1.C: New test.
......
/* PR optimization/5747
This testcase ICEd on sparc because move_movables created new pseudos,
but did not update reg info which load_mems needed. */
/* { dg-do compile } */
/* { dg-options "-O2" } */
/* { dg-options "-O2 -fPIC" { target sparc*-*-* } } */
extern void foo (void);
static char a[256];
void
bar (void)
{
unsigned int i;
static int b = 0;
int c;
if (b == 0)
{
b = 1;
foo ();
c = 0;
for (i = 0; i < 10; i++)
a[i + '0'] = c++;
for (i = 'A'; i <= 'Z'; i++)
a[i] = c++;
a['$'] = c++;
a['%'] = c++;
a['.'] = c++;
a['_'] = c++;
for (i = 'a'; i <= 'z'; i++)
a[i] = c++;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment