From patchwork Wed Nov 14 11:45:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierre-Marie de Rodat X-Patchwork-Id: 997645 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-490016-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=adacore.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="yEHBA9Gq"; dkim-atps=neutral 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 42w2nF64jWz9s3q for ; Wed, 14 Nov 2018 22:48:16 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:message-id:mime-version:content-type; q=dns; s=default; b=sbc8tmZhvJGuk5UC7SS0Q1b4hqD4KSkfQuiuzjWcE4kByrQMVf 9Rq3Q1XSS4R1y+E7PaS1dNExPUDNm44pSvCIPC9+SuDqT1UAJzj6hvsTh4lveDSn yXGu59M0k1O12UBCL3m4yryJXynhkVWma2H0MrNooRLQ16icRmp/eqMRM= 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:date :from:to:cc:subject:message-id:mime-version:content-type; s= default; bh=ICmduIdxAwC3CiOpOQiyK3wIgq0=; b=yEHBA9GqoZxvZW0sCnS/ 11CyEx96s4A/onDBViBNJYMloabba/CbKo2yH0Pf762rck4aInWuA+cJ06Xfr2Zz 40MizElodyxNkiFtpRwylgbhuJG/qUChdhiT9aabUTs915Ej/r+X6OvirtzYml8C vf9V43UW8CyYwYwhP7UgLsw= Received: (qmail 57364 invoked by alias); 14 Nov 2018 11:45:47 -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 56959 invoked by uid 89); 14 Nov 2018 11:45:43 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-11.9 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=established, wherever, flattening X-HELO: rock.gnat.com Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 14 Nov 2018 11:45:38 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 2B0F15615B; Wed, 14 Nov 2018 06:45:35 -0500 (EST) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id E9iGdZ-aMWys; Wed, 14 Nov 2018 06:45:35 -0500 (EST) Received: from tron.gnat.com (tron.gnat.com [205.232.38.10]) by rock.gnat.com (Postfix) with ESMTP id 1805D5615A; Wed, 14 Nov 2018 06:45:35 -0500 (EST) Received: by tron.gnat.com (Postfix, from userid 4862) id 171A5353A; Wed, 14 Nov 2018 06:45:35 -0500 (EST) Date: Wed, 14 Nov 2018 06:45:35 -0500 From: Pierre-Marie de Rodat To: gcc-patches@gcc.gnu.org Cc: Eric Botcazou Subject: [Ada] Remove couple of recently added dead tests Message-ID: <20181114114535.GA74477@adacore.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) X-IsSubscribed: yes N_Quantified_Expression and N_Iterated_Component_Association are unrelated nodes that cannot appear in the same context: the former can appear wherever an expression node is acceptable whereas the latter can appear only as an element of a component association list. So a test combining both most likely contains a dead arm and this change removes a couple of them. No functional changes. Tested on x86_64-pc-linux-gnu, committed on trunk 2018-11-14 Eric Botcazou gcc/ada/ * exp_aggr.adb (Check_Static_Components): Remove dead test. (Flatten): Likewise. Move comment around. --- gcc/ada/exp_aggr.adb +++ gcc/ada/exp_aggr.adb @@ -4367,8 +4367,7 @@ package body Exp_Aggr is elsif Nkind (Expression (Expr)) /= N_Aggregate or else not Compile_Time_Known_Aggregate (Expression (Expr)) or else Expansion_Delayed (Expression (Expr)) - or else Nkind_In (Expr, N_Iterated_Component_Association, - N_Quantified_Expression) + or else Nkind (Expr) = N_Iterated_Component_Association then Static_Components := False; exit; @@ -4521,16 +4520,15 @@ package body Exp_Aggr is -- If we have an others choice, fill in the missing elements -- subject to the limit established by Max_Others_Replicate. - -- If the expression involves a construct that generates - -- a loop, we must generate individual assignments and - -- no flattening is possible. if Nkind (Choice) = N_Others_Choice then Rep_Count := 0; - if Nkind_In (Expression (Elmt), - N_Iterated_Component_Association, - N_Quantified_Expression) + -- If the expression involves a construct that generates + -- a loop, we must generate individual assignments and + -- no flattening is possible. + + if Nkind (Expression (Elmt)) = N_Quantified_Expression then return False; end if;