Load PRE is scheduled for 4.2, I'm creating this bug because load PRE is currently split between CSE and GCSE (this bug blocks the "optimizations caught by CSE" meta-bug, PR19721). Given this code,
unsigned outcnt; extern void flush_outbuf(void); void bi_windup(unsigned char *outbuf, unsigned char bi_buf) { outbuf[outcnt] = bi_buf; if (outcnt == 16384) flush_outbuf(); outbuf[outcnt] = bi_buf; } we'd want the code to become void bi_windup(unsigned char *outbuf, unsigned char bi_buf) { int t1 = outcnt; outbuf[t1] = bi_buf; int t2 = outcnt, t3; if (t2 == 16384) { flush_outbuf(); t3 = outcnt; } else t3 = t2; outbuf[t3] = bi_buf; } currently this optimization is split between CSE (with path following) and GCSE. Actually, GCSE is able to do it alone if the number of GCSE passes is increased. -- Summary: load PRE is missing Product: gcc Version: 4.1.0 Status: UNCONFIRMED Severity: enhancement Priority: P2 Component: tree-optimization AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: bonzini at gcc dot gnu dot org CC: dberlin at gcc dot gnu dot org,gcc-bugs at gcc dot gnu dot org OtherBugsDependingO 19721 nThis: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23455