[Bug target/39942] Nonoptimal code - leaveq; xchg %ax,%ax; retq

jakub at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Thu Apr 30 09:07:00 GMT 2009



------- Comment #16 from jakub at gcc dot gnu dot org  2009-04-30 09:07 -------
Created an attachment (id=17783)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=17783&action=view)
gcc45-pr39942.patch

Patch that attempts to take into account .p2align directives that are emitted
for (some) CODE_LABELs and also the gen_align insns that the pass itself
inserts.  For a CODE_LABEL, say .p2align 16,,10 means either that the .p2align
directive starts a new 16 byte page (then insns before it are never
interesting), or nothing was skipped because more than 10 bytes would need to
be skipped.  But that means the current group could contain only 5 or less
bytes of instructions before the label, so again, we don't have to look at
instructions not in the last 5 bytes.

Another fix is that for MAX_SKIP < 7, ASM_OUTPUT_MAX_SKIP_ALIGN shouldn't emit
the second .p2align 3, which might (and often does) skip more than MAX_SKIP
bytes (up to 7).


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39942



More information about the Gcc-bugs mailing list