aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/gcc-interface
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2024-09-10 15:02:19 +0200
committerMarc Poulhiès <dkm@gcc.gnu.org>2024-10-08 10:37:15 +0200
commit409de30d89310ea6ec24b480528c75cb74f8ef85 (patch)
tree0045327b9950ca4d71c492a31ef77714b708a486 /gcc/ada/gcc-interface
parentc4e90a24d0ac36f8daa08ecac127461a7e294d10 (diff)
downloadgcc-409de30d89310ea6ec24b480528c75cb74f8ef85.zip
gcc-409de30d89310ea6ec24b480528c75cb74f8ef85.tar.gz
gcc-409de30d89310ea6ec24b480528c75cb74f8ef85.tar.bz2
ada: Remove -gnateE information message for noncontiguous enumeration type
It is very confusing for the user because it does not make any reference to the source code but only to details of the underlying implementation. gcc/ada/ChangeLog: * gcc-interface/trans.cc (Raise_Error_to_gnu) <CE_Invalid_Data>: Do not the generate range information if the value is a call to a Rep_To_Pos function.
Diffstat (limited to 'gcc/ada/gcc-interface')
-rw-r--r--gcc/ada/gcc-interface/trans.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/ada/gcc-interface/trans.cc b/gcc/ada/gcc-interface/trans.cc
index ebcf2cd..a073b2d 100644
--- a/gcc/ada/gcc-interface/trans.cc
+++ b/gcc/ada/gcc-interface/trans.cc
@@ -6124,7 +6124,12 @@ Raise_Error_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p)
gnu_index = convert (gnu_type, gnu_index);
}
+ /* Do not print the range information for an enumeration type with
+ holes since it is meaningless. */
if (with_extra_info
+ && !(Nkind (gnat_index) == N_Function_Call
+ && Is_Entity_Name (Name (gnat_index))
+ && Is_Rep_To_Pos (Entity (Name (gnat_index))))
&& Known_Esize (gnat_type)
&& UI_To_Int (Esize (gnat_type)) <= 32)
gnu_result