From patchwork Wed Apr 6 12:18:46 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alan Modra X-Patchwork-Id: 90017 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 734B1B6EFF for ; Wed, 6 Apr 2011 22:19:07 +1000 (EST) Received: (qmail 16174 invoked by alias); 6 Apr 2011 12:19:05 -0000 Received: (qmail 16161 invoked by uid 22791); 6 Apr 2011 12:19:04 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL, BAYES_00, DECEASED_NO_ML, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, TW_CP, T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: sourceware.org Received: from mail-iw0-f175.google.com (HELO mail-iw0-f175.google.com) (209.85.214.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 06 Apr 2011 12:18:53 +0000 Received: by iwn10 with SMTP id 10so2095345iwn.20 for ; Wed, 06 Apr 2011 05:18:52 -0700 (PDT) Received: by 10.231.215.3 with SMTP id hc3mr873871ibb.156.1302092332577; Wed, 06 Apr 2011 05:18:52 -0700 (PDT) Received: from bubble.grove.modra.org ([115.187.252.19]) by mx.google.com with ESMTPS id i20sm398162iby.14.2011.04.06.05.18.50 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 06 Apr 2011 05:18:52 -0700 (PDT) Received: by bubble.grove.modra.org (Postfix, from userid 1000) id 06ECD170C1A4; Wed, 6 Apr 2011 21:48:47 +0930 (CST) Date: Wed, 6 Apr 2011 21:48:46 +0930 From: Alan Modra To: gcc-patches@gcc.gnu.org Cc: David Edelsohn Subject: Fix powerpc rs6000_stack_info ICE Message-ID: <20110406121846.GR19002@bubble.grove.modra.org> Mail-Followup-To: gcc-patches@gcc.gnu.org, David Edelsohn MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) 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 The ENABLE_CHECKING tests I added at the end of rs6000_stack_info are now asserting on gcc.c-torture/execute/20041011-1.c and other testcases. The cause is the late running DSE pass removing a set of LR, which means lr_save_p changes. Why that happens ultimately goes back to a register allocation decision to use LR after running out of gprs, which isn't that bright in this case since there is just one set and one use of LR and you need a gpr free to move values to and from LR. Anyway, the fact remains that the stack info can change legitimately and harmlessly after we've emitted the function prologue and epilogue. So this patch simply removes the ENABLE_CHECKING code. Bootstrapped and regtested powerpc64-linux. OK for mainline? * config/rs6000/rs6000.c (rs6000_stack_info): Don't compare against previous stack info. Index: gcc/config/rs6000/rs6000.c =================================================================== --- gcc/config/rs6000/rs6000.c (revision 171817) +++ gcc/config/rs6000/rs6000.c (working copy) @@ -18774,9 +18776,6 @@ rs6000_savres_strategy (rs6000_stack_t * static rs6000_stack_t * rs6000_stack_info (void) { -#ifdef ENABLE_CHECKING - static rs6000_stack_t info_save; -#endif rs6000_stack_t *info_ptr = &stack_info; int reg_size = TARGET_32BIT ? 4 : 8; int ehrd_size; @@ -18785,14 +18784,10 @@ rs6000_stack_info (void) HOST_WIDE_INT non_fixed_size; bool using_static_chain_p; -#ifdef ENABLE_CHECKING - memcpy (&info_save, &stack_info, sizeof stack_info); -#else if (reload_completed && info_ptr->reload_completed) return info_ptr; -#endif - memset (&stack_info, 0, sizeof (stack_info)); + memset (info_ptr, 0, sizeof (*info_ptr)); info_ptr->reload_completed = reload_completed; if (TARGET_SPE) @@ -19096,10 +19091,6 @@ rs6000_stack_info (void) if (! info_ptr->cr_save_p) info_ptr->cr_save_offset = 0; -#ifdef ENABLE_CHECKING - gcc_assert (!(reload_completed && info_save.reload_completed) - || memcmp (&info_save, &stack_info, sizeof stack_info) == 0); -#endif return info_ptr; }