This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
| Other format: | [Raw text] | |
Manually tested on i686-mingw
Tested on i686-linux, committed on mainline.
As part of AI-363, if a private type without discriminants is completed by
a discriminated type with defaults, an object of the type created by an
allocator without initial value is unconstrained, its discriminants can be
modified by assignment, and it must be allocated the maximum size for the
type rather than the size determined by the default discriminants.
Such types are identified by the flag Has_Constrained_Partial_View.
--
To allow packing of some record components on non-byte boundaries,
gigi attempts to transform small BLKmode components into some integral mode.
This transformation may lead to an increase of the component alignment and
size. So far, the attempt was triggered for components with a rep clause
attached, whatever the specified position. In the specific case at hand, the
mode switch succeeds and leads to a size increase incompatible with the
clause bit range. The fix implemented here is to avoid the transformation if
the specified position is byte aligned, in which case the mode switch is
pointless anyway.
Test case should compile with no error:
gcc -c p2.ads
--
package P2 is
type Byte is mod (2**8);
for Byte'Size use 8;
type Point_T is record
X, Y, Z : Byte;
end record;
for Point_T use record
X at 0 range 0..7;
Y at 1 range 0..7;
Z at 2 range 0..7;
end record;
for Point_T'Size use 24;
for Point_T'Alignment use 1;
type Object_T is record
Position : aliased Point_T;
end record;
for Object_T use record
Position at 0 range 0 .. 23;
end record;
end;
--
Gigi sometimes attemps to reuse the back-annotations it has computed for the
front-end. As a consequence, back-annotations need to be again unconditionally
enabled in order for the behavior of the compiler not to depend on -gnatR.
--
Fix PR ada/20515
In the context of cross-compiler it is wrong to use an host macro. The use of
_WIN32 to handle the Stdcall calling convention was breaking cross-compiler
targeted to Windows.
--
For users of Starlet we issue a warning because the interface apparently
assumes that by-ref parameters outlive the procedure invocation. The code
still will not work as intended, but we cannot do much better since other
low-level parts of the back-end would allocate temporaries at will because
of the misalignment if we did not do so here.
2005-06-10 Eric Botcazou <ebotcazou@adacore.com>
Olivier Hainque <hainque@adacore.com>
Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
Pascal Obry <obry@adacore.com>
* gigi.h: (build_allocator): Add arg IGNORE_INIT_TYPE.
* trans.c (call_to_gnu): Issue a warning for users of Starlet when
making a temporary around a procedure call because of non-addressable
actual parameter.
(process_freeze_entity): If entity is a private type, capture size
information that may have been computed for the full view.
(tree_transform, case N_Allocator): If have initializing expression,
check type for Has_Constrained_Partial_View and pass that to
build_allocator.
(tree_transform, case N_Return_Statement): Pass extra arg to
build_allocator.
* decl.c (annotate_value): Remove early return if -gnatR is not
specified.
(gnat_to_gnu_field): Don't make a packable type for a component clause
if the position is byte aligned, the field is aliased, and the clause
size isn't a multiple of the packable alignment. It serves no useful
purpose packing-wise and would be rejected later on.
(gnat_to_gnu_entity, case object): Pass extra arg to build_allocator.
PR ada/20515
(gnat_to_gnu_entity): Remove use of macro _WIN32 which is wrong in the
context of cross compilers. We use TARGET_DLLIMPORT_DECL_ATTRIBUTES
instead.
(create_concat_name): Idem.
Attachment:
difs.59
Description: Text document
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |