diff options
author | Richard Guenther <rguenther@suse.de> | 2011-10-10 14:25:34 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2011-10-10 14:25:34 +0000 |
commit | 4d8b88e8f2eecec56b16736f27e708ec20a222cb (patch) | |
tree | a854ae7e36552eb0719563335c71134fc0b20baf /gcc/fold-const.c | |
parent | ff8e7c4d682099d61e81a20b465280bcc7cdaab5 (diff) | |
download | gcc-4d8b88e8f2eecec56b16736f27e708ec20a222cb.zip gcc-4d8b88e8f2eecec56b16736f27e708ec20a222cb.tar.gz gcc-4d8b88e8f2eecec56b16736f27e708ec20a222cb.tar.bz2 |
re PR middle-end/50195 (Linking time error with -fast-math -O0)
2011-10-10 Richard Guenther <rguenther@suse.de>
PR middle-end/50195
* fold-const.c (fold_binary_loc): Canonicalize x*x to pow (x, 2)
only when optimizing.
* gcc.dg/builtins-47.c: Optimize.
From-SVN: r179752
Diffstat (limited to 'gcc/fold-const.c')
-rw-r--r-- | gcc/fold-const.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c index 7568c6f..5b0fea7 100644 --- a/gcc/fold-const.c +++ b/gcc/fold-const.c @@ -10693,9 +10693,9 @@ fold_binary_loc (location_t loc, } } - /* Optimize x*x as pow(x,2.0), which is expanded as x*x. */ + /* Canonicalize x*x as pow(x,2.0), which is expanded as x*x. */ if (!in_gimple_form - && optimize_function_for_speed_p (cfun) + && optimize && operand_equal_p (arg0, arg1, 0)) { tree powfn = mathfn_built_in (type, BUILT_IN_POW); |