On x86, r236066 caused FAIL: gcc.dg/torture/pr53663-1.c -O1 execution test FAIL: gcc.dg/torture/pr53663-1.c -O2 execution test FAIL: gcc.dg/torture/pr53663-1.c -O3 -g execution test FAIL: gcc.dg/torture/pr53663-1.c -Os execution test FAIL: gcc.dg/torture/pr53663-1.c -O2 -flto -fno-use-linker-plugin -flto-partit ion=none execution test FAIL: gcc.dg/torture/pr53663-1.c -O1 execution test FAIL: gcc.dg/torture/pr53663-1.c -O2 execution test FAIL: gcc.dg/torture/pr53663-1.c -O3 -g execution test FAIL: gcc.dg/torture/pr53663-1.c -Os execution test FAIL: gcc.dg/torture/pr53663-1.c -O2 -flto -fno-use-linker-plugin -flto-partit ion=none execution test with make check-gcc RUNTESTFLAGS="dg-torture.exp=pr53663-1.c --target_board='unix{-m32\ -fpic,-fpic}'"
Mine. Even without -fpic we miscompile this - but twice, cancelling the effect. With -fpic we miscompile it only once, namely v.i = 10; f (&v1, v); v.b = 0; Deleted redundant store v.b = 0; This is because we now figure that the read from v.b results in 0 which is of course wrong (technically it has _Bool type and thus its precision makes the value that GCC can use for optimization zero but it cannot use that "precision" to say the store is redundant (because it stores still 8 bits).
It's a latent issue in unchanged code, not sure how it got exposed by r236066, ah - I removed the VN_WALKREWRITE check that isn't really necessary.
Author: rguenth Date: Wed May 11 14:04:32 2016 New Revision: 236122 URL: https://gcc.gnu.org/viewcvs?rev=236122&root=gcc&view=rev Log: 2016-05-11 Richard Biener <rguenther@suse.de> PR tree-optimization/71055 * tree-ssa-sccvn.c (vn_reference_lookup_3): When native-interpreting sth with precision not equal to access size verify we don't chop off bits. * gcc.dg/torture/pr71055.c: New testcase. Added: trunk/gcc/testsuite/gcc.dg/torture/pr71055.c Modified: trunk/gcc/ChangeLog trunk/gcc/testsuite/ChangeLog trunk/gcc/tree-ssa-sccvn.c
Fixed.
Author: rguenth Date: Wed Jan 4 12:35:32 2017 New Revision: 244053 URL: https://gcc.gnu.org/viewcvs?rev=244053&root=gcc&view=rev Log: 2017-01-04 Richard Biener <rguenther@suse.de> Backport from mainline 2016-05-11 Richard Biener <rguenther@suse.de> PR tree-optimization/71055 * tree-ssa-sccvn.c (vn_reference_lookup_3): When native-interpreting sth with precision not equal to access size verify we don't chop off bits. * gcc.dg/torture/pr71055.c: New testcase. Added: branches/gcc-6-branch/gcc/testsuite/gcc.dg/torture/pr71055.c Modified: branches/gcc-6-branch/gcc/ChangeLog branches/gcc-6-branch/gcc/testsuite/ChangeLog branches/gcc-6-branch/gcc/tree-ssa-sccvn.c