On Tue, 2020-01-14 at 23:21 +0100, Andreas Schwab wrote:
> On Jan 14 2020, Jeff Law wrote:
> 
> > diff --git a/libiberty/aclocal.m4 b/libiberty/aclocal.m4
> > index bf8a907100f..381ed3b27e3 100644
> > --- a/libiberty/aclocal.m4
> > +++ b/libiberty/aclocal.m4
> > @@ -147,7 +147,7 @@ if test $ac_cv_os_cray = yes; then
> >  fi
> >  
> >  AC_CACHE_CHECK(stack direction for C alloca, ac_cv_c_stack_direction,
> > -[AC_TRY_RUN([find_stack_direction ()
> > +[AC_TRY_RUN([__attribute__ ((noclone,noinline)) find_stack_direction ()
> 
> That makes the test GCC specific, which doesn't actually need the test
> in the first place.  That looks pointless.
It's used by alloca.c to implement a C based alloca.  It needs to know
what direction stacks grow so that it knows if it's at a higher point
in the call chain and thus should collect objects allocated at deeper
points in the call chain.

Jakub has a good point though.  THe attributes probably need to be
conditional on GCC and the specific version of GCC being used.

jeff

Reply via email to