This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH] PR/14262 (ABI corner case confusion)
- From: Ulrich Weigand <weigand at i1 dot informatik dot uni-erlangen dot de>
- To: wilson at specifixinc dot com
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Fri, 12 Mar 2004 00:48:52 +0100 (CET)
- Subject: Re: [PATCH] PR/14262 (ABI corner case confusion)
> > Except for the problem that the current code in load_register_parms can
> > read past the end of memory. The code could be changed to call
> > mode_for_size and load the object directly without shifting if
> > possible. That solves part of the problem. Otherwise, we probably have
> > to use the bitfield insert/extract trick here, but at the moment we have
> > no proof that the code is broken, so this can probably be deferred until
> > later.
> It is broken: the modified test case appended below segfaults
> because of the problem you point out. I'll see if I can come
> up with a patch to change load_register_parms as you suggest.
However, it is not just the load-and-shift case that is broken,
the move_block_to_reg case is broken just the same if the
argument size is not a multiple of word size and the argument
is not word-aligned.
Maybe we need to call store_unaligned_arguments_into_pseudos
unconditionally after all to let it handle all unaligned
I've tried this with my test case, and it works; however it
generates abysmally bad code; the argument is read byte
per byte, and those bytes are then pasted together using
shifts and ors to form a 4-byte entity :-/
Dr. Ulrich Weigand