calls.c (store_unaligned_arguments_into_pseudos): Deal only with values living in memory and use more precise alignment information.

* calls.c (store_unaligned_arguments_into_pseudos): Deal only with
	values living in memory and use more precise alignment information.

From-SVN: r141742
This commit is contained in:
Eric Botcazou 2008-11-10 16:52:50 +00:00 committed by Eric Botcazou
parent 959f8cd7da
commit 852d22b41a
4 changed files with 40 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2008-11-10 Eric Botcazou <ebotcazou@adacore.com>
* calls.c (store_unaligned_arguments_into_pseudos): Deal only with
values living in memory and use more precise alignment information.
2008-11-10 Jakub Jelinek <jakub@redhat.com>
PR middle-end/35314

View File

@ -837,7 +837,8 @@ store_unaligned_arguments_into_pseudos (struct arg_data *args, int num_actuals)
for (i = 0; i < num_actuals; i++)
if (args[i].reg != 0 && ! args[i].pass_on_stack
&& args[i].mode == BLKmode
&& (TYPE_ALIGN (TREE_TYPE (args[i].tree_value))
&& MEM_P (args[i].value)
&& (MEM_ALIGN (args[i].value)
< (unsigned int) MIN (BIGGEST_ALIGNMENT, BITS_PER_WORD)))
{
int bytes = int_size_in_bytes (TREE_TYPE (args[i].tree_value));

View File

@ -1,3 +1,7 @@
2008-11-10 Eric Botcazou <ebotcazou@adacore.com>
* gnat.dg/pack11.adb: New test.
2008-11-10 Jakub Jelinek <jakub@redhat.com>
PR c++/38021

View File

@ -0,0 +1,29 @@
-- { dg-do run }
-- { dg-options "-gnatws" }
with System;
procedure Pack11 is
type R1 is record
A1, A2, A3 : System.Address;
end record;
type R2 is record
C : Character;
R : R1;
end record;
pragma Pack (R2);
procedure Dummy (R : R1) is begin null; end;
procedure Init (X : R2) is
begin
Dummy (X.R);
end;
My_R2 : R2;
begin
Init (My_R2);
end;