* [Ada] Remove couple of recently added dead tests
@ 2018-11-14 11:45 Pierre-Marie de Rodat
0 siblings, 0 replies; only message in thread
From: Pierre-Marie de Rodat @ 2018-11-14 11:45 UTC (permalink / raw)
To: gcc-patches; +Cc: Eric Botcazou
[-- Attachment #1: Type: text/plain, Size: 609 bytes --]
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 <ebotcazou@adacore.com>
gcc/ada/
* exp_aggr.adb (Check_Static_Components): Remove dead test.
(Flatten): Likewise. Move comment around.
[-- Attachment #2: patch.diff --]
[-- Type: text/x-diff, Size: 1700 bytes --]
--- 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;
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2018-11-14 11:45 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-14 11:45 [Ada] Remove couple of recently added dead tests Pierre-Marie de Rodat
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).