https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61306
Oleg Endo <olegendo at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |olegendo at gcc dot gnu.org --- Comment #10 from Oleg Endo <olegendo at gcc dot gnu.org> --- (In reply to thopre01 from comment #6) > Author: thopre01 > Date: Wed Jun 11 10:04:33 2014 > New Revision: 211444 > > URL: http://gcc.gnu.org/viewcvs?rev=211444&root=gcc&view=rev > Log: > 2014-06-11 Thomas Preud'homme <thomas.preudho...@arm.com> > > gcc/ > PR tree-optimization/61306 > * tree-ssa-math-opts.c (struct symbolic_number): Store type of > expression instead of its size. > (do_shift_rotate): Adapt to change in struct symbolic_number. Return > false to prevent optimization when the result is unpredictable due to > arithmetic right shift of signed type with highest byte is set. > (verify_symbolic_number_p): Adapt to change in struct symbolic_number. > (init_symbolic_number): Likewise. > (find_bswap_or_nop_1): Likewise. Return NULL to prevent optimization > when the result is unpredictable due to sign extension. > > gcc/testsuite/ > * gcc.c-torture/execute/pr61306-1.c: New test. > * gcc.c-torture/execute/pr61306-2.c: Likewise. > * gcc.c-torture/execute/pr61306-3.c: Likewise. > > Added: > trunk/gcc/testsuite/gcc.c-torture/execute/pr61306-1.c > trunk/gcc/testsuite/gcc.c-torture/execute/pr61306-2.c > trunk/gcc/testsuite/gcc.c-torture/execute/pr61306-3.c > Modified: > trunk/gcc/ChangeLog > trunk/gcc/testsuite/ChangeLog > trunk/gcc/tree-ssa-math-opts.c It seems that after this commit, one SH bswap32 test started to fail. Comparing the two test reports: https://gcc.gnu.org/ml/gcc-testresults/2014-06/msg00961.html https://gcc.gnu.org/ml/gcc-testresults/2014-06/msg01086.html shows a new failure for gcc.target/sh/pr53568-1.c. The function int test_func_02 (int a) { /* 1x swap.w 2x swap.b */ return (((a >> 0) & 0xFF) << 24) | (((a >> 8) & 0xFF) << 16) | (((a >> 16) & 0xFF) << 8) | (((a >> 24) & 0xFF) << 0); } now fails to produce a bswap32.