On 22/04/16 11:34, Marc Glisse wrote:
On Fri, 22 Apr 2016, Kyrill Tkachov wrote:
On 22/04/16 10:43, Kyrill Tkachov wrote:
On 22/04/16 10:42, Marc Glisse wrote:
On Fri, 22 Apr 2016, Kyrill Tkachov wrote:
2016-04-21 Marc Glisse <marc.gli...@inria.fr>
gcc/
* match.pd (min(-x, -y), max(-x, -y), min(~x, ~y), max(~x, ~y)):
New transformations.
gcc/testsuite/
* gcc.dg/tree-ssa/minmax-2.c: New testcase.
I see the new testcase failing on aarch64:
FAIL: gcc.dg/tree-ssa/minmax-2.c scan-tree-dump optimized "__builtin_fmin"
Strange, it seems to work in
https://gcc.gnu.org/ml/gcc-testresults/2016-04/msg02120.html
Is that on some freestanding kind of setup where the builtin might be disabled?
Ah, this is aarch64-none-elf which uses newlib as the C library.
Let me check on aarch64-none-linux-gnu and get back to you.
Yeah, I see it passing on aarch64-none-linux-gnu.
Do we have an appropriate effective target check to gate this test on?
I don't know, I have a hard time finding something related. I am not even convinced the test should be skipped. It looks like __builtin_fmax was recognized, otherwise you would get a warning and a conversion int-double. Maybe
gimple_call_combined_fn rejects it? Ah, builtins.def declares it with DEF_C99_BUILTIN, which checks targetm.libc_has_function (function_c99_misc). I assume newlib fails that check? That would make c99_runtime a relevant target check.
Yeah, adding the below makes this test UNSUPPORTED on aarch64-none-elf.
/* { dg-add-options c99_runtime } */
/* { dg-require-effective-target c99_runtime } */
I'll prepare a patch.
Thanks,
Kyrill