This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [csl-arm-branch]: FIx ICE


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;
	}
    }
}

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]