From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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-Archive: List-Post: List-Help: Sender: gcc-patches-owner@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, 09 Mar 2014 20:35:00 -0000 Message-ID: References: ,<531CA574.2050900@sfr.fr> In-Reply-To: <531CA574.2050900@sfr.fr> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-SW-Source: 2014-03/txt/msg00449.txt.bz2 Comments from Mikael: =20 #1. Please merge the two ifs; it seems they have exactly the same scope after the patch. =20 #2. This comment applies to the TOUPPER thing below... .. so it should be put here. Also the indentation is wrong. =20 #3.This is unnecessary. =20 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D All corrected in the patch below.=20=20 This patch is not very important. If we are in 'regressions fix only' mod= e, 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 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- gcc/gcc/fortran/symbol.c (revision 208437) +++ gcc/gcc/fortran/symbol.c (working copy) @@ -3069,65 +3069,65 @@ =20 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 ||=20 + (p->attr.in_common && !p->old_symbol->attr.in_common )) &&=20 + 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. */ =20 - if (p->common_block->head =3D=3D p && !p->common_next) - { - gfc_symtree st, *st0; - st0 =3D find_common_symtree (p->ns->common_root, - p->common_block); - if (st0) - { - st.name =3D st0->name; - gfc_delete_bbt (&p->ns->common_root, &st, compare_symtree); - free (st0); - } - } + if (p->common_block->head =3D=3D p && !p->common_next) + { + gfc_symtree st, *st0; + st0 =3D find_common_symtree (p->ns->common_root, + p->common_block); + if (st0) + { + st.name =3D st0->name; + gfc_delete_bbt (&p->ns->common_root, &st, compare_symtree); + free (st0); + } + } =20 - if (p->common_block->head =3D=3D p) - p->common_block->head =3D p->common_next; - else - { - gfc_symbol *cparent, *csym; + if (p->common_block->head =3D=3D p) + p->common_block->head =3D p->common_next; + else + { + gfc_symbol *cparent, *csym; =20 - cparent =3D p->common_block->head; - csym =3D cparent->common_next; + cparent =3D p->common_block->head; + csym =3D cparent->common_next; =20 - while (csym !=3D p) - { - cparent =3D csym; - csym =3D csym->common_next; - } + while (csym !=3D p) + { + cparent =3D csym; + csym =3D csym->common_next; + } =20 - gcc_assert(cparent->common_next =3D=3D p); + gcc_assert(cparent->common_next =3D=3D p); + cparent->common_next =3D csym->common_next; + } + } + if (p->gfc_new)=20 + { + /* 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. */ =20 - cparent->common_next =3D csym->common_next; - } - } + if (p->attr.flavor =3D=3D 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); =20 - /* 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 =3D=3D 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); =20