https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111828

--- Comment #6 from Peter Bergner <bergner at gcc dot gnu.org> ---
(In reply to Kewen Lin from comment #3)
> The motivation of this request is to try our best to make power10 attributed
> code inline more power8/power9 attribute code which likely includes some
> inline asm but not HTM related as the quoted OSS shows. For now, for one
> function which has any non-empty inline asm string, we would consider it's
> possible to have HTM code so it's unsafe to inline it.

We've hit this issue (attempting to inline some Power8/9 function into a
Power10 caller) before with another project (I forget which) and the solution
used was to add no-htm to the attribute target options (ie,
"cpu=power8,no-htm").


> Users usually think higher cpu attributed code can safely inline lower cpu
> attributed code, but it's out of expectation for power10 code inlining
> power8/power9 code as we drops HTM from power10. If we can support it
> better, users don't need more extra efforts to teach about it.

Ideally, we could just go back in time and not enable HTM by default on
Power8/9 and force the user to always use -mhtm if they need HTM support.  That
ship has sailed though.

That said, I think nearly all (all?) HTM usage on Power uses our HTM built-in
functions.  Maybe we could remove OPTION_MASK_HTM from the power8/power9
default flags and only add it back in if we detect the use of an HTM built-in
function?

Reply via email to