-
- Downloads
Move cabs simplifications to match.pd
The fold code also expanded cabs(x+yi) to fsqrt(x*x+y*y) when optimising for speed. tree-ssa-math-opts.c has this transformation too, but unlike the fold code, it first checks whether the target implements the sqrt optab. The patch simply removes the fold code and keeps the tree-ssa-math-opts.c logic the same. gcc.dg/lto/20110201-1_0.c was relying on us replacing cabs with fsqrt even on targets where fsqrt is itself a library call. The discussion leading up to that patch suggested that we only want to test the fold on targets with a square root instruction, so it would be OK to skip the test on other targets: https://gcc.gnu.org/ml/gcc-patches/2011-07/msg01961.html https://gcc.gnu.org/ml/gcc-patches/2011-07/msg02036.html The patch does that using the sqrt_insn effective target. It's possible that removing the tree folds renders the LTO trick unnecessary, but since the test was originally for an ICE, it seems better to leave it as-is. Tested on x86_64-linux-gnu, aarch64-linux-gnu and arm-linux-gnueabi. 20110201-1_0.c passes on all three. gcc/ * builtins.c (fold_builtin_cabs): Delete. (fold_builtin_1): Update accordingly. Handle constant arguments here. * match.pd: Add rules previously handled by fold_builtin_cabs. gcc/testsuite/ * gcc.dg/lto/20110201-1_0.c: Restrict to sqrt_insn targets. Add associated options for arm*-*-*. (sqrt): Remove dummy definition. From-SVN: r229141
Showing
- gcc/ChangeLog 6 additions, 0 deletionsgcc/ChangeLog
- gcc/builtins.c 5 additions, 77 deletionsgcc/builtins.c
- gcc/match.pd 19 additions, 1 deletiongcc/match.pd
- gcc/testsuite/ChangeLog 6 additions, 0 deletionsgcc/testsuite/ChangeLog
- gcc/testsuite/gcc.dg/lto/20110201-1_0.c 2 additions, 9 deletionsgcc/testsuite/gcc.dg/lto/20110201-1_0.c
Loading
Please register or sign in to comment