aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-math-opts.c
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2010-01-03 15:23:29 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2010-01-03 15:23:29 +0000
commitba1ee2281d44f1443bae38966276221abedd39d7 (patch)
tree5f0ecd392be5832e39047b93c683ffeb2d711b3b /gcc/tree-ssa-math-opts.c
parent5004040e8df391914c26eb02c3514578dded2c66 (diff)
downloadgcc-ba1ee2281d44f1443bae38966276221abedd39d7.zip
gcc-ba1ee2281d44f1443bae38966276221abedd39d7.tar.gz
gcc-ba1ee2281d44f1443bae38966276221abedd39d7.tar.bz2
re PR rtl-optimization/42589 (bswap optimization does not work for 32bit (but for 64bit) on 64bit registers)
2010-01-03 Richard Guenther <rguenther@suse.de> PR tree-optimization/42589 * tree-ssa-math-opts.c (execute_optimize_bswap): Allow double-word expansion of bswap32. * gcc.target/i386/pr42589.c: New testcase. From-SVN: r155588
Diffstat (limited to 'gcc/tree-ssa-math-opts.c')
-rw-r--r--gcc/tree-ssa-math-opts.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/gcc/tree-ssa-math-opts.c b/gcc/tree-ssa-math-opts.c
index 2a984a1..c46a57f 100644
--- a/gcc/tree-ssa-math-opts.c
+++ b/gcc/tree-ssa-math-opts.c
@@ -1111,8 +1111,9 @@ execute_optimize_bswap (void)
&& optab_handler (bswap_optab, SImode)->insn_code !=
CODE_FOR_nothing);
bswap64_p = (built_in_decls[BUILT_IN_BSWAP64]
- && optab_handler (bswap_optab, DImode)->insn_code !=
- CODE_FOR_nothing);
+ && (optab_handler (bswap_optab, DImode)->insn_code !=
+ CODE_FOR_nothing
+ || (bswap32_p && word_mode == SImode)));
if (!bswap32_p && !bswap64_p)
return 0;