This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] for PR 26209
On Tue, Feb 14, 2006 at 04:44:14PM -0500, Jakub Jelinek wrote:
> On Tue, Feb 14, 2006 at 12:46:22PM -0500, Diego Novillo wrote:
> > Zdenek Dvorak wrote:
> >
> > > PR tree-optimization/26209
> > > * tree-ssa-loop.c (pass_scev_cprop): Add TODO_cleanup_cfg.
> > > * tree-cfgcleanup.c (cleanup_control_flow): Remove dead
> > > eh edges.
> > > * tree-cfg.c (replace_uses_by): Do not alter cfg.
> > >
> > OK.
>
> FYI, I have bootstrapped/regtested this on
> {i386,x86_64,ia64,s390,s390x,ppc,ppc64}-linux, no regressions.
Unfortunately, it creates a regression on i386-linux, though
not in gcc testsuite:
typedef struct
{
unsigned short a;
unsigned short b;
} T;
T v[288];
unsigned short w[16];
void bar (T *, int);
void
foo (void)
{
int n;
int bits;
n = 0;
while (n <= 143)
v[n++].b = 8, w[8]++;
while (n <= 255)
v[n++].b = 9, w[9]++;
while (n <= 279)
v[n++].b = 7, w[7]++;
while (n <= 287)
v[n++].b = 8, w[8]++;
bar (v, 287);
}
used to compile at -O2 without this patch just fine, now we ICE in
#0 0x081b4971 in extract_array_ref (expr=0xf7c29000, base=0xffffd0d8, offset=0xffffd0d4) at ../../gcc/fold-const.c:5609
#1 0x081b4811 in extract_array_ref (expr=0xf7c2e5a0, base=0xffffd1f8, offset=0xffffd1f4) at ../../gcc/fold-const.c:5571
#2 0x081c0092 in fold_binary (code=GT_EXPR, type=0xf7baa4ac, op0=0xf7c2e5a0, op1=0xf7b9ad50) at ../../gcc/fold-const.c:8905
#3 0x081c47cf in fold_build2_stat (code=GT_EXPR, type=0xf7baa4ac, op0=0xf7c2e5a0, op1=0xf7b9ad50) at ../../gcc/fold-const.c:10517
#4 0x080e8483 in number_of_iterations_special (type=0xf7baa284, base0=0xf7c2e5a0, step0=0xf7b9aa38, code=LE_EXPR, base1=0xf7b9ad50, step1=0x0, niter=0xffffd718) at ../../gcc/tree-ssa-loop-niter.c:580
#5 0x080e90d3 in number_of_iterations_exit (loop=0x8594c10, exit=0xf7ba8488, niter=0xffffd718, warn=0 '\0') at ../../gcc/tree-ssa-loop-niter.c:973
#6 0x080f95bd in empty_loop_p (loop=0x8594c10) at ../../gcc/tree-ssa-loop-ivcanon.c:415
#7 0x080f9dee in try_remove_empty_loop (loop=0x8594c10, changed=0xffffd793 "") at ../../gcc/tree-ssa-loop-ivcanon.c:555
#8 0x080f9e42 in remove_empty_loops (loops=0x8573e08) at ../../gcc/tree-ssa-loop-ivcanon.c:572
#9 0x080e7139 in tree_ssa_empty_loop () at ../../gcc/tree-ssa-loop.c:320
5608 /* The next canonical form is a VAR_DECL with POINTER_TYPE. */
5609 else if (SSA_VAR_P (expr)
5610 && TREE_CODE (TREE_TYPE (expr)) == POINTER_TYPE)
5611 {
5612 *base = expr;
5613 *offset = NULL_TREE;
(gdb) p debug_tree (expr)
<ssa_name 0xf7c29000 nothrow var <var_decl 0xf7ba61b8 n> def_stmt <ssa_name 0xf7c23d34>
version 50 in-free-list>
(TREE_TYPE (expr) == NULL).
Jakub