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

--- Comment #17 from Kewen Lin <linkw at gcc dot gnu.org> ---
(In reply to Mathieu Malaterre from comment #16)
> Interesting, the following works for me:
> 
> % /usr/bin/c++  -O1 -mcpu=power8 -mno-htm -flto=auto -c skeleton_test.cc

Yeah, the suggestion on an extra option -mno-htm is for command line options,
since they are used for compiling the callee PreventElision.

It makes that:
  - the callee(PreventElision): -mcpu=power8 -mno-htm
  - caller: -mcpu=power10

caller doesn't have the htm capability (as it's compiled with p10 which drops
htm), but the callee claims it doesn't need htm with -mno-htm, so it's safe to
do the inlining.

If you want to adjust the pragma

#define HWY_BEFORE_NAMESPACE() HWY_PUSH_ATTRIBUTES(",cpu=power10")

, it should be:

#define HWY_BEFORE_NAMESPACE() HWY_PUSH_ATTRIBUTES(",cpu=power10,htm")

it pretends that the caller has the htm support, then it's also fine.

Reply via email to