aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorUlrich Weigand <uweigand@de.ibm.com>2004-03-11 22:53:52 +0000
committerUlrich Weigand <uweigand@gcc.gnu.org>2004-03-11 22:53:52 +0000
commit03ca1672e4d910a7829d8680860fe9aa0fbcfbaf (patch)
tree51f389498132bd61009c90235cb367c519aac5ba /gcc
parentbbe708a3914c49b9124bd2b44a9d62d5640ffd27 (diff)
downloadgcc-03ca1672e4d910a7829d8680860fe9aa0fbcfbaf.zip
gcc-03ca1672e4d910a7829d8680860fe9aa0fbcfbaf.tar.gz
gcc-03ca1672e4d910a7829d8680860fe9aa0fbcfbaf.tar.bz2
re PR target/14262 (Structure size computed wrong)
PR target/14262 * calls.c (load_register_parameters): If BLOCK_REG_PADDING is not defined, pass small BLKmode values in registers in the low-order part. * gcc.dg/20040305-2.c: New test. From-SVN: r79348
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/calls.c9
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.dg/20040305-2.c45
4 files changed, 62 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 8526cfb..66813dd 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,11 @@
2004-03-11 Ulrich Weigand <uweigand@de.ibm.com>
+ PR target/14262
+ * calls.c (load_register_parameters): If BLOCK_REG_PADDING is not
+ defined, pass small BLKmode values in registers in the low-order part.
+
+2004-03-11 Ulrich Weigand <uweigand@de.ibm.com>
+
* combine.c (if_then_else_cond): Check for NULL return value of
simplify_gen_subreg.
diff --git a/gcc/calls.c b/gcc/calls.c
index 4bfcde4..29c06aa 100644
--- a/gcc/calls.c
+++ b/gcc/calls.c
@@ -1675,10 +1675,14 @@ load_register_parameters (struct arg_data *args, int num_actuals,
{
rtx mem = validize_mem (args[i].value);
-#ifdef BLOCK_REG_PADDING
/* Handle a BLKmode that needs shifting. */
if (nregs == 1 && size < UNITS_PER_WORD
- && args[i].locate.where_pad == downward)
+#ifdef BLOCK_REG_PADDING
+ && args[i].locate.where_pad == downward
+#else
+ && BYTES_BIG_ENDIAN
+#endif
+ )
{
rtx tem = operand_subword_force (mem, 0, args[i].mode);
rtx ri = gen_rtx_REG (word_mode, REGNO (reg));
@@ -1693,7 +1697,6 @@ load_register_parameters (struct arg_data *args, int num_actuals,
emit_move_insn (ri, x);
}
else
-#endif
move_block_to_reg (REGNO (reg), mem, nregs, args[i].mode);
}
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index da07a04..fe5bb99 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,5 +1,10 @@
2004-03-11 Ulrich Weigand <uweigand@de.ibm.com>
+ PR target/14262
+ * gcc.dg/20040305-2.c: New test.
+
+2004-03-11 Ulrich Weigand <uweigand@de.ibm.com>
+
* gcc.dg/20040310-1.c: New test.
2004-03-11 Roger Sayle <roger@eyesopen.com>
diff --git a/gcc/testsuite/gcc.dg/20040305-2.c b/gcc/testsuite/gcc.dg/20040305-2.c
new file mode 100644
index 0000000..4a3ef9a
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/20040305-2.c
@@ -0,0 +1,45 @@
+/* PR target/14262 */
+/* { dg-do run } */
+
+typedef char ACS;
+typedef char LSM;
+typedef char PANEL;
+typedef char DRIVE;
+typedef struct {
+ ACS acs;
+ LSM lsm;
+} LSMID;
+typedef struct {
+ LSMID lsm_id;
+ PANEL panel;
+} PANELID;
+typedef struct {
+ PANELID panel_id;
+ DRIVE drive;
+} DRIVEID;
+
+void sub (DRIVEID driveid)
+{
+ if (driveid.drive != 1)
+ abort ();
+ if (driveid.panel_id.panel != 2)
+ abort ();
+ if (driveid.panel_id.lsm_id.lsm != 3)
+ abort ();
+ if (driveid.panel_id.lsm_id.acs != 4)
+ abort ();
+}
+
+int main(void)
+{
+ DRIVEID driveid;
+
+ driveid.drive = 1;
+ driveid.panel_id.panel = 2;
+ driveid.panel_id.lsm_id.lsm = 3;
+ driveid.panel_id.lsm_id.acs = 4;
+
+ sub(driveid);
+}
+
+