This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [csl-arm-branch]: FIx ICE
- From: Nathan Sidwell <nathan at codesourcery dot com>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Cc: Richard Earnshaw <rearnsha at gcc dot gnu dot org>
- Date: Wed, 06 Jul 2005 16:00:16 +0100
- Subject: Re: [csl-arm-branch]: FIx ICE
- References: <42C2BC39.4070800@codesourcery.com> <1120058742.28103.86.camel@pc960.cambridge.arm.com> <42C2C216.6010501@codesourcery.com>
Nathan Sidwell wrote:
Richard Earnshaw wrote:
Is gcc-3.4 affected?
apparently so, it starts chewing up memory. I'll post for review.
the patch fixes an infinite loop in 3.4. HEAD has changed significantly in this
area and does not appear affected.
ok for 3.4?
nathan
--
Nathan Sidwell :: http://www.codesourcery.com :: CodeSourcery LLC
nathan@codesourcery.com :: http://www.planetfall.pwp.blueyonder.co.uk
2005-06-29 Nathan Sidwell <nathan@codesourcery.com>
* loop-unswitch.c (unswitch_single_loop): Disable if condition is
in a different bb to jump.
Index: loop-unswitch.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/loop-unswitch.c,v
retrieving revision 1.8.6.2
diff -c -3 -p -r1.8.6.2 loop-unswitch.c
*** loop-unswitch.c 31 Dec 2003 00:44:10 -0000 1.8.6.2
--- loop-unswitch.c 13 May 2005 18:21:06 -0000
*************** unswitch_single_loop (struct loops *loop
*** 286,291 ****
--- 286,298 ----
}
} while (repeat);
+ if (BASIC_BLOCK (BLOCK_NUM (PREV_INSN (split_before))) != bbs[i])
+ {
+ if (rtl_dump_file)
+ fprintf (rtl_dump_file, ";; Not unswitching, cond in different bb\n");
+ return;
+ }
+
/* We found the condition we can unswitch on. */
conds = alloc_EXPR_LIST (0, cond, cond_checked);
if (rcond)
/* { dg-options "-O2 -funswitch-loops" }
void f(int type){
int tmp;
for(tmp = 0; tmp < 2; tmp++){
switch(type) {
case 0:
s1(); break;
case 1:
s2(); break;
case 2:
s3(); break;
}
}
}