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/14262 (ABI corner case confusion)


I wrote:
> > 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
arguments?

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 :-/

Bye,
Ulrich

-- 
  Dr. Ulrich Weigand
  weigand@informatik.uni-erlangen.de


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