summaryrefslogtreecommitdiff
path: root/gcc/ada/decl.c
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2003-11-04 12:51:47 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2003-11-04 12:51:47 +0000
commitcafd02b3e86511710dff2234a989975336909601 (patch)
tree8a2906f87ff8dae462187a72710b5203b22a6c1b /gcc/ada/decl.c
parent3f26eaa9e3a48823a83959fbd9fbabc64a7b55aa (diff)
downloadgcc-cafd02b3e86511710dff2234a989975336909601.tar.gz
* sysdep.c: Problem discovered during IA64 VMS port.
[VMS] #include <unixio.h> to get proper prototypes. * adaint.c: Issues discovered/problems fixed during IA64 VMS port. [VMS] #define _POSIX_EXIT for proper semantics. [VMS] #include <unixio.h> for proper prototypes. [VMS] (fork): #define IA64 version. (__gnat_os_exit): Remove unnecessary VMS specific code. * 3vtrasym.adb: Minor reformatting Use terminology encoded/decoded name, rather than C++ specific notion of mangling (this is the terminology used throughout GNAT). * einfo.h: Regenerated * einfo.ads, einfo.adb: Add new flag Is_Thread_Body * exp_ch6.adb: (Expand_N_Subprogram_Body): Handle expansion of thread body procedure * par-prag.adb: Add dummy entry for Thread_Body pragma * rtsfind.ads: Add entries for System.Threads entities for thread body processing * sem_attr.adb: (Analyze_Pragma, Access attributes): Check these are not applied to a thread body, since this is not permitted * sem_prag.adb: Add processing for Thread_Body pragma. Minor comment fix. * sem_res.adb: (Resolve_Call): Check for incorrect attempt to call a thread body procedure with a direct call. * snames.ads, snames.adb: Add entry for Thread_Body pragma Add names associated with thread body expansion * snames.h: Add entry for Thread_Body pragma * s-thread.adb: Add entries for thread body processing These are dummy bodies so far * s-thread.ads: Add documentation on thread body handling. Add entries for thread body processing. * sem_ch10.adb: (Build_Limited_Views): Return after posting an error in case of limited with_clause on subprograms, generics, instances or generic renamings (Install_Limited_Withed_Unit): Do nothing in case of limited with_clause on subprograms, generics, instances or generic renamings * raise.c (setup_to_install): Correct mistake in last revision; two arguments out of order. * trans.c, cuintp.c, argv.c, aux-io.c, cal.c, errno.c, exit.c, gnatbl.c, init.c, stringt.h, utils.c, utils2.c: Update copyright notice, missed in previous change. Remove trailing blanks and other style errors introduced in previous change. * decl.c (gnat_to_gnu_field): Adjust the conditions under which we get rid of the wrapper for a LJM type, ensuring we don't do that if the field is addressable. This avoids potential low level type view mismatches later on, for instance in a by-reference argument passing process. * decl.c (gnat_to_gnu_field): No longer check for BLKmode being aligned at byte boundary. * decl.c (components_to_record): Do not delete the empty variants from the end of the union type. * exp_ch4.adb (Expand_N_Op_Eq): Use base type when locating primitive operation for a derived type, an explicit declaration may use a local subtype of Boolean. * make.adb (Gnatmake): Allow main sources on the command line with a library project when it is only for compilation (no binding or linking). Part of PR ada/12806: * ada-tree.h (TYPE_DIGITS_VALUE, SET_TYPE_DIGITS_VALUE): Save count as tree, not integer. * decl.c: (gnat_to_gnu_entity, case E_Floating_Point_Type): Save count as tree, not integer. * targtyps.c, decl.c, misc.c, gigi.h (fp_prec_to_size, fp_size_to_prec): Temporary routines to work around change in FP sizing semantics in GCC. * utils.c: (build_vms_descriptor): TYPE_DIGITS_VALUE is tree, not integer. * gigi.h: (enumerate_modes): New function. * Make-lang.in: (ada/misc.o): Add real.h. * misc.c: (enumerate_modes): New function. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@73250 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/decl.c')
-rw-r--r--gcc/ada/decl.c57
1 files changed, 19 insertions, 38 deletions
diff --git a/gcc/ada/decl.c b/gcc/ada/decl.c
index 028443fd91b..41bcfa66e89 100644
--- a/gcc/ada/decl.c
+++ b/gcc/ada/decl.c
@@ -166,7 +166,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
&& UI_Is_In_Int_Range (Esize (gnat_entity)))
? MIN (UI_To_Int (Esize (gnat_entity)),
IN (kind, Float_Kind)
- ? LONG_DOUBLE_TYPE_SIZE
+ ? fp_prec_to_size (LONG_DOUBLE_TYPE_SIZE)
: IN (kind, Access_Kind) ? POINTER_SIZE * 2
: LONG_LONG_TYPE_SIZE)
: LONG_LONG_TYPE_SIZE);
@@ -1337,14 +1337,15 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
gnu_type = make_signed_type (esize);
TYPE_VAX_FLOATING_POINT_P (gnu_type) = 1;
SET_TYPE_DIGITS_VALUE (gnu_type,
- UI_To_Int (Digits_Value (gnat_entity)));
+ UI_To_gnu (Digits_Value (gnat_entity),
+ sizetype));
break;
}
/* The type of the Low and High bounds can be our type if this is
a type from Standard, so set them at the end of the function. */
gnu_type = make_node (REAL_TYPE);
- TYPE_PRECISION (gnu_type) = esize;
+ TYPE_PRECISION (gnu_type) = fp_size_to_prec (esize);
layout_type (gnu_type);
break;
@@ -1560,8 +1561,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
tem = gnat_to_gnu_type (Component_Type (gnat_entity));
/* Get and validate any specified Component_Size, but if Packed,
- ignore it since the front end will have taken care of it. Also,
- allow sizes not a multiple of Storage_Unit if packed. */
+ ignore it since the front end will have taken care of it. */
gnu_comp_size
= validate_size (Component_Size (gnat_entity), tem,
gnat_entity,
@@ -1884,8 +1884,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
}
/* Get and validate any specified Component_Size, but if Packed,
- ignore it since the front end will have taken care of it. Also,
- allow sizes not a multiple of Storage_Unit if packed. */
+ ignore it since the front end will have taken care of it. */
gnu_comp_size
= validate_size (Component_Size (gnat_entity), gnu_type,
gnat_entity,
@@ -4924,10 +4923,14 @@ gnat_to_gnu_field (Entity_Id gnat_field,
gnu_size = validate_size (Esize (gnat_field), gnu_field_type,
gnat_field, FIELD_DECL, 0, 1);
- /* If the field's type is a left-justified modular type, make the field
- the type of the inner object unless it is aliases. We don't need
- the the wrapper here and it can prevent packing. */
- if (! Is_Aliased (gnat_field) && TREE_CODE (gnu_field_type) == RECORD_TYPE
+ /* If the field's type is left-justified modular, the wrapper can prevent
+ packing so we make the field the type of the inner object unless the
+ situation forbids it. We may not do that when the field is addressable_p,
+ typically because in that case this field may later be passed by-ref for
+ a formal argument expecting the left justification. The condition below
+ is then matching the addressable_p code for COMPONENT_REF. */
+ if (! Is_Aliased (gnat_field) && flag_strict_aliasing
+ && TREE_CODE (gnu_field_type) == RECORD_TYPE
&& TYPE_LEFT_JUSTIFIED_MODULAR_P (gnu_field_type))
gnu_field_type = TREE_TYPE (TYPE_FIELDS (gnu_field_type));
@@ -5050,17 +5053,6 @@ gnat_to_gnu_field (Entity_Id gnat_field,
if (Is_Atomic (gnat_field))
check_ok_for_atomic (gnu_field_type, gnat_field, 0);
-
- if (gnu_pos != 0 && TYPE_MODE (gnu_field_type) == BLKmode
- && (! integer_zerop (size_binop (TRUNC_MOD_EXPR, gnu_pos,
- bitsize_unit_node)))
- && TYPE_MODE (gnu_field_type) == BLKmode)
- {
- post_error_ne ("fields of& must start at storage unit boundary",
- First_Bit (Component_Clause (gnat_field)),
- Etype (gnat_field));
- gnu_pos = 0;
- }
}
/* If the record has rep clauses and this is the tag field, make a rep
@@ -5072,17 +5064,6 @@ gnat_to_gnu_field (Entity_Id gnat_field,
gnu_size = TYPE_SIZE (gnu_field_type);
}
- /* If a size is specified and this is a BLKmode field, it must be an
- integral number of bytes. */
- if (gnu_size != 0 && TYPE_MODE (gnu_field_type) == BLKmode
- && ! integer_zerop (size_binop (TRUNC_MOD_EXPR, gnu_size,
- bitsize_unit_node)))
- {
- post_error_ne ("size of fields of& must be multiple of a storage unit",
- gnat_field, Etype (gnat_field));
- gnu_pos = gnu_size = 0;
- }
-
/* We need to make the size the maximum for the type if it is
self-referential and an unconstrained type. In that case, we can't
pack the field since we can't make a copy to align it. */
@@ -5341,11 +5322,11 @@ components_to_record (tree gnu_record_type,
gnu_variant_list = gnu_field;
}
- /* We can delete any empty variants from the end. This may leave none
- left. Note we cannot delete variants from anywhere else. */
- while (gnu_variant_list != 0
- && TYPE_FIELDS (TREE_TYPE (gnu_variant_list)) == 0)
- gnu_variant_list = TREE_CHAIN (gnu_variant_list);
+ /* We use to delete the empty variants from the end. However,
+ we no longer do that because we need them to generate complete
+ debugging information for the variant record. Otherwise,
+ the union type definition will be missing the fields associated
+ to these empty variants. */
/* Only make the QUAL_UNION_TYPE if there are any non-empty variants. */
if (gnu_variant_list != 0)