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
This commit is contained in:
Ulrich Weigand 2004-03-11 22:53:52 +00:00 committed by Ulrich Weigand
parent bbe708a391
commit 03ca1672e4
4 changed files with 62 additions and 3 deletions

View File

@ -1,3 +1,9 @@
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

View File

@ -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);
}

View File

@ -1,3 +1,8 @@
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.

View File

@ -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);
}