From patchwork Sun Mar 9 19:47:30 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: jimmie.davis@l-3com.com X-Patchwork-Id: 328389 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]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 26A7E2C00D0 for ; Mon, 10 Mar 2014 06:48:08 +1100 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:references:in-reply-to:content-type :content-transfer-encoding:mime-version; q=dns; s=default; b=HdR XhqJ9cXzNsuGj/qWBuaw2Az+T+uVJOwSzGjThcJ35yOSRMQz8r3+Q9NDOBhWZJF/ 2ZAa1G1jJN8wKehxFsc0ilq4wbvZPhdbWMX7nfTBkmLgWzoYAlMOBQ67RykQ9Wq3 3J7XjMBtB2OHs1YTFVCKHtLa+tQLpL3tj3AW3IeY= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:references:in-reply-to:content-type :content-transfer-encoding:mime-version; s=default; bh=w2Yph049e ZUDpSGPRTI2pXYI9UA=; b=pM4rvP/auMLfNL+RBR3+9GcGMc1QQPSkF0dMkN8/l V1F7XsQu0VD879ma9IqaR2eoTDFqQlwCM61J31nCStDifNOAlrxVkAGutM+jmnmk JRenafmogJg39umPmt8Z/mzKT4+rh671FoKDFmY+Tai9Ns1plk8NaqxHD5KgyD0i ew= Received: (qmail 8513 invoked by alias); 9 Mar 2014 19:47:56 -0000 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 Received: (qmail 8494 invoked by uid 89); 9 Mar 2014 19:47:55 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.5 required=5.0 tests=AWL, BAYES_00, SPF_PASS, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-Spam-User: qpsmtpd, 2 recipients X-HELO: smtp2out.l-3com.com Received: from smtp2out.l-3com.com (HELO smtp2out.l-3com.com) (166.20.51.112) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 09 Mar 2014 19:47:54 +0000 X-filenames: X-filesizes: None X-filetypes: Received: from generichost.l-3com.com (HELO mail1.link.l-3com.com) ([130.210.100.25]) by smtp2out.l-3com.com with ESMTP; 09 Mar 2014 19:47:52 +0000 Received: from arlexchcas02.lst.link.l-3com.com ([130.210.91.128]) by mail1a.link.l-3com.com with ESMTP; 09 Mar 2014 14:47:52 -0500 Received: from ARLEXCHMBX01.lst.link.l-3com.com ([::1]) by ARLEXCHCAS02.lst.link.l-3com.com ([::1]) with mapi id 14.02.0347.000; Sun, 9 Mar 2014 14:47:31 -0500 From: To: , , Subject: RE: patch fortran, pr 59746, internal compiler error : segmentation fault Date: Sun, 9 Mar 2014 19:47:30 +0000 Message-ID: References: , <531CA574.2050900@sfr.fr> In-Reply-To: <531CA574.2050900@sfr.fr> MIME-Version: 1.0 Comments from Mikael: #1. Please merge the two ifs; it seems they have exactly the same scope after the patch. #2. This comment applies to the TOUPPER thing below... .. so it should be put here. Also the indentation is wrong. #3.This is unnecessary. =========================== All corrected in the patch below. This patch is not very important. If we are in 'regressions fix only' mode, then this needs to sit until stage 1 happens....It is not worth any kind of breakage. Reran the testsuite. No new failures. regards, Bud Davis Index: gcc/gcc/fortran/symbol.c =================================================================== --- gcc/gcc/fortran/symbol.c (revision 208437) +++ gcc/gcc/fortran/symbol.c (working copy) @@ -3069,65 +3069,65 @@ FOR_EACH_VEC_ELT (latest_undo_chgset->syms, i, p) { - if (p->gfc_new) - { - /* Symbol was new. */ - if (p->attr.in_common && p->common_block && p->common_block->head) - { - /* If the symbol was added to any common block, it - needs to be removed to stop the resolver looking - for a (possibly) dead symbol. */ + /* Symbol was new. Or was old and just put in common */ + if ((p->gfc_new || + (p->attr.in_common && !p->old_symbol->attr.in_common )) && + p->attr.in_common && p->common_block && p->common_block->head) + { + /* If the symbol was added to any common block, it + needs to be removed to stop the resolver looking + for a (possibly) dead symbol. */ - if (p->common_block->head == p && !p->common_next) - { - gfc_symtree st, *st0; - st0 = find_common_symtree (p->ns->common_root, - p->common_block); - if (st0) - { - st.name = st0->name; - gfc_delete_bbt (&p->ns->common_root, &st, compare_symtree); - free (st0); - } - } + if (p->common_block->head == p && !p->common_next) + { + gfc_symtree st, *st0; + st0 = find_common_symtree (p->ns->common_root, + p->common_block); + if (st0) + { + st.name = st0->name; + gfc_delete_bbt (&p->ns->common_root, &st, compare_symtree); + free (st0); + } + } - if (p->common_block->head == p) - p->common_block->head = p->common_next; - else - { - gfc_symbol *cparent, *csym; + if (p->common_block->head == p) + p->common_block->head = p->common_next; + else + { + gfc_symbol *cparent, *csym; - cparent = p->common_block->head; - csym = cparent->common_next; + cparent = p->common_block->head; + csym = cparent->common_next; - while (csym != p) - { - cparent = csym; - csym = csym->common_next; - } + while (csym != p) + { + cparent = csym; + csym = csym->common_next; + } - gcc_assert(cparent->common_next == p); + gcc_assert(cparent->common_next == p); + cparent->common_next = csym->common_next; + } + } + if (p->gfc_new) + { + /* The derived type is saved in the symtree with the first + letter capitalized; the all lower-case version to the + derived type contains its associated generic function. */ - cparent->common_next = csym->common_next; - } - } + if (p->attr.flavor == FL_DERIVED) + gfc_delete_symtree (&p->ns->sym_root, gfc_get_string ("%c%s", + (char) TOUPPER ((unsigned char) p->name[0]), + &p->name[1])); + else + gfc_delete_symtree (&p->ns->sym_root, p->name); - /* The derived type is saved in the symtree with the first - letter capitalized; the all lower-case version to the - derived type contains its associated generic function. */ - if (p->attr.flavor == FL_DERIVED) - gfc_delete_symtree (&p->ns->sym_root, gfc_get_string ("%c%s", - (char) TOUPPER ((unsigned char) p->name[0]), - &p->name[1])); - else - gfc_delete_symtree (&p->ns->sym_root, p->name); - - gfc_release_symbol (p); - } - else - restore_old_symbol (p); + gfc_release_symbol (p); + } + else + restore_old_symbol (p); } - latest_undo_chgset->syms.truncate (0); latest_undo_chgset->tbps.truncate (0);