From patchwork Fri Jul 30 17:06:07 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mikael Morin X-Patchwork-Id: 60370 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 28783B70BB for ; Sat, 31 Jul 2010 03:07:09 +1000 (EST) Received: (qmail 22738 invoked by alias); 30 Jul 2010 17:07:03 -0000 Received: (qmail 22509 invoked by uid 22791); 30 Jul 2010 17:07:01 -0000 X-SWARE-Spam-Status: No, hits=0.1 required=5.0 tests=AWL, BAYES_05, RCVD_IN_DNSWL_NONE, SPF_NEUTRAL, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from smtp21.services.sfr.fr (HELO smtp21.services.sfr.fr) (93.17.128.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 30 Jul 2010 17:06:28 +0000 Received: from filter.sfr.fr (localhost [127.0.0.1]) by msfrf2102.sfr.fr (SMTP Server) with ESMTP id 948297000096; Fri, 30 Jul 2010 19:06:26 +0200 (CEST) Received: from gimli.local (236.15.72-86.rev.gaoland.net [86.72.15.236]) by msfrf2102.sfr.fr (SMTP Server) with ESMTP id 5D28E7000095; Fri, 30 Jul 2010 19:06:26 +0200 (CEST) X-SFR-UUID: 20100730170626381.5D28E7000095@msfrf2102.sfr.fr Message-ID: <4C53067F.8060202@sfr.fr> Date: Fri, 30 Jul 2010 19:06:07 +0200 From: Mikael Morin User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; fr-FR; rv:1.9.1.11) Gecko/20100725 Thunderbird/3.0.6 MIME-Version: 1.0 To: "fortran@gcc.gnu.org" , gcc-patches Subject: [patch, fortran] PR42051 take 2 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 Hello, I was a bit dissatisfied by the fact that the testcase committed with the PR42051 fix may well not trigger in the case of the regression. This patch adds a sanity check to make it trigger. I will commit under the obvious rule once regression test is done. Mikael. 2010-07-30 Mikael Morin * symbol.c (changed_syms): Made non-static. * parse.c (changed_syms): declare (next_statement): Assert changed_syms is NULL at the beginning. Index: symbol.c =================================================================== --- symbol.c (revision 162719) +++ symbol.c (working copy) @@ -98,7 +98,7 @@ gfc_namespace *gfc_global_ns_list; gfc_gsymbol *gfc_gsym_root = NULL; -static gfc_symbol *changed_syms = NULL; +gfc_symbol *changed_syms = NULL; gfc_dt_list *gfc_derived_types; Index: parse.c =================================================================== --- parse.c (revision 162719) +++ parse.c (working copy) @@ -879,6 +879,7 @@ blank_line: return ST_NONE; } +extern gfc_symbol *changed_syms; /* Return the next non-ST_NONE statement to the caller. We also worry about including files and the ends of include files at this stage. */ @@ -889,6 +890,9 @@ next_statement (void) gfc_statement st; locus old_locus; + /* We start with a clean state. */ + gcc_assert (changed_syms == NULL); + gfc_new_block = NULL; gfc_current_ns->old_cl_list = gfc_current_ns->cl_list;