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: [PATCH]: Fix PR target/27863: ICE in check_cfg, at haifa-sched.c:4615


Vladimir N. Makarov wrote:
Richard Guenther wrote:

...


I wonder why you tested this on i686 when the PR is for target ia64.
Can you also add the reduced testcase to gcc.c-torture/compile?



Maxim, please don't disable bootstrap when submitting a patch to the main line. You should check other major platforms too (like x86, x86_64, and ppc if you have them).

I can guess that you put gcc_asserts as in move_insn but unlink_other_notes is called not for all basic block (some notes has no bb field).

I am afraid you broke not only i64 but other targets too. So please fix this as soon as possible. I'll wait for the patch.

Vlad

I am sorry for my mistake. This patch is currently being tested on i386-pc-linux-gnu and ia64-unknown-linux-gnu.



Thanks, Maxim
2006-06-09  Maxim Kuvyrkov  <mkuvyrkov@ispras.ru>

	* haifa-sched.c (unlink_other_notes, unlink_line_notes): Fix the patch
	for PR target/27863.

2006-06-09  Maxim Kuvyrkov  <mkuvyrkov@ispras.ru>

	* gcc.c-torture/compile/20060609-1.c: New test.
	
	PR target/27863
	* gcc.c-torture/compile/pr27863.c: New test.

--- testsuite/gcc.c-torture/compile/pr27863.c	(/gcc-local/trunk/gcc)	(revision 20091)
+++ testsuite/gcc.c-torture/compile/pr27863.c	(/gcc-local/fix-pr27863-2/gcc)	(revision 20091)
@@ -0,0 +1,28 @@
+/* This test used to ICE on IA64.  */
+long stack[100];
+int main(int argc,char**argv,char **envp)
+{
+  long *esp=stack;
+  static void* jarray[]={ &&KeyCtrlKV };
+ *++esp=(long)&&_loc0;
+ goto SetTermStruc;
+ _loc0:;
+ *++esp=(long)&&_loc1;
+ _loc1:;
+*++esp=(long)&&_loc35;
+ _loc35:;
+goto *(*esp--);
+*++esp=(long)&&_loc36;
+ _loc36:;
+*++esp=(long)&&_loc37;
+ _loc37:;
+KeyCtrlKV:
+*++esp=(long)&&_loc66;
+_loc66:;
+*++esp=(long)&&_loc106;
+ _loc106:;
+*++esp=(long)&&_loc119;
+ _loc119:;
+SetTermStruc:
+ goto *(*esp--);
+}
--- testsuite/gcc.c-torture/compile/20060609-1.c	(/gcc-local/trunk/gcc)	(revision 20091)
+++ testsuite/gcc.c-torture/compile/20060609-1.c	(/gcc-local/fix-pr27863-2/gcc)	(revision 20091)
@@ -0,0 +1,7 @@
+/* This test used to ICE on IA64.  */
+int __strspn_c2 (__const char *__s, int __accept1, int __accept2)
+{
+  register long unsigned int __result = 0;
+  while (__s[__result] == __accept1 || __s[__result] == __accept2)
+  return __result;
+}
--- haifa-sched.c	(/gcc-local/trunk/gcc)	(revision 20091)
+++ haifa-sched.c	(/gcc-local/fix-pr27863-2/gcc)	(revision 20091)
@@ -1251,13 +1251,16 @@ unlink_other_notes (rtx insn, rtx tail)
       if (next)
 	PREV_INSN (next) = prev;
 
-      /* Basic block can begin with either LABEL or
-         NOTE_INSN_BASIC_BLOCK.  */
-      gcc_assert (BB_HEAD (bb) != insn);
+      if (bb)
+        {
+          /* Basic block can begin with either LABEL or
+             NOTE_INSN_BASIC_BLOCK.  */
+          gcc_assert (BB_HEAD (bb) != insn);
 
-      /* Check if we are removing last insn in the BB.  */
-      if (BB_END (bb) == insn)
-        BB_END (bb) = prev;
+          /* Check if we are removing last insn in the BB.  */
+          if (BB_END (bb) == insn)
+            BB_END (bb) = prev;
+        }
 
       /* See sched_analyze to see how these are handled.  */
       if (NOTE_LINE_NUMBER (insn) != NOTE_INSN_EH_REGION_BEG
@@ -1283,7 +1286,7 @@ unlink_line_notes (rtx insn, rtx tail)
 {
   rtx prev = PREV_INSN (insn);
 
-  while (insn != tail && NOTE_P (insn))
+  while (insn != tail && NOTE_NOT_BB_P (insn))
     {
       rtx next = NEXT_INSN (insn);
 
@@ -1297,13 +1300,16 @@ unlink_line_notes (rtx insn, rtx tail)
 	  if (next)
 	    PREV_INSN (next) = prev;
 
-          /* Basic block can begin with either LABEL or
-             NOTE_INSN_BASIC_BLOCK.  */
-          gcc_assert (BB_HEAD (bb) != insn);
-
-          /* Check if we are removing last insn in the BB.  */
-          if (BB_END (bb) == insn)
-            BB_END (bb) = prev;
+          if (bb)
+            {
+              /* Basic block can begin with either LABEL or
+                 NOTE_INSN_BASIC_BLOCK.  */
+              gcc_assert (BB_HEAD (bb) != insn);
+
+              /* Check if we are removing last insn in the BB.  */
+              if (BB_END (bb) == insn)
+                BB_END (bb) = prev;
+            }
 
 	  /* Record line-number notes so they can be reused.  */
 	  LINE_NOTE (insn) = insn;

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