Summary: | Loop header copying code bloat for simple loops that don't benefit | ||
---|---|---|---|
Product: | gcc | Reporter: | Oleg Endo <olegendo> |
Component: | tree-optimization | Assignee: | Not yet assigned to anyone <unassigned> |
Status: | NEW --- | ||
Severity: | enhancement | CC: | hp |
Priority: | P3 | Keywords: | missed-optimization |
Version: | 4.9.0 | ||
Target Milestone: | --- | ||
See Also: | https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55190 | ||
Host: | Target: | sh*-*-* | |
Build: | Known to work: | ||
Known to fail: | Last reconfirmed: | 2014-03-17 00:00:00 |
Description
Oleg Endo
2014-03-15 13:10:14 UTC
For -O2 we do this to enable loop optimizations which almost all require do { } while style loops. This canonicalization can sometimes peel an entire iteration as you can see here, and this canonicalization is not done at -Os unless the loop is determined as hot (so with -Os and profile-feedback some loops may get this treatment). It's hard to undo this transform but that's what would be needed here ... (or make more passes deal with number-of-iterations == n or zero) |