Fix for "Too restrictive sanity check"
Jeffrey A Law
law@cygnus.com
Wed Apr 19 15:30:00 GMT 2000
In message < 20000419130601.A11198@atrey.karlin.mff.cuni.cz >you write:
> Hi
> Interestingly this testcase exhibits two unrelated bugs. First one is in
> my sanity checking. It is done for sibbling calls too, where it is incorre
> ct
> since my last calls.c patch (it did before).
>
> Second is stack missalignment, that don't show actually in the code (since
> another sequence is choosed by sibcall), but the purpose is obvious:
> first compute_argument_block_size is used to caluculate size of argument
> block to get proper alignment once they are pused and then precompute_argum
> ents
> is called that expands another call resulting in missaligning stack (and
> adjusting stack_pointer_delta).
>
> The fix is to call compute_argument_block_size later. There are two
> uses of args_size in between. First one is in precompute_arguments.
> I have patch approved to avoid this, since it is useless. Second is in
> finalize_must_preallocate. I've did same change for this code in my home
> tree. The rationale is, that finalize_must_preallocate use args_size to
> decide whether it is better to precompute arguments (and direct structures
> to it) or not precompute (and require pushing). Ratio of structs over
> args size is calculated and when it exceeds 50%, preallocation is done.
>
> Author had unadjusted args size in mind here, so in fact this is third
> bug fixed by this patch.
>
> Alexandre: this obsolettes you patch, but please try to get approval for
> the testcase, it is definitly interesting from the calls.c point of
> view. Thank you for pointing this out.
>
> Honza
>
> Wed Apr 19 12:54:31 MET DST 2000 Jan Hubicka <jh@suse.cz>
> * calls.c (expand_call): Call compute_argument_block_size right
> before allocating the block; update comment; don't do alignment
> sanity checking for sibbling call; use args_size instead of
> unadjusted_args_size before args_size is adjusted.
This patch is clearly wrong.
compute_argument_block_size modifies the data in args_size which needs to
happen before the call to finalize_must_preallocate.
Please do _not_ install this patch.
jeff
More information about the Gcc-patches
mailing list