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 2/6 v4]: Merge from Stack Branch - Collect Alignment Info


Richard Sandiford <rdsandiford@googlemail.com> writes:
y> "H.J. Lu" <hjl.tools@gmail.com> writes:
>>> What did you think of having the separate function?  The idiom
>>> occurs quite often in your patch.
>>
>> There are 4 places with
>>
>> if (crtl->stack_alignment_estimated < align)
>>   {
>>     gcc_assert(!crtl->stack_realign_processed);
>>     crtl->stack_alignment_estimated = align;
>>   }
>>
>> in 2 different files and 2 places with some differences.  A signle
>> helper function may make people think it should be used everywhere.
>
> It's the "2 places with differences" I'm concerned about.  I think
> one of the differences you mean is:
>
> +          if (!crtl->stack_realign_processed)
> +	    {
> +	      /* Can't exceed MAX_STACK_ALIGNMENT.  */
> +	      if (boundary >= MAX_STACK_ALIGNMENT)
> +		boundary = MAX_STACK_ALIGNMENT;
> +	      crtl->stack_alignment_estimated = boundary;
> +	    }
> +	  else
> +	    gcc_assert (!crtl->stack_realign_finalized
> +			&& crtl->stack_realign_needed);
>
> but it looked to me like this was strictly more general than the
> version you give.  Let's call the version you quote "A" and the
> version immediately above "B".  If A isn't strictly more general
> than B -- in other words, if it isn't safe to use B in places
> where we use A -- then why?  This wasn't obvious (to me anyroad).
> That's why I used B in the suggested helper function.

Dammit, I knew those letters would catch me out.  I meant
"if B isn't strictly more general than A".

Richard


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