diff options
Diffstat (limited to 'gcc/ada/decl.c')
-rw-r--r-- | gcc/ada/decl.c | 56 |
1 files changed, 21 insertions, 35 deletions
diff --git a/gcc/ada/decl.c b/gcc/ada/decl.c index 9e7749e..fd82da9 100644 --- a/gcc/ada/decl.c +++ b/gcc/ada/decl.c @@ -365,34 +365,16 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition) goto object; case E_Exception: - /* If this is not a VMS exception, treat it as a normal object. - Otherwise, make an object at the specific address of character - type, point to it, and convert it to integer, and mask off - the lower 3 bits. */ - if (! Is_VMS_Exception (gnat_entity)) - goto object; - - /* Allocate the global object that we use to get the value of the - exception. */ - gnu_decl = create_var_decl (gnu_entity_id, - (Present (Interface_Name (gnat_entity)) - ? create_concat_name (gnat_entity, 0) - : NULL_TREE), - char_type_node, NULL_TREE, 0, 0, 1, 1, - 0); - - /* Now return the expression giving the desired value. */ - gnu_decl - = build_binary_op (BIT_AND_EXPR, integer_type_node, - convert (integer_type_node, - build_unary_op (ADDR_EXPR, NULL_TREE, - gnu_decl)), - build_unary_op (NEGATE_EXPR, integer_type_node, - build_int_2 (7, 0))); - - save_gnu_tree (gnat_entity, gnu_decl, 1); - saved = 1; - break; + /* We used to special case VMS exceptions here to directly map them to + their associated condition code. Since this code had to be masked + dynamically to strip off the severity bits, this caused trouble in + the GCC/ZCX case because the "type" pointers we store in the tables + have to be static. We now don't special case here anymore, and let + the regular processing take place, which leaves us with a regular + exception data object for VMS exceptions too. The condition code + mapping is taken care of by the front end and the bitmasking by the + runtime library. */ + goto object; case E_Discriminant: case E_Component: @@ -1017,13 +999,17 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition) (TYPE_SIZE (TREE_TYPE (TYPE_FIELDS (gnu_type))))))) gnu_expr = convert (gnu_type, gnu_expr); - /* This name is external or there was a name specified, use it. - Don't use the Interface_Name if there is an address clause. - (see CD30005). */ - if ((Present (Interface_Name (gnat_entity)) - && No (Address_Clause (gnat_entity))) - || (Is_Public (gnat_entity) - && (! Is_Imported (gnat_entity) || Is_Exported (gnat_entity)))) + /* If this name is external or there was a name specified, use it, + unless this is a VMS exception object since this would conflict + with the symbol we need to export in addition. Don't use the + Interface_Name if there is an address clause (see CD30005). */ + if (! Is_VMS_Exception (gnat_entity) + && + ((Present (Interface_Name (gnat_entity)) + && No (Address_Clause (gnat_entity))) + || + (Is_Public (gnat_entity) + && (! Is_Imported (gnat_entity) || Is_Exported (gnat_entity))))) gnu_ext_name = create_concat_name (gnat_entity, 0); if (const_flag) |