From patchwork Wed Jun 29 20:50:04 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Diego Novillo X-Patchwork-Id: 102662 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 6B548B6F59 for ; Thu, 30 Jun 2011 06:50:28 +1000 (EST) Received: (qmail 2792 invoked by alias); 29 Jun 2011 20:50:25 -0000 Received: (qmail 2782 invoked by uid 22791); 29 Jun 2011 20:50:24 -0000 X-SWARE-Spam-Status: No, hits=-1.3 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, SARE_OBFU_PART_CIA, SPF_HELO_PASS, TW_TM, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (74.125.121.67) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 29 Jun 2011 20:50:08 +0000 Received: from hpaq14.eem.corp.google.com (hpaq14.eem.corp.google.com [172.25.149.14]) by smtp-out.google.com with ESMTP id p5TKo6w1023633; Wed, 29 Jun 2011 13:50:06 -0700 Received: from topo.tor.corp.google.com (topo.tor.corp.google.com [172.29.41.2]) by hpaq14.eem.corp.google.com with ESMTP id p5TKo430023578; Wed, 29 Jun 2011 13:50:05 -0700 Received: by topo.tor.corp.google.com (Postfix, from userid 54752) id 48D7C1DA1C6; Wed, 29 Jun 2011 16:50:04 -0400 (EDT) To: reply@codereview.appspotmail.com, crowl@google.com, gchare@google.com, gcc-patches@gcc.gnu.org Subject: [pph] Fix ICE during gimplification (issue4636074) Message-Id: <20110629205004.48D7C1DA1C6@topo.tor.corp.google.com> Date: Wed, 29 Jun 2011 16:50:04 -0400 (EDT) From: dnovillo@google.com (Diego Novillo) X-System-Of-Record: true X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org 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. --- This patch is available for review at http://codereview.appspot.com/4636074 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 + + * pph-streamer-in.c (pph_read_tree): Call + append_to_statement_list_force instead of append_to_statement_list. + 2011-06-28 Diego Novillo * 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 + + * g++.dg/pph/c1attr-warn-unused-result.cc: Remove xfail marker. + 2011-06-28 Diego Novillo * 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"