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

--- Comment #24 from Tamar Christina <tnfchris at gcc dot gnu.org> ---
Do you have a repro for this one? compiling the kernel with
`CFLAGS="march=-armv4t"` doesn't seem to reproduce the original issue.

But the scenario should be working without needing to separate out the
functions, as long as you're in-lining the right direction.

Making a handwritten example works fine:

__attribute__((always_inline, target("arch=armv4t")))
static inline int do_this (int x)
{
  return x*x;
}

#pragma GCC target("arch=armv5te")                                              

int do_that (int x, int y)
{
  return do_this (x - y);
}

what would generate the error you're getting is if you're in-lining the armv5te
code into armv4t which is an actual error

__attribute__((always_inline, target("arch=armv5te")))
static inline int do_this (int x)
{
  return x*x;
}

#pragma GCC target("arch=armv4t")                                               

int do_that (int x, int y)
{
  return do_this (x - y);
}

The compiler only rejects the inlining if you've told it to always inline and
when the function to be inline's feature bits are not a strict subset of the
function in which it is to inline

Reply via email to