diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2021-02-08 11:24:56 +0000 |
---|---|---|
committer | Pierre-Marie de Rodat <derodat@adacore.com> | 2021-05-07 05:29:17 -0400 |
commit | 17ba0ad5294f51c15dcf1e1a176b6f15d71e905e (patch) | |
tree | 26257f4fa781d284ca13b493395332347f0b3fd1 /gcc/ada/gcc-interface/decl.c | |
parent | d40dc31924972f90cef920a8f76b3042aefc065d (diff) | |
download | gcc-17ba0ad5294f51c15dcf1e1a176b6f15d71e905e.zip gcc-17ba0ad5294f51c15dcf1e1a176b6f15d71e905e.tar.gz gcc-17ba0ad5294f51c15dcf1e1a176b6f15d71e905e.tar.bz2 |
[Ada] Fix type mismatch warnings during LTO bootstrap #6
gcc/ada/
* gcc-interface/gigi.h (enum standard_datatype): Remove
ADT_exception_data_name_id and add ADT_not_handled_by_others_name_id.
(exception_data_name_id): Delete.
(not_handled_by_others_name_id): New macro.
* gcc-interface/decl.c (gnat_to_gnu_entity) <E_Exception>: Remove old
kludge for exceptions.
<E_Record_Type>: Likewise.
(gnat_to_gnu_field): Force character type on Not_Handled_By_Others.
* gcc-interface/misc.c (gnat_argv): Change type to char **.
(gnat_init_options): Adjust accordingly.
* gcc-interface/trans.c (gigi): Set not_handled_by_others_name_id
and use it to set not_handled_by_others_decl.
(Exception_Handler_to_gnu_fe_sjlj): Fix indentation.
Diffstat (limited to 'gcc/ada/gcc-interface/decl.c')
-rw-r--r-- | gcc/ada/gcc-interface/decl.c | 34 |
1 files changed, 9 insertions, 25 deletions
diff --git a/gcc/ada/gcc-interface/decl.c b/gcc/ada/gcc-interface/decl.c index b4c4653..232b552 100644 --- a/gcc/ada/gcc-interface/decl.c +++ b/gcc/ada/gcc-interface/decl.c @@ -736,16 +736,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, bool definition) if (foreign && Is_Descendant_Of_Address (Underlying_Type (gnat_type))) gnu_type = ptr_type_node; else - { - gnu_type = gnat_to_gnu_type (gnat_type); - - /* If this is a standard exception definition, use the standard - exception type. This is necessary to make sure that imported - and exported views of exceptions are merged in LTO mode. */ - if (TREE_CODE (TYPE_NAME (gnu_type)) == TYPE_DECL - && DECL_NAME (TYPE_NAME (gnu_type)) == exception_data_name_id) - gnu_type = except_type_node; - } + gnu_type = gnat_to_gnu_type (gnat_type); /* For a debug renaming declaration, build a debug-only entity. */ if (Present (Debug_Renaming_Link (gnat_entity))) @@ -3404,21 +3395,6 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, bool definition) /* Fill in locations of fields. */ annotate_rep (gnat_entity, gnu_type); - - /* If this is a record type associated with an exception definition, - equate its fields to those of the standard exception type. This - will make it possible to convert between them. */ - if (gnu_entity_name == exception_data_name_id) - { - tree gnu_std_field; - for (gnu_field = TYPE_FIELDS (gnu_type), - gnu_std_field = TYPE_FIELDS (except_type_node); - gnu_field; - gnu_field = DECL_CHAIN (gnu_field), - gnu_std_field = DECL_CHAIN (gnu_std_field)) - SET_DECL_ORIGINAL_FIELD_TO_FIELD (gnu_field, gnu_std_field); - gcc_assert (!gnu_std_field); - } } break; @@ -7126,6 +7102,14 @@ gnat_to_gnu_field (Entity_Id gnat_field, tree gnu_record_type, int packed, tree gnu_field, gnu_size, gnu_pos; bool is_bitfield; + /* Force the type of the Not_Handled_By_Others field to be that of the + field in struct Exception_Data declared in raise.h instead of using + the declared boolean type. We need to do that because there is no + easy way to make use of a C compatible boolean type for the latter. */ + if (gnu_field_id == not_handled_by_others_name_id + && gnu_field_type == boolean_type_node) + gnu_field_type = char_type_node; + /* The qualifier to be used in messages. */ if (is_aliased) field_s = "aliased&"; |