From 7e2fe9d8a171c50b39b985fb0f9d9721f4f42656 Mon Sep 17 00:00:00 2001 From: Andrew Pinski Date: Sat, 20 May 2006 22:35:02 +0000 Subject: [PATCH] re PR middle-end/25776 (ICE in cgraph after error at -O1 and above) 2006-05-20 Andrew Pinski PR middle-end/25776 * cgraphunit.c (cgraph_optimize): Don't run ipa passes if error or sorry count is non zero. 2006-05-20 Andrew Pinski PR middle-end/25776 * g++.dg/other/error11.C: New test. From-SVN: r113941 --- gcc/ChangeLog | 6 ++++++ gcc/cgraphunit.c | 6 +++++- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/g++.dg/other/error11.C | 17 +++++++++++++++++ 4 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/g++.dg/other/error11.C diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 7deb475d038..f05e632982e 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2006-05-20 Andrew Pinski + + PR middle-end/25776 + * cgraphunit.c (cgraph_optimize): Don't run ipa passes if error + or sorry count is non zero. + 2006-05-20 Andreas Schwab * config/pa/pa-linux.h (STRING_ASM_OP): Prepend and append a tab. diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c index 5ff4fffa854..44b3d4f05d4 100644 --- a/gcc/cgraphunit.c +++ b/gcc/cgraphunit.c @@ -1410,7 +1410,11 @@ cgraph_optimize (void) fprintf (cgraph_dump_file, "Marked "); dump_cgraph (cgraph_dump_file); } - ipa_passes (); + + /* Don't run the IPA passes if there was any error or sorry messages. */ + if (errorcount == 0 && sorrycount == 0) + ipa_passes (); + /* This pass remove bodies of extern inline functions we never inlined. Do this later so other IPA passes see what is really going on. */ cgraph_remove_unreachable_nodes (false, dump_file); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 10b3a7d2375..d558ee28521 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2006-05-20 Andrew Pinski + + PR middle-end/25776 + * g++.dg/other/error11.C: New test. + 2006-05-20 Richard Sandiford * gcc.target/mips/pr26765.c: Add -w to options. diff --git a/gcc/testsuite/g++.dg/other/error11.C b/gcc/testsuite/g++.dg/other/error11.C new file mode 100644 index 00000000000..d8a641c2b4e --- /dev/null +++ b/gcc/testsuite/g++.dg/other/error11.C @@ -0,0 +1,17 @@ +/* { dg-options "-O1" } */ +struct A +{ + ERROR; /* { dg-error "ERROR" } */ + ~A(); +}; + +struct B +{ + virtual ~B(); +}; + +struct C : B, A {}; + +struct D : C {}; + +D d; -- 2.30.2