From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 69BC23857B9B for ; Tue, 11 Oct 2022 03:09:20 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 69BC23857B9B Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1665457760; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=qQeoOJrRNEBF7R5A/Kv8LKEQKP7/Bci6xuyqTm9hJUE=; b=LO0dl4dVfbRMen/M9v637fNHqNI8dH7gEgp26+C88LvREns9NR6edEo90eCFUiZPTE3xh2 LQ5EBcd0Uvjy/iXhB6tw9fJd31VUfHddx240AyBgrZQJb9Iff1NZTTnKIM9kP4VfIpe3+6 BF03zO1z3JF6JO/RgcUstKMfNBfvmJw= Received: from mail-qv1-f69.google.com (mail-qv1-f69.google.com [209.85.219.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-651-_5b6nA4RNiGf-UIyKr9M9A-1; Mon, 10 Oct 2022 23:09:19 -0400 X-MC-Unique: _5b6nA4RNiGf-UIyKr9M9A-1 Received: by mail-qv1-f69.google.com with SMTP id dn14-20020a056214094e00b004b1a231394eso7281464qvb.13 for ; Mon, 10 Oct 2022 20:09:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=qQeoOJrRNEBF7R5A/Kv8LKEQKP7/Bci6xuyqTm9hJUE=; b=Qjh3piJv0Vpxpu2bz5/zi6fwakpxXBBGWvMV1kG0Upcvfl0GBD84++FmN0JFiACg8Z AsKAkvGySY6SsPg3xMTfqgL1MZ9akg7+Bl/JWBKxll2Ex7OOpektrFuNs0pjrCeQtzgp vy1hY8ocMd0URdGzZD456E4QdIhB1VzDOY6DeR8p5nHNCQb1SCUiOyEQwE+2SWYG8/pu U9LV7gCYdbyYz6d6zxTpE3h2bjZXwDJpF2zORhm6VEp9WPR611dNFvTFDLap3b5nLj0m 2nntV6zLC2DA86O1uOi56NdxQ/631gsqrO32ObStWPQga5SwHqAvbYJCKYBR6dPMcz+N JNew== X-Gm-Message-State: ACrzQf19NrQA6rlvHRjKdkUbRolJOV3yk2Ql96COOGbp6YZbfO3uzU2f BSV0CAr3CdnzVnpFgIr4A9kto9jeIJNJbPK3Xwryu/7cZuw7jwmEMldw6VoBz8SKLzzFpgT5HEN IT5rkRc01BZAg/3mH4w== X-Received: by 2002:a05:622a:4cb:b0:388:aaf0:62bd with SMTP id q11-20020a05622a04cb00b00388aaf062bdmr17545235qtx.337.1665457749754; Mon, 10 Oct 2022 20:09:09 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6p2mIx6F1tIEpuY8MmLBIkcjDxSB6NtZTXR/zushIF59WM8tnj5Z2lhy6U9OX3bXuPkp3PBQ== X-Received: by 2002:a05:622a:4cb:b0:388:aaf0:62bd with SMTP id q11-20020a05622a04cb00b00388aaf062bdmr17545225qtx.337.1665457749465; Mon, 10 Oct 2022 20:09:09 -0700 (PDT) Received: from [192.168.1.101] (130-44-159-43.s15913.c3-0.arl-cbr1.sbo-arl.ma.cable.rcncustomer.com. [130.44.159.43]) by smtp.gmail.com with ESMTPSA id t28-20020a37ea1c000000b006cdd0939ffbsm11876330qkj.86.2022.10.10.20.09.08 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 10 Oct 2022 20:09:09 -0700 (PDT) Message-ID: <623ccf3a-9835-7200-97a1-2c5a001b25e4@redhat.com> Date: Mon, 10 Oct 2022 23:09:07 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.3.2 Subject: Re: [PATCH][ICE] Fix for PR107193. To: Eugene Rozenfeld , "gcc-patches@gcc.gnu.org" , "hjl.tools@gmail.com" References: From: Jason Merrill In-Reply-To: X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-14.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,NICE_REPLY_A,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_NONE,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 10/10/22 20:36, 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. OK. > 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; >