http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60438

--- Comment #25 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
(In reply to linzj from comment #23)
> (In reply to Richard Henderson from comment #19)
> > Created attachment 32311 [details]
> > proposed patch
> > 
> > Running full tests on this overnight, but it fixes the ICE.
> 
> I try to remove the following hunk from you patch,it compiles Jakub's
> testcase right.Not run the full tests yet.
> diff --git a/gcc/combine-stack-adj.c b/gcc/combine-stack-adj.c
> index 69fd5ea..5abec30 100644
> --- a/gcc/combine-stack-adj.c
> +++ b/gcc/combine-stack-adj.c
> @@ -454,6 +454,14 @@ combine_stack_adjustments_for_block (basic_block bb)
>             {
>               HOST_WIDE_INT this_adjust = INTVAL (XEXP (src, 1));
>  
> +              /* It's quite tricky to adjust the notes associated
> +                with frame related insns.  */
> +             if (RTX_FRAME_RELATED_P (insn))
> +               {
> +                 last2_sp_set = last_sp_set = NULL;
> +                 continue;
> +               }
> +
>               /* If we've not seen an adjustment previously, record
>                  it now and continue.  */
>               if (! last_sp_set)

Perhaps we can handle some most common cases of frame related insns (e.g. if
both have REG_CFA_ADJUST_CFA notes, etc.), perhaps it would be worth it to run
a bootstrap which would log when the above hunk prevented some merging and
append both insns to some /tmp/ file across whole bootstrap, then we could see
what is common enough to care about.

Reply via email to