]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
calls.c (store_unaligned_arguments_into_pseudos): Deal only with values living in...
authorEric Botcazou <ebotcazou@adacore.com>
Mon, 10 Nov 2008 16:52:50 +0000 (16:52 +0000)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Mon, 10 Nov 2008 16:52:50 +0000 (16:52 +0000)
* calls.c (store_unaligned_arguments_into_pseudos): Deal only with
values living in memory and use more precise alignment information.

From-SVN: r141742

gcc/ChangeLog
gcc/calls.c
gcc/testsuite/ChangeLog
gcc/testsuite/gnat.dg/pack11.adb [new file with mode: 0644]

index d3ad211876a7e5f115e13972ada6c732d19078d5..2d62c074b8793af4873bef0e282b862d19e0dfa6 100644 (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
index a3d35b3bf5c334e3abb4891e0ecb17228d72693d..096dde4948c83c268ba6cb52050673efed7dfba9 100644 (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));
index 412c77abaee5d5e6f846e8ba2c2e5062108fa0e0..48794e8fdbd93653e9cc9430de1e1bc103789112 100644 (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
diff --git a/gcc/testsuite/gnat.dg/pack11.adb b/gcc/testsuite/gnat.dg/pack11.adb
new file mode 100644 (file)
index 0000000..479062b
--- /dev/null
@@ -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;