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: objc testcase patches


On Wed, 2004-01-28 at 10:59, Ziemowit Laski wrote:
> + /* The encoded parameter sizes will be rounded up to match pointer 
> alignment.  */
> + #define ROUND(s,a) (a * ((s + a - 1) / a))
> + #define aligned_sizeof(T) ROUND(sizeof(T),__alignof(void *))

I think this is a reasonable patch for moving forward.  However, I doubt
that it will make this testcase work on all systems.  This assumes that
pointers are at least as large as unsigned, and that pointers are the
same size as stack slots.  This isn't true for all systems.  In
particular, I am curious what happens if you generate ILP32 code for a
64-bit target.

I do see that this is consistent with the code in objc-act.c
encode_method_prototype.  I think that code is broken too, but since I
don't know what the encoding are used for, I could be wrong on this. At
least the two pieces of code are consistent, so this does seem to be the
right fix for now.

I tried the patched proto-qual-1.c testcase on an ia64-linux system, and
it worked.
-- 
Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com


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