On 10/12/19 3:46 AM, Segher Boessenkool wrote:
> Two spaces after a period.  How about something like
> 
>       /* Callee's options should be a subset of the caller's.  Also, a 
> function
>        without VSX enabled should not be inlined into one with VSX enabled,
>        because it may be important it is disabled there; see PR70010.  */
> 
> It's not clear to me why this is important, and what makes -mvsx different
> from all other similar options?

I agree, there is nothing special about VSX here and the other similar options
like Altivec, HTM, etc., etc. should all be handled similarly.

I agree with your other comment that we should be looking at explicit option
usage versus default options.  However, the way we now implement default CPU,
the gcc driver always passes a -mcpu= option to cc1 no matter if the user
used -mcpu= or not, so -mcpu= will always looks like an explicit option.
So when -mcpu=power[789] is passed to cc1 (via explicit user usage or default
cpu), does that look like -mvsx was also explicitly used?  I'm guessing not.

So if we have a caller compiled with -mcpu=power8 (VSX and Altivec are 
implicitly
enabled) and a callee compiled with -mcpu=power6 (VSX and Altivec is not enabled
...implicitly), do we allow inlining?  I would say we shouldn't, but the VSX
and Altivec flags in the callee are a subset of the caller's flags.  It must
be that the ISA* flags in rs6000_isa_flags that save us from not inlining?

Therefore, I'd say that the callee's flags should be a subset of the caller's
flags as the current code does now, but we should be also checking that the
callee doesn't have an explicitly used option flag(s) that conflicts with
the callers flags (implicit or explicit).  That means the caller's flags
must match exactly the callee's flags, for those flags that were explicitly
set in the callee.


Peter

Reply via email to