Skip to content

Commit 4762585

Browse files
author
Arnaud Charlet
committed
Revert previous change, unintended.
From-SVN: r195805
1 parent a44bbd4 commit 4762585

File tree

5 files changed

+68
-256
lines changed

5 files changed

+68
-256
lines changed

gcc/ada/gcc-interface/ada-tree.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* *
77
* C Header File *
88
* *
9-
* Copyright (C) 1992-2012, Free Software Foundation, Inc. *
9+
* Copyright (C) 1992-2013, Free Software Foundation, Inc. *
1010
* *
1111
* GNAT is free software; you can redistribute it and/or modify it under *
1212
* terms of the GNU General Public License as published by the Free Soft- *
@@ -507,5 +507,11 @@ do { \
507507
#define LOOP_STMT_BOTTOM_COND_P(NODE) TREE_LANG_FLAG_0 (LOOP_STMT_CHECK (NODE))
508508
#define LOOP_STMT_TOP_UPDATE_P(NODE) TREE_LANG_FLAG_1 (LOOP_STMT_CHECK (NODE))
509509

510+
/* Optimization hints on loops. */
511+
#define LOOP_STMT_NO_UNROLL(NODE) TREE_LANG_FLAG_2 (LOOP_STMT_CHECK (NODE))
512+
#define LOOP_STMT_UNROLL(NODE) TREE_LANG_FLAG_3 (LOOP_STMT_CHECK (NODE))
513+
#define LOOP_STMT_NO_VECTOR(NODE) TREE_LANG_FLAG_4 (LOOP_STMT_CHECK (NODE))
514+
#define LOOP_STMT_VECTOR(NODE) TREE_LANG_FLAG_5 (LOOP_STMT_CHECK (NODE))
515+
510516
#define EXIT_STMT_COND(NODE) TREE_OPERAND_CHECK_CODE (NODE, EXIT_STMT, 0)
511517
#define EXIT_STMT_LABEL(NODE) TREE_OPERAND_CHECK_CODE (NODE, EXIT_STMT, 1)

gcc/ada/gcc-interface/decl.c

Lines changed: 19 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -2908,12 +2908,10 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
29082908
{
29092909
Node_Id full_definition = Declaration_Node (gnat_entity);
29102910
Node_Id record_definition = Type_Definition (full_definition);
2911-
Node_Id gnat_constr;
29122911
Entity_Id gnat_field;
2913-
tree gnu_field, gnu_field_list = NULL_TREE;
2914-
tree gnu_get_parent;
2912+
tree gnu_field, gnu_field_list = NULL_TREE, gnu_get_parent;
29152913
/* Set PACKED in keeping with gnat_to_gnu_field. */
2916-
const int packed
2914+
int packed
29172915
= Is_Packed (gnat_entity)
29182916
? 1
29192917
: Component_Alignment (gnat_entity) == Calign_Storage_Unit
@@ -2923,13 +2921,13 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
29232921
&& Known_RM_Size (gnat_entity)))
29242922
? -2
29252923
: 0;
2926-
const bool has_discr = Has_Discriminants (gnat_entity);
2927-
const bool has_rep = Has_Specified_Layout (gnat_entity);
2928-
const bool is_extension
2924+
bool has_discr = Has_Discriminants (gnat_entity);
2925+
bool has_rep = Has_Specified_Layout (gnat_entity);
2926+
bool all_rep = has_rep;
2927+
bool is_extension
29292928
= (Is_Tagged_Type (gnat_entity)
29302929
&& Nkind (record_definition) == N_Derived_Type_Definition);
2931-
const bool is_unchecked_union = Is_Unchecked_Union (gnat_entity);
2932-
bool all_rep = has_rep;
2930+
bool is_unchecked_union = Is_Unchecked_Union (gnat_entity);
29332931

29342932
/* See if all fields have a rep clause. Stop when we find one
29352933
that doesn't. */
@@ -3168,51 +3166,6 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
31683166
}
31693167
}
31703168

3171-
/* If we have a derived untagged type that renames discriminants in
3172-
the root type, the (stored) discriminants are a just copy of the
3173-
discriminants of the root type. This means that any constraints
3174-
added by the renaming in the derivation are disregarded as far
3175-
as the layout of the derived type is concerned. To rescue them,
3176-
we change the type of the (stored) discriminants to a subtype
3177-
with the bounds of the type of the visible discriminants. */
3178-
if (has_discr
3179-
&& !is_extension
3180-
&& Stored_Constraint (gnat_entity) != No_Elist)
3181-
for (gnat_constr = First_Elmt (Stored_Constraint (gnat_entity));
3182-
gnat_constr != No_Elmt;
3183-
gnat_constr = Next_Elmt (gnat_constr))
3184-
if (Nkind (Node (gnat_constr)) == N_Identifier
3185-
/* Ignore access discriminants. */
3186-
&& !Is_Access_Type (Etype (Node (gnat_constr)))
3187-
&& Ekind (Entity (Node (gnat_constr))) == E_Discriminant)
3188-
{
3189-
Entity_Id gnat_discr = Entity (Node (gnat_constr));
3190-
tree gnu_discr_type = gnat_to_gnu_type (Etype (gnat_discr));
3191-
tree gnu_ref
3192-
= gnat_to_gnu_entity (Original_Record_Component (gnat_discr),
3193-
NULL_TREE, 0);
3194-
3195-
/* GNU_REF must be an expression using a PLACEHOLDER_EXPR built
3196-
just above for one of the stored discriminants. */
3197-
gcc_assert (TREE_TYPE (TREE_OPERAND (gnu_ref, 0)) == gnu_type);
3198-
3199-
if (gnu_discr_type != TREE_TYPE (gnu_ref))
3200-
{
3201-
const unsigned prec = TYPE_PRECISION (TREE_TYPE (gnu_ref));
3202-
tree gnu_subtype
3203-
= TYPE_UNSIGNED (TREE_TYPE (gnu_ref))
3204-
? make_unsigned_type (prec) : make_signed_type (prec);
3205-
TREE_TYPE (gnu_subtype) = TREE_TYPE (gnu_ref);
3206-
TYPE_EXTRA_SUBTYPE_P (gnu_subtype) = 1;
3207-
SET_TYPE_RM_MIN_VALUE (gnu_subtype,
3208-
TYPE_MIN_VALUE (gnu_discr_type));
3209-
SET_TYPE_RM_MAX_VALUE (gnu_subtype,
3210-
TYPE_MAX_VALUE (gnu_discr_type));
3211-
TREE_TYPE (gnu_ref)
3212-
= TREE_TYPE (TREE_OPERAND (gnu_ref, 1)) = gnu_subtype;
3213-
}
3214-
}
3215-
32163169
/* Add the fields into the record type and finish it up. */
32173170
components_to_record (gnu_type, Component_List (record_definition),
32183171
gnu_field_list, packed, definition, false,
@@ -4125,10 +4078,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
41254078
tree gnu_stub_type = NULL_TREE, gnu_stub_name = NULL_TREE;
41264079
tree gnu_ext_name = create_concat_name (gnat_entity, NULL);
41274080
Entity_Id gnat_param;
4128-
enum inline_status_t inline_status
4129-
= Has_Pragma_No_Inline (gnat_entity)
4130-
? is_suppressed
4131-
: (Is_Inlined (gnat_entity) ? is_enabled : is_disabled);
4081+
bool inline_flag = Is_Inlined (gnat_entity);
41324082
bool public_flag = Is_Public (gnat_entity) || imported_p;
41334083
bool extern_flag
41344084
= (Is_Public (gnat_entity) && !definition) || imported_p;
@@ -4684,15 +4634,15 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
46844634

46854635
gnu_decl
46864636
= create_subprog_decl (gnu_entity_name, gnu_ext_name, gnu_type,
4687-
gnu_param_list, inline_status,
4688-
public_flag, extern_flag, artificial_flag,
4689-
attr_list, gnat_entity);
4637+
gnu_param_list, inline_flag, public_flag,
4638+
extern_flag, artificial_flag, attr_list,
4639+
gnat_entity);
46904640
if (has_stub)
46914641
{
46924642
tree gnu_stub_decl
46934643
= create_subprog_decl (gnu_entity_name, gnu_stub_name,
46944644
gnu_stub_type, gnu_stub_param_list,
4695-
inline_status, true, extern_flag,
4645+
inline_flag, true, extern_flag,
46964646
false, attr_list, gnat_entity);
46974647
SET_DECL_FUNCTION_STUB (gnu_decl, gnu_stub_decl);
46984648
}
@@ -5425,7 +5375,7 @@ get_minimal_subprog_decl (Entity_Id gnat_entity)
54255375

54265376
return
54275377
create_subprog_decl (gnu_entity_name, gnu_ext_name, void_ftype, NULL_TREE,
5428-
is_disabled, true, true, true, attr_list, gnat_entity);
5378+
false, true, true, true, attr_list, gnat_entity);
54295379
}
54305380

54315381
/* Return whether the E_Subprogram_Type/E_Function/E_Procedure GNAT_ENTITY is
@@ -6014,7 +5964,7 @@ elaborate_entity (Entity_Id gnat_entity)
60145964
Present (gnat_field);
60155965
gnat_field = Next_Discriminant (gnat_field),
60165966
gnat_discriminant_expr = Next_Elmt (gnat_discriminant_expr))
6017-
/* Ignore access discriminants. */
5967+
/* ??? For now, ignore access discriminants. */
60185968
if (!Is_Access_Type (Etype (Node (gnat_discriminant_expr))))
60195969
elaborate_expression (Node (gnat_discriminant_expr),
60205970
gnat_entity, get_entity_name (gnat_field),
@@ -7660,20 +7610,20 @@ build_subst_list (Entity_Id gnat_subtype, Entity_Id gnat_type, bool definition)
76607610
{
76617611
vec<subst_pair> gnu_list = vNULL;
76627612
Entity_Id gnat_discrim;
7663-
Node_Id gnat_constr;
7613+
Node_Id gnat_value;
76647614

76657615
for (gnat_discrim = First_Stored_Discriminant (gnat_type),
7666-
gnat_constr = First_Elmt (Stored_Constraint (gnat_subtype));
7616+
gnat_value = First_Elmt (Stored_Constraint (gnat_subtype));
76677617
Present (gnat_discrim);
76687618
gnat_discrim = Next_Stored_Discriminant (gnat_discrim),
7669-
gnat_constr = Next_Elmt (gnat_constr))
7619+
gnat_value = Next_Elmt (gnat_value))
76707620
/* Ignore access discriminants. */
7671-
if (!Is_Access_Type (Etype (Node (gnat_constr))))
7621+
if (!Is_Access_Type (Etype (Node (gnat_value))))
76727622
{
76737623
tree gnu_field = gnat_to_gnu_field_decl (gnat_discrim);
76747624
tree replacement = convert (TREE_TYPE (gnu_field),
76757625
elaborate_expression
7676-
(Node (gnat_constr), gnat_subtype,
7626+
(Node (gnat_value), gnat_subtype,
76777627
get_entity_name (gnat_discrim),
76787628
definition, true, false));
76797629
subst_pair s = {gnu_field, replacement};

gcc/ada/gcc-interface/gigi.h

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -430,17 +430,6 @@ enum exception_info_kind
430430
exception_column
431431
};
432432

433-
/* Define the inline status of a subprogram. */
434-
enum inline_status_t
435-
{
436-
/* Inlining is suppressed for the subprogram. */
437-
is_suppressed,
438-
/* No inlining is requested for the subprogram. */
439-
is_disabled,
440-
/* Inlining is requested for the subprogram. */
441-
is_enabled
442-
};
443-
444433
extern GTY(()) tree gnat_std_decls[(int) ADT_LAST];
445434
extern GTY(()) tree gnat_raise_decls[(int) LAST_REASON_CODE + 1];
446435
extern GTY(()) tree gnat_raise_decls_ext[(int) LAST_REASON_CODE + 1];
@@ -729,14 +718,13 @@ extern tree create_label_decl (tree, Node_Id);
729718
node), PARAM_DECL_LIST is the list of the subprogram arguments (a list of
730719
PARM_DECL nodes chained through the DECL_CHAIN field).
731720
732-
INLINE_STATUS, PUBLIC_FLAG, EXTERN_FLAG, ARTIFICIAL_FLAG and ATTR_LIST are
721+
INLINE_FLAG, PUBLIC_FLAG, EXTERN_FLAG, ARTIFICIAL_FLAG and ATTR_LIST are
733722
used to set the appropriate fields in the FUNCTION_DECL. GNAT_NODE is
734723
used for the position of the decl. */
735724
extern tree create_subprog_decl (tree subprog_name, tree asm_name,
736725
tree subprog_type, tree param_decl_list,
737-
enum inline_status_t inline_status,
738-
bool public_flag, bool extern_flag,
739-
bool artificial_flag,
726+
bool inline_flag, bool public_flag,
727+
bool extern_flag, bool artificial_flag,
740728
struct attrib *attr_list, Node_Id gnat_node);
741729

742730
/* Set up the framework for generating code for SUBPROG_DECL, a subprogram

0 commit comments

Comments
 (0)