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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@155588
138bc75d-0d04-0410-961f-
82ee72b054a4
+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.
+
2010-01-03 Steven Bosscher <steven@gcc.gnu.org>
* postreload-gcse.c (insert_expr_in_table): Replace BLOCK_NUM
2010-01-03 Richard Guenther <rguenther@suse.de>
+ PR tree-optimization/42589
+ * gcc.target/i386/pr42589.c: New testcase.
+
+2010-01-03 Richard Guenther <rguenther@suse.de>
+
PR tree-optimization/42438
* gcc.dg/tree-ssa/ssa-pre-27.c: New testcase.
--- /dev/null
+/* { dg-do compile } */
+/* { dg-require-effective-target ilp32 } */
+/* { dg-options "-O2 -march=i486" } */
+
+void
+foo (unsigned long long *p)
+{
+ unsigned long long tmp;
+ tmp = *p;
+ tmp = (tmp >> 32) | (tmp << 32);
+ tmp = (((tmp & 0xff00ff00ff00ff00ULL) >> 8)
+ | ((tmp & 71777214294589695ULL) << 8));
+ *p = (((tmp & 0xffff0000ffff0000ULL) >> 16)
+ | ((tmp & 281470681808895ULL) << 16));
+}
+
+/* { dg-final { scan-assembler-times "bswap" 2 } } */
&& 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;