public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [pph] Fix ICE during gimplification (issue4636074)
@ 2011-06-29 21:07 Diego Novillo
  0 siblings, 0 replies; only message in thread
From: Diego Novillo @ 2011-06-29 21:07 UTC (permalink / raw)
  To: reply, crowl, gchare, gcc-patches

This patch fixes an ICE during gimplification.  When reading a
STATEMENT_LIST, we were calling append_to_statement_list, but at
that point some elements in the list do not have side-effects
(the final VAR_DECL in a stmt expression), so we were dropping it
out.

Fixed by force-adding every statetement we read.  This fixes
c1attr-warn-unused-result.cc.

Tested on x86_64.  Committed to branch.


	* pph-streamer-in.c (pph_read_tree): Call
	append_to_statement_list_force instead of append_to_statement_list.

testsuite/ChangeLog.pph

	* g++.dg/pph/c1attr-warn-unused-result.cc: Remove xfail marker.


diff --git a/gcc/cp/ChangeLog.pph b/gcc/cp/ChangeLog.pph
index c2679e6..a62dd66 100644
--- a/gcc/cp/ChangeLog.pph
+++ b/gcc/cp/ChangeLog.pph
@@ -1,3 +1,8 @@
+2011-06-29   Diego Novillo  <dnovillo@google.com>
+
+	* pph-streamer-in.c (pph_read_tree): Call
+	append_to_statement_list_force instead of append_to_statement_list.
+
 2011-06-28   Diego Novillo  <dnovillo@google.com>
 
 	* pph-streamer-in.c (pph_in_ld_fn): Instantiate
diff --git a/gcc/cp/pph-streamer-in.c b/gcc/cp/pph-streamer-in.c
index 1dabcf1..1a59640 100644
--- a/gcc/cp/pph-streamer-in.c
+++ b/gcc/cp/pph-streamer-in.c
@@ -1488,7 +1488,7 @@ pph_read_tree (struct lto_input_block *ib ATTRIBUTE_UNUSED,
         for (i = 0; i < num_trees; i++)
 	  {
 	    tree stmt = pph_in_tree (stream);
-	    append_to_statement_list (stmt, &expr);
+	    append_to_statement_list_force (stmt, &expr);
 	  }
       }
       break;
diff --git a/gcc/testsuite/ChangeLog.pph b/gcc/testsuite/ChangeLog.pph
index 9c33875..aeede51 100644
--- a/gcc/testsuite/ChangeLog.pph
+++ b/gcc/testsuite/ChangeLog.pph
@@ -1,3 +1,7 @@
+2011-06-29  Diego Novillo  <dnovillo@google.com>
+
+	* g++.dg/pph/c1attr-warn-unused-result.cc: Remove xfail marker.
+
 2011-06-28  Diego Novillo  <dnovillo@google.com>
 
 	* g++.dg/pph/c1attr-warn-unused-result.cc: Expect an ICE.
diff --git a/gcc/testsuite/g++.dg/pph/c1attr-warn-unused-result.cc b/gcc/testsuite/g++.dg/pph/c1attr-warn-unused-result.cc
index 4633106..da75561 100644
--- a/gcc/testsuite/g++.dg/pph/c1attr-warn-unused-result.cc
+++ b/gcc/testsuite/g++.dg/pph/c1attr-warn-unused-result.cc
@@ -1,6 +1,3 @@
-/* { dg-xfail-if "ICE" { "*-*-*" } { "-fpph-map=pph.map" } } */
-// { dg-bogus "internal compiler error: Segmentation fault" "" { xfail *-*-* } 0 }
-// { dg-prune-output "In file included from" }
 /* { dg-options "-w" } */
 // pph asm xdiff
 #include "c1attr-warn-unused-result.h"

--
This patch is available for review at http://codereview.appspot.com/4636074

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2011-06-29 20:50 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-29 21:07 [pph] Fix ICE during gimplification (issue4636074) Diego Novillo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).