]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR rtl-optimization/50212 (ICE: in ei_container, at basic-block.h:610 with -fnon...
authorJakub Jelinek <jakub@redhat.com>
Mon, 12 Sep 2011 17:55:36 +0000 (19:55 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Mon, 12 Sep 2011 17:55:36 +0000 (19:55 +0200)
PR rtl-optimization/50212
* bb-reorder.c (find_rarely_executed_basic_blocks_and_crossing_edges):
Skip also lps with NULL landing_pad or non-LABEL_P landing_pad.

* g++.dg/other/pr50212.C: New test.

From-SVN: r178785

gcc/ChangeLog
gcc/bb-reorder.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/other/pr50212.C [new file with mode: 0644]

index a8bc80ad66ce0d77c0b6d30a7b944a9b045862b7..311cb8d5496acd1715ea4a735763578d281c1f88 100644 (file)
@@ -1,5 +1,9 @@
 2011-09-12  Jakub Jelinek  <jakub@redhat.com>
 
+       PR rtl-optimization/50212
+       * bb-reorder.c (find_rarely_executed_basic_blocks_and_crossing_edges):
+       Skip also lps with NULL landing_pad or non-LABEL_P landing_pad.
+
        PR debug/50299
        * calls.c (load_register_parameters): Use use_reg_mode instead
        of use_reg when adding a single register CALL_INSN_FUNCTION_USAGE
index 874ece2a9adad8efb2b5eb27b6f583d8907fa783..3ac7fbd6034d81858f54d052dbf38f57b4904e8e 100644 (file)
@@ -1,5 +1,5 @@
 /* Basic block reordering routines for the GNU compiler.
-   Copyright (C) 2000, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2010
+   Copyright (C) 2000, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2010, 2011
    Free Software Foundation, Inc.
 
    This file is part of GCC.
@@ -1315,7 +1315,9 @@ find_rarely_executed_basic_blocks_and_crossing_edges (void)
        {
          bool all_same, all_diff;
 
-         if (lp == NULL)
+         if (lp == NULL
+             || lp->landing_pad == NULL_RTX
+             || !LABEL_P (lp->landing_pad))
            continue;
 
          all_same = all_diff = true;
index 57c8209f41e314f321f34758b0f4a54646d107a4..4fa122cf0e8c5ad3096623a0420c62856a79e0f5 100644 (file)
@@ -1,3 +1,8 @@
+2011-09-12  Jakub Jelinek  <jakub@redhat.com>
+
+       PR rtl-optimization/50212
+       * g++.dg/other/pr50212.C: New test.
+
 2011-09-12  Georg-Johann Lay  <avr@gjlay.de>
 
        PR target/43746
diff --git a/gcc/testsuite/g++.dg/other/pr50212.C b/gcc/testsuite/g++.dg/other/pr50212.C
new file mode 100644 (file)
index 0000000..c0b030d
--- /dev/null
@@ -0,0 +1,17 @@
+// PR rtl-optimization/50212
+// { dg-do compile }
+// { dg-require-effective-target freorder }
+// { dg-options "-O -fnon-call-exceptions -ftrapv -freorder-blocks-and-partition" }
+
+void
+foo (int n)
+{
+  try
+  {
+    int i = 0;
+    while (i++ < n);
+  }
+  catch (...)
+  {
+  }
+}