Summary: | [if-conversion] dead type-unsafe load replaces type-safe load | ||
---|---|---|---|
Product: | gcc | Reporter: | Tom de Vries <vries> |
Component: | rtl-optimization | Assignee: | Tom de Vries <vries> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | andersk, rguenth |
Priority: | P3 | Keywords: | alias, patch, wrong-code |
Version: | 4.8.4 | ||
Target Milestone: | --- | ||
Host: | Target: | ||
Build: | Known to work: | ||
Known to fail: | Last reconfirmed: | 2014-08-04 00:00:00 | |
Attachments: |
test-case
patch to fix if-conversion |
Description
Tom de Vries
2014-08-04 00:22:04 UTC
Heh, interesting set of events ;) Now it is interesting how much we desire to perform the tail-merging - we _could_ change the alias sets of loads (and stores...) to a "common" one (either if they are "equal" or just zero otherwise). Depends on how much we like this kind of pessimization. Same for the RTL bits of course. Btw, I still see the conditional execution after RTL expansion, just cfglayout mode doesn't have unconditonal gotos for the edges. Created attachment 33242 [details] patch to fix if-conversion (In reply to Richard Biener from comment #1) > Heh, interesting set of events ;) > > Now it is interesting how much we desire to perform the tail-merging - we > _could_ > change the alias sets of loads (and stores...) to a "common" one (either if > they > are "equal" or just zero otherwise). Depends on how much we like this kind > of pessimization. > > Same for the RTL bits of course. > > Btw, I still see the conditional execution after RTL expansion, just > cfglayout mode doesn't have unconditonal gotos for the edges. Right, when doing fdump-rtl-all, it looks like fallthrough, but it isn't, I forgot. So it's just if-conversion that does the wrong thing. Attached patch fixes 4.8 if-conversion in a conservative way (I suppose we want a conservative fix for 4.8 and 4.9). OK for testing? (In reply to Richard Biener from comment #1) > Heh, interesting set of events ;) I have a store version that fires on mips64 with a modified testcase too, see bug 62030. Author: vries Date: Thu Aug 14 16:13:59 2014 New Revision: 213970 URL: https://gcc.gnu.org/viewcvs?rev=213970&root=gcc&view=rev Log: Fix if-conversion pass for dead type-unsafe code 2014-08-14 Tom de Vries <tom@codesourcery.com> PR rtl-optimization/62004 PR rtl-optimization/62030 * ifcvt.c (rtx_interchangeable_p): New function. (noce_try_move, noce_process_if_block): Use rtx_interchangeable_p. * emit-rtl.c (mem_attrs_eq_p): Remove static. * emit-rtl.h (mem_attrs_eq_p): Declare. * gcc.dg/pr62004.c: New test. * gcc.dg/pr62030.c: Same. * gcc.target/mips/pr62030-octeon.c: Same. Added: trunk/gcc/testsuite/gcc.dg/pr62004.c trunk/gcc/testsuite/gcc.dg/pr62030.c trunk/gcc/testsuite/gcc.target/mips/pr62030-octeon.c Modified: trunk/gcc/ChangeLog trunk/gcc/emit-rtl.h trunk/gcc/ifcvt.c trunk/gcc/testsuite/ChangeLog Author: vries Date: Fri Aug 15 21:23:21 2014 New Revision: 214044 URL: https://gcc.gnu.org/viewcvs?rev=214044&root=gcc&view=rev Log: Fix if-conversion pass for dead type-unsafe code 2014-08-15 Tom de Vries <tom@codesourcery.com> Backport from mainline: 2014-08-14 Tom de Vries <tom@codesourcery.com> PR rtl-optimization/62004 PR rtl-optimization/62030 * ifcvt.c (rtx_interchangeable_p): New function. (noce_try_move, noce_process_if_block): Use rtx_interchangeable_p. * gcc.dg/pr62004.c: New test. * gcc.dg/pr62030.c: Same. * gcc.target/mips/pr62030-octeon.c: Same. 2014-08-05 Richard Biener <rguenther@suse.de> * emit-rtl.h (mem_attrs_eq_p): Declare. * emit-rtl.c (mem_attrs_eq_p): Export. Added: branches/gcc-4_9-branch/gcc/testsuite/gcc.dg/pr62004.c branches/gcc-4_9-branch/gcc/testsuite/gcc.dg/pr62030.c branches/gcc-4_9-branch/gcc/testsuite/gcc.target/mips/pr62030-octeon.c Modified: branches/gcc-4_9-branch/gcc/ChangeLog branches/gcc-4_9-branch/gcc/emit-rtl.c branches/gcc-4_9-branch/gcc/emit-rtl.h branches/gcc-4_9-branch/gcc/ifcvt.c branches/gcc-4_9-branch/gcc/testsuite/ChangeLog Author: vries Date: Sat Aug 16 17:38:04 2014 New Revision: 214067 URL: https://gcc.gnu.org/viewcvs?rev=214067&root=gcc&view=rev Log: Fix if-conversion pass for dead type-unsafe code 2014-08-15 Tom de Vries <tom@codesourcery.com> Backport from mainline: 2014-08-14 Tom de Vries <tom@codesourcery.com> PR rtl-optimization/62004 PR rtl-optimization/62030 * ifcvt.c (rtx_interchangeable_p): New function. (noce_try_move, noce_process_if_block): Use rtx_interchangeable_p. * gcc.dg/pr62004.c: New test. * gcc.dg/pr62030.c: Same. * gcc.target/mips/pr62030-octeon.c: Same. 2014-08-05 Richard Biener <rguenther@suse.de> * emit-rtl.h (mem_attrs_eq_p): Declare. * emit-rtl.c (mem_attrs_eq_p): Export. Added: branches/gcc-4_8-branch/gcc/testsuite/gcc.dg/pr62004.c branches/gcc-4_8-branch/gcc/testsuite/gcc.dg/pr62030.c branches/gcc-4_8-branch/gcc/testsuite/gcc.target/mips/pr62030-octeon.c Modified: branches/gcc-4_8-branch/gcc/ChangeLog branches/gcc-4_8-branch/gcc/emit-rtl.c branches/gcc-4_8-branch/gcc/emit-rtl.h branches/gcc-4_8-branch/gcc/ifcvt.c branches/gcc-4_8-branch/gcc/testsuite/ChangeLog |