From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pj1-x102d.google.com (mail-pj1-x102d.google.com [IPv6:2607:f8b0:4864:20::102d]) by sourceware.org (Postfix) with ESMTPS id 00AE8385841C for ; Mon, 29 Nov 2021 15:53:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 00AE8385841C Received: by mail-pj1-x102d.google.com with SMTP id x7so13097197pjn.0 for ; Mon, 29 Nov 2021 07:53:23 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:references:from:in-reply-to :content-transfer-encoding; bh=LXwmoY8PO2HKu20R48iPp56uaY2oSIgtuBdXxqW2LzI=; b=tLNXxrjAKqhRae0YQthJt4FpmDx/L1EHXjoAnNvvp2pxF0Afmzi6yDFcKhj2qfmKwc JGhdduaHqgUnANSw2G9aUtA8uFVULARMyO8NYdTh6NWVbJn5bmT/gv2mA9Kilay3srRN B0KMbRDNoUXHrNwqw+csIenzGfGnTR/XdeTObcFlMSefbO0YZo8yN87yhxSqICSOlwBM Wk0e5Gvrfa1SKqLJ+OpsDgr5/xxCXvZnIoJdWOtNQo5tYGTSkINiXZSGE1heBPeZJigB 7Av7b9oDbgptgVeS165jCiJ4EQ23CeNh39BNmSIYqRyC4cCw6Z3mT44tZsJBk/TJ3hKQ P1Pg== X-Gm-Message-State: AOAM533JVU1kSHAytRpCEROdRMgMwf2mu2kppkiLlrTjGcqO2Ov6nlN2 CVHE4cQVztN6t960uj+Skzw= X-Google-Smtp-Source: ABdhPJxG2j4SYyL47GqsNckf7VEHDI8H/l2u1o4QwBYopFcLo0OK2qNABeZ/WnvXJ8kjKq6NCKLxwA== X-Received: by 2002:a17:90b:3ecc:: with SMTP id rm12mr39400796pjb.75.1638201202946; Mon, 29 Nov 2021 07:53:22 -0800 (PST) Received: from [172.31.0.175] (c-98-202-48-222.hsd1.ut.comcast.net. [98.202.48.222]) by smtp.gmail.com with ESMTPSA id na13sm15579434pjb.11.2021.11.29.07.53.22 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 29 Nov 2021 07:53:22 -0800 (PST) Message-ID: <272e63f4-cf34-a8a7-2c3c-d6a0c5233572@gmail.com> Date: Mon, 29 Nov 2021 08:53:21 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.3.0 Subject: Re: [PATCH] Avoid some -Wunreachable-code-ctrl Content-Language: en-US To: Richard Biener , gcc-patches@gcc.gnu.org References: From: Jeff Law In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 29 Nov 2021 15:53:25 -0000 On 11/29/2021 8:03 AM, Richard Biener via Gcc-patches wrote: > This cleans up unreachable code diagnosed by -Wunreachable-code-ctrl. > It largely follows the previous series but discovers a few extra > cases, namely dead code after break or continue or loops without > exits. > > Bootstrapped on x86_64-unknown-linux-gnu, testing in progress. > > Richard. > > 2021-11-29 Richard Biener > > gcc/c/ > * gimple-parser.c (c_parser_gimple_postfix_expression): > avoid unreachable code after break. > > gcc/ > * cfgrtl.c (skip_insns_after_block): Refactor code to > be more easily readable. > * expr.c (op_by_pieces_d::run): Remove unreachable > assert. > * sched-deps.c (sched_analyze): Remove unreachable > gcc_unreachable. > * sel-sched-ir.c (in_same_ebb_p): Likewise. > * tree-ssa-alias.c (nonoverlapping_refs_since_match_p): > Remove unreachable code. > * tree-vect-slp.c (vectorize_slp_instance_root_stmt): > Refactor to avoid unreachable loop iteration. > * tree.c (walk_tree_1): Remove unreachable break. > * vec-perm-indices.c (vec_perm_indices::series_p): Remove > unreachable return. > > gcc/cp/ > * parser.c (cp_parser_postfix_expression): Remove > unreachable code. > * pt.c (tsubst_expr): Remove unreachable breaks. > > gcc/fortran/ > * frontend-passes.c (gfc_expr_walker): Remove unreachable > break. > * scanner.c (skip_fixed_comments): Remove unreachable > gcc_unreachable. > * trans-expr.c (gfc_expr_is_variable): Refactor to make > control flow more obvious. OK jeff