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.


I think this fixes nothing.  Or not much.  The parameter is still misaligned
for its type, which means that the following should continue to fail:

	typedef struct { _Complex long double a; } Scld1;
	static Scld1 g1sScld1 = { 1 }, g1sScld2;

	void __attribute__((noinline)) copy(Scld1 *p)
	{
	  g1sScld2 = *p;
	}

	void __attribute__((noinline)) test(int n, Scld1 t)
	{   
	  copy (&t);
	}

	int main ()
	{
	  test (1, g1sScld1);
	  if (g1sScld1.a != g1sScld2.a)
	    abort ();
	  return 0;
	}

The way Sparc fixes the misaligned double problem in varargs is to
allocate a local stack temporary and copy the pieces into it.  You
could (now) also use a MISALIGNED_INDIRECT_REF.

For the above case, you'd also need to add something to
assign_parm_setup_block and assign_parm_setup_stack to allocate new
local stack storage in the case of misaligned input.

That is, unless you don't wanna call the abi broken and fix it...


r~


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