public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* alignment: store_one_arg vs emit_push_insn
@ 2003-05-09 23:34 DJ Delorie
  2003-05-10  0:05 ` Richard Henderson
  0 siblings, 1 reply; 15+ messages in thread
From: DJ Delorie @ 2003-05-09 23:34 UTC (permalink / raw)
  To: gcc


In store_one_arg (calls.c) we see this code, computing the alignment
of a parameter:

      /* Some types will require stricter alignment, which will be
	 provided for elsewhere in argument layout.  */
      parm_align = MAX (PARM_BOUNDARY, TYPE_ALIGN (TREE_TYPE (pval)));

But, in emit_push_insn where that alignment is used (it's not used
anywhere else), we see this comment:

   ALIGN (in bits) is maximum alignment we can assume.

It would seem to me that the MAX should in fact be a MIN in
store_one_arg.  The way the code is now, xstormy16 is trying to access
a byte-aligned object with a HImode move, and failing
(STRICT_ALIGNMENT is set).

Either that or these two functions just aren't communicating well ;-)

(Or I'm not understanding what's supposed to be happening here, of course)

^ permalink raw reply	[flat|nested] 15+ messages in thread
* Re:  alignment: store_one_arg vs emit_push_insn
@ 2003-05-10  2:24 Richard Kenner
  2003-05-11  2:22 ` DJ Delorie
  0 siblings, 1 reply; 15+ messages in thread
From: Richard Kenner @ 2003-05-10  2:24 UTC (permalink / raw)
  To: dj; +Cc: gcc

      /* Some types will require stricter alignment, which will be
	 provided for elsewhere in argument layout.  */
      parm_align = MAX (PARM_BOUNDARY, TYPE_ALIGN (TREE_TYPE (pval)));

    It would seem to me that the MAX should in fact be a MIN in
    store_one_arg.

No, it looks right to me.  PARM_BOUNDARY is the smallest alignment a
parameter is allowed to have, but some might be more aligned.

^ permalink raw reply	[flat|nested] 15+ messages in thread
* Re: alignment: store_one_arg vs emit_push_insn
@ 2003-05-11 11:31 Richard Kenner
  2003-05-11 14:33 ` DJ Delorie
  0 siblings, 1 reply; 15+ messages in thread
From: Richard Kenner @ 2003-05-11 11:31 UTC (permalink / raw)
  To: dj; +Cc: gcc

    > No, it looks right to me.  PARM_BOUNDARY is the smallest alignment a
    > parameter is allowed to have, but some might be more aligned.

    Then emit_push_insn is misusing it, as it uses it as the alignment of
    the source, not just the destination.

I don't follow.  emit_push_insn barely uses it *at all*.

^ permalink raw reply	[flat|nested] 15+ messages in thread
* Re: alignment: store_one_arg vs emit_push_insn
@ 2003-05-11 14:49 Richard Kenner
  2003-05-11 15:30 ` DJ Delorie
  0 siblings, 1 reply; 15+ messages in thread
From: Richard Kenner @ 2003-05-11 14:49 UTC (permalink / raw)
  To: dj; +Cc: gcc

    > I don't follow.  emit_push_insn barely uses it *at all*.

    But the one place it *does* use it is here:

    	  move_by_pieces (NULL, xinner, INTVAL (size) - used, align);
    
    In the failing case, align is 16 and xinner is 8-bit aligned.

I thought you were talking about it using PARM_BOUNDARY.

In this case the bug seems to be that xinner isn't properly aligned.

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2003-05-13  1:04 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-05-09 23:34 alignment: store_one_arg vs emit_push_insn DJ Delorie
2003-05-10  0:05 ` Richard Henderson
2003-05-10  0:27   ` DJ Delorie
2003-05-12  3:54     ` Richard Henderson
2003-05-12 18:19       ` DJ Delorie
2003-05-12 19:41         ` Richard Henderson
2003-05-12 22:47           ` DJ Delorie
2003-05-12 23:14             ` Richard Henderson
2003-05-13  1:04             ` Paul Koning
2003-05-10  2:24 Richard Kenner
2003-05-11  2:22 ` DJ Delorie
2003-05-11 11:31 Richard Kenner
2003-05-11 14:33 ` DJ Delorie
2003-05-11 14:49 Richard Kenner
2003-05-11 15:30 ` DJ Delorie

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).