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]

[PATCH]: Fix places where we expect non-null loops in the looparray


Personally, i think it's incredibly weird for the loop info to claim we
have two loops, and num_levels == 2, when one of the loop infos is NULL,
but hey, whatever. :)

Diego, this will fix g++.old-deja/g++.eh/crash1.C on TCB when you next
merge.


Bootstrapped and regtested on i686-pc-linux-gnu.
Okay for mainline?

2004-12-06  Daniel Berlin  <dberlin@dberlin.org>

	* tree-ssa-loop-ch.c (copy_loop_headers): Loop can be null.
	* tree-ssa-loop-im.c (determine_lsm): tree_root may not have a real
	inner loop.
Index: tree-ssa-loop-ch.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-ssa-loop-ch.c,v
retrieving revision 2.9
diff -u -p -r2.9 tree-ssa-loop-ch.c
--- tree-ssa-loop-ch.c	17 Nov 2004 02:01:34 -0000	2.9
+++ tree-ssa-loop-ch.c	6 Dec 2004 15:52:42 -0000
@@ -152,6 +152,8 @@ copy_loop_headers (void)
       int limit = 20;
 
       loop = loops->parray[i];
+      if (!loop)
+	continue;
       header = loop->header;
 
       /* If the loop is already a do-while style one (either because it was
Index: tree-ssa-loop-im.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-ssa-loop-im.c,v
retrieving revision 2.23
diff -u -p -r2.23 tree-ssa-loop-im.c
--- tree-ssa-loop-im.c	16 Nov 2004 00:08:04 -0000	2.23
+++ tree-ssa-loop-im.c	6 Dec 2004 15:52:42 -0000
@@ -1252,6 +1252,9 @@ determine_lsm (struct loops *loops)
   struct loop *loop;
   basic_block bb;
 
+  if (!loops->tree_root->inner)
+    return;
+
   /* Create a UID for each statement in the function.  Ordering of the
      UIDs is not important for this pass.  */
   max_stmt_uid = 0;

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