From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qt1-x834.google.com (mail-qt1-x834.google.com [IPv6:2607:f8b0:4864:20::834]) by sourceware.org (Postfix) with ESMTPS id B282F3858437 for ; Tue, 11 Oct 2022 02:01:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B282F3858437 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-qt1-x834.google.com with SMTP id bb5so2169543qtb.11 for ; Mon, 10 Oct 2022 19:01:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=Zl9d5XcF/hj7Sa1tvoE9ZjEiOOKfnNlf47bKQ94JZTk=; b=Yt72owhmTyr1tqrSc2pdy41gfy6aiedGXIQO8yaOe8d9KmSwluwNGTSIV3HkufPBPV HMu2PHn+hZsD9h9fS4h8qP1wAEyAVR1xzOSU+IpoCpyNRY4ksXCELeK7C5m7Mxpi7+cc jLBsg8h4Yb25vDEIBPCbhyq6tAuHFYWVIipcfWCLyXWMK6IoatN5q+AW8LJOD3mBen+R zdHDRhSHOSIr2gfg4hprWM5HrCHi+QHKV/eSDr3zmzm+7GuwZcQoQKxA9Y/4n8c0VuKD Nx20Sq4ZanPoeocXu6/ne3MOHf0qHn6SKtBKR5XX/7n1N7SAiTDb4nxsfLhpPLt/gPqX DPZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Zl9d5XcF/hj7Sa1tvoE9ZjEiOOKfnNlf47bKQ94JZTk=; b=biBNMvn5UN3W+JhGLtMY+1AxLa8SxmP9sA4p0pjcEdEn1+oyXsP7wZBCwCuu+5uLaj lqC7z2DVxT7iTMtWlHPgJo04ifCAmtvbnnY1e7nvk7uQbmGOMD6hSmi3dfDkO+gSfDfo AYSsKmRhNJx2YOLsRONBKKvWJ/m4A8mbcDMYb98PH+86SZvtAh6TJWlREPxnG5J5iJPj 7Rc410ouvstnFo/LPYWOaA95xvRSp/4jz4xLe6qsnAb/eWGLjPauK26tDw3IcV+SfVb+ qNz5sMuZM/oDkpZUdxFYuY/W/IJpFyMajtBGjjtE+kC1wkF1GboHNNX/gUXaf736Q3AX lH1Q== X-Gm-Message-State: ACrzQf2byyFr8ipHVL3iHEo6nWXpQ8jhPK6tcxLwZ7qmD8qgnhf8NUEp BYvGfEBcmuhL09BCjqWK2WYYcQQl7m7C7McZsEg= X-Google-Smtp-Source: AMsMyM6FvA1Nefd7VrE5I0wLxFiql2cck5mbONAXG+ZPm3Crrw9hG3ycRC6hRv5Oy42TthgFHaLoCJwwH0oSKO9KyTY= X-Received: by 2002:a05:622a:134b:b0:39a:4442:cbb6 with SMTP id w11-20020a05622a134b00b0039a4442cbb6mr6444240qtk.500.1665453707010; Mon, 10 Oct 2022 19:01:47 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: "H.J. Lu" Date: Mon, 10 Oct 2022 19:01:11 -0700 Message-ID: Subject: Re: [PATCH][ICE] Fix for PR107193. To: Eugene Rozenfeld Cc: "gcc-patches@gcc.gnu.org" , Jason Merrill Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-3024.3 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Mon, Oct 10, 2022 at 5:37 PM Eugene Rozenfeld wrote: > > The bug was introduced in f30e9fd33e56a5a721346ea6140722e1b193db42. > A variable (cur_locus_e) was incorrectly declared inside a loop. > I also moved two other declarations (last and locus) down to make > the code more clear. > > Tested on x86_64-pc-linux-gnu. > > gcc/ChangeLog: > PR debug/107193 > * tree-cfg.cc (assign_discriminators): Move declaration of cur_locus_e > out of the loop. > --- > gcc/tree-cfg.cc | 7 ++++--- > 1 file changed, 4 insertions(+), 3 deletions(-) > > diff --git a/gcc/tree-cfg.cc b/gcc/tree-cfg.cc > index 41f2925665f..ae781871a19 100644 > --- a/gcc/tree-cfg.cc > +++ b/gcc/tree-cfg.cc > @@ -1204,9 +1204,8 @@ assign_discriminators (void) > edge e; > edge_iterator ei; > gimple_stmt_iterator gsi; > - gimple *last = last_stmt (bb); > - location_t locus = last ? gimple_location (last) : UNKNOWN_LOCATION; > location_t curr_locus = UNKNOWN_LOCATION; > + expanded_location curr_locus_e = {}; > int curr_discr = 0; > > /* Traverse the basic block, if two function calls within a basic block > @@ -1215,7 +1214,7 @@ assign_discriminators (void) > for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi)) > { > gimple *stmt = gsi_stmt (gsi); > - expanded_location curr_locus_e; > + > if (curr_locus == UNKNOWN_LOCATION) > { > curr_locus = gimple_location (stmt); > @@ -1238,6 +1237,8 @@ assign_discriminators (void) > curr_discr = next_discriminator_for_locus (curr_locus); > } > > + gimple *last = last_stmt (bb); > + location_t locus = last ? gimple_location (last) : UNKNOWN_LOCATION; > if (locus == UNKNOWN_LOCATION) > continue; > > -- > 2.25.1 > It restored bootstrap for me. Thanks. -- H.J.