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]

Re: [PATCH] PR target/18916; Function arg passing mem align fixes.


On Sun, Jan 09, 2005 at 04:39:03PM +1030, Alan Modra wrote:
> Shouldn't emit_move_insn handle mis-aligned moves anyway?

No.

> At least rs6000_emit_move has code to split DImode moves to SImode
> depending on alignment.

The rs6000 port is strange wrt STRICT_ALIGNMENT.  I wouldn't
use it as an example of what should or should not be expected
from a backend.

> A little test like the following reveals emit_move_insn being called
> on the misaligned mem for x, so why do anything special for parms if
> other parts of the compiler leave the backend emit_move to handle
> misalignment?
> 
> int x __attribute__ ((aligned (1)));
> 
> void foo (void)
> {
>   x = 1;
> }

This test is invalid.  (1) By itself, aligned can't reduce alignment
lower than GET_MODE_ALIGNMENT.  (2) Packed doesn't apply to raw
variables.

 struct S
 {
   int x __attribute__ ((packed));
 } x;

 void foo (void)
 {
   x.x = 1;
 }

is the minimal unaligned test case.  And this *does* go through
store_bit_field.


r~


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]