Hi Yuri, On Thu, Feb 15, 2018 at 08:13:38PM +0000, Yury Gribov wrote: > This is an updated version of patch for PR 81535. The patch was last > discussed in November. The new version addresses Segher's comments in > https://gcc.gnu.org/ml/gcc-patches/2017-08/msg00558.html
> FTR here's an excerpt from > https://gcc.gnu.org/ml/gcc-patches/2017-11/msg02231.html which > explains the reasoning behind PR 56727 (which introduced regression in > PR 81535): > > >> Is it correct that current GCC does not do the call via the PLT? > > > > Well, it was decided in > > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56727 that it would be a > > valid optimization because the only way to expose the difference would > > be through dlsym hackery. Note that original PowerPC use-case > > (reported in https://sourceware.org/bugzilla/show_bug.cgi?id=21116) > > would benefit from this optimization as because PLT call + indirection > > would be replaced by normal PC-relative call. Yup. > From 68ef3663aed0bb6f33c0c14e98544f7f7b797469 Mon Sep 17 00:00:00 2001 > From: Yury Gribov <tetra2...@gmail.com> > Date: Thu, 15 Feb 2018 07:48:57 +0000 > Subject: [PATCH] Updated PowerPC tests. > > gcc/testsuite/ > > 2018-02-15 Yury Gribov <tetra2...@gmail.com> > > PR target/81535 > * gcc.dg/pr56727-1.c: Prevent tailcalls and update for powerpc*-*-*. > * gcc.dg/pr56727-2.c: Ditto. > * gcc.target/powerpc/pr79439.c: Renamed to... > * gcc.target/powerpc/pr79439-1.c: ...this. > * gcc.target/powerpc/pr79439-2.c: New test. > * gcc.target/powerpc/pr79439-3.c: New test. > --- /dev/null > +++ b/gcc/testsuite/gcc.target/powerpc/pr79439-1.c > @@ -0,0 +1,28 @@ > +/* { dg-do compile { target { powerpc64*-*-linux* && lp64 } } } */ > +/* { dg-options "-O2 -fpic -fno-reorder-blocks" } */ Please do /* { dg-do compile { target { powerpc*-*-linux* && lp64 } } } */ that is, compile on _all_ powerpc, whether the default target of the compiler is 64-bit or not (we only care about the *current* target). Same for the other tests. Okay for trunk with that change. Thanks for working on this! Segher