diff options
author | Richard Sandiford <richard.sandiford@arm.com> | 2015-11-07 09:58:32 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@gcc.gnu.org> | 2015-11-07 09:58:32 +0000 |
commit | 02b7230d3cbfb2208dd723dcd3fd84ba74678004 (patch) | |
tree | 67858dd39a9749ad7dd8ee5a4da40586ef36cf8c /gcc | |
parent | f127ea514dbd61dde99f6d86c05d753748b9f93e (diff) | |
download | gcc-02b7230d3cbfb2208dd723dcd3fd84ba74678004.zip gcc-02b7230d3cbfb2208dd723dcd3fd84ba74678004.tar.gz gcc-02b7230d3cbfb2208dd723dcd3fd84ba74678004.tar.bz2 |
Add -fno-math-errno to gcc.dg/lto/20110201-1_0.c
At the moment the ECF_* flags for a gimple call to a built-in
function are derived from the function decl, which in turn is
derived from the global command-line options. So if the compiler
is run with -fno-math-errno, we always assume functions don't set
errno, regardless of local optimization options. Similarly if the
compiler is run with -fmath-errno, we always assume functions set errno.
This shows up in gcc.dg/lto/20110201-1_0.c, where we compile
the file with -O0 and use -O2 -ffast-math for a specific function.
-O2 -ffast-math is enough for us to convert cabs to sqrt as hoped,
but because of the global -fmath-errno setting, we assume that the
call to sqrt is not pure or const and create vops for it. This makes
it appear to the gimple code that a simple sqrt optab isn't enough.
Later patches move more decisions about maths functions to gimple
and think that in this case we should use:
y = sqrt (x);
if (!(x >= 0))
sqrt (x); // to set errno.
This is being tracked as PR68235. For now the patch adds
-fno-math-errno to the dg-options for this test.
Tested on x86_64-linux-gnu, aarch64-linux-gnu and arm-linux-gnueabi.
gcc/testsuite/
PR tree-optimization/68235
* gcc.dg/lto/20110201-1_0.c: Add -fno-math-errno.
From-SVN: r229917
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/lto/20110201-1_0.c | 4 |
2 files changed, 7 insertions, 2 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index af4a738..18871bf 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2015-11-07 Richard Sandiford <richard.sandiford@arm.com> + + PR tree-optimization/68235 + * gcc.dg/lto/20110201-1_0.c: Add -fno-math-errno. + 2015-11-06 Jeff Law <law@redhat.com> * gcc.dg/tree-ssa/ssa-dom-thread-7.c: Adjust to look for diff --git a/gcc/testsuite/gcc.dg/lto/20110201-1_0.c b/gcc/testsuite/gcc.dg/lto/20110201-1_0.c index 068dddc..2144f07 100644 --- a/gcc/testsuite/gcc.dg/lto/20110201-1_0.c +++ b/gcc/testsuite/gcc.dg/lto/20110201-1_0.c @@ -1,6 +1,6 @@ /* { dg-lto-do run } */ -/* { dg-lto-options { { -O0 -flto } } } */ -/* { dg-lto-options { "-O0 -flto -mfloat-abi=softfp -mfpu=neon-vfpv4" } { target arm*-*-* } } */ +/* { dg-lto-options { { -O0 -flto -fno-math-errno } } } */ +/* { dg-lto-options { "-O0 -flto -fno-math-errno -mfloat-abi=softfp -mfpu=neon-vfpv4" } { target arm*-*-* } } */ /* { dg-require-linker-plugin "" } */ /* { dg-require-effective-target sqrt_insn } */ |