[PATCH, TESTSUITE]: Fix extra testsuite failures with -fpic/-fPIC.

Kaveh R. Ghazi ghazi@caip.rutgers.edu
Tue Sep 1 20:59:00 GMT 2009


> From: "Richard Henderson" <rth@redhat.com>
>
>> For the C test cases, at least, why not fix this instead
>> by making the functions static?  If the tests really rely
>> on local binding, that is...
>
> I prefer not to modify the original testcase code if possible.  Sometimes
> the author wanted specifically to test whether global functions were
> optimized.  Most of the time, global functions should work (and do for
> regular non-pic passes).  It's only when I add manually -fpic to the
> RUNTESTFLAGS that the error occurs.  So I think adding -fpie is reasonable
> for these cases.
>
> In these particular tests, we do really rely on local binding.  I.e. -fpic
> will prevent inlining, auto-detecting pure/const functions and certain
> whole file optimizations because the global functions can be replaced at
> link-time.  Specifying -fpie allows GCC to reassert these optimizations
> and the tests all pass (correctly IMHO) without changing the test (by
> making it static) for the non-pic default case.

Ping: http://gcc.gnu.org/ml/gcc-patches/2009-08/msg01167.html

The fortran bits went in separately, so just inline-3.c and
local-pure-const.c are awaiting.

I explained my rationale for preferring -fpie over using static when the
tests are run with -fpic.  Is there still any disagreement over this patch
or may I install it?

        Thanks,
        --Kaveh



More information about the Gcc-patches mailing list