From: Piotr Trojanek Date: Mon, 8 Jun 2020 12:33:08 +0000 (+0200) Subject: [Ada] Simplify detection of others choice with just one value X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e31f60f31da89f3c79b6dd8488a7eff03c689f1b;p=gcc.git [Ada] Simplify detection of others choice with just one value gcc/ada/ * sem_case.adb (Build_Choice): Simplify. --- diff --git a/gcc/ada/sem_case.adb b/gcc/ada/sem_case.adb index 5bb94e26ea6..953619c91e4 100644 --- a/gcc/ada/sem_case.adb +++ b/gcc/ada/sem_case.adb @@ -1012,7 +1012,7 @@ package body Sem_Case is -- If there is only one choice value missing between Value1 and -- Value2, build an integer or enumeration literal to represent it. - if (Value2 - Value1) = 0 then + if Value1 = Value2 then if Is_Integer_Type (Choice_Type) then Lit_Node := Make_Integer_Literal (Loc, Value1); Set_Etype (Lit_Node, Choice_Type);