Problem in locate_and_pad_parm
Franz Sirl
Franz.Sirl-kernel@lauterbach.com
Wed Oct 18 13:55:00 GMT 2000
On Wed, 18 Oct 2000, Richard Kenner wrote:
> Is this related to my change yesterday?
>
> I didn't notice your change yesterday, so I don't know.
The change was:
--- function.c 2000/10/13 06:26:25 1.224
+++ function.c 2000/10/17 22:17:31 1.225
@@ -5149,7 +5149,12 @@ locate_and_pad_parm (passed_mode, type,
- offset_ptr->constant);
#else /* !ARGS_GROW_DOWNWARD */
- pad_to_arg_alignment (initial_offset_ptr, boundary, alignment_pad);
+ if (!in_regs
+#ifdef REG_PARM_STACK_SPACE
+ || REG_PARM_STACK_SPACE (fndecl) > 0
+#endif
+ )
+ pad_to_arg_alignment (initial_offset_ptr, boundary, alignment_pad);
*offset_ptr = *initial_offset_ptr;
> This fixed a bug on powerpc-linux-gnu, the stack was aligned even for
> args in registers for platforms where REG_PARM_STACK_SPACE returns
> 0. Probably the test needs a refinement then. What platform are we
> talking about?
>
> Alpha.
>
> Can you put the test for partial into REG_PARM_STACK_SPACE or what
> else can one test to detect the partial reg case?
>
> There are no comments near the code in question so I can't even begin
> to understand the issues involved. For example, as I said, why is
> the "in register" test only relevant for one direction of argument growth
> and not the other? That seems very suspicious to me.
But the code is vastly different between the 2 branches of the #ifdef anyway,
and since I can't test on any such platform, I didn't tackle it. The
ARGS_GROW_DOWNWARD case doesn't init alignment_pad in all cases either.
Hmm, maybe the patch below is enough to solve your problems? Do you need
initial_offset_ptr to get aligned for the partial reg case?
Franz.
* function.c (locate_and_pad_parm): Always init alignment_pad.
Add commentary to yesterdays patch.
More information about the Gcc
mailing list