Summary: | generates non-optimal instruction... | ||
---|---|---|---|
Product: | binutils | Reporter: | Alan Larson <larson> |
Component: | gas | Assignee: | Alan Modra <amodra> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | bug-binutils |
Priority: | P2 | ||
Version: | pre-2.15 | ||
Target Milestone: | --- | ||
Host: | i386-pc-freebsd | Target: | i386 |
Build: | Last reconfirmed: | ||
Bug Depends on: | 997 | ||
Bug Blocks: |
Description
Alan Larson
2005-06-08 20:28:11 UTC
This is a result of delayed expression evaluation. If you assemble without listings turned on, the optimal push insn will be chosen. Some background info I should have added to help people looking through the bug database. <bje> alanm: Any opinions on PR 998? <bje> I gather from your comments that you've stated, "That's the way it is". Is there anything more to do here? <alanm> bje, depends on how much work you want to do. the problem is that with listings turned on, each line is in a separate frag. you generally can't subtract labels in different frags (one of the frags might be something like .align) until final placement, so we punt when evaluating the size expression. you could a) rewrite gas listing code from scratch to not use frags, b) look back thru some frags when evaluating expressions <bje> It seems like a pretty obscure corner case. <alanm> yes, but people do keep running into the problem, even with listings disabled. eg. you might need a new frag simply because memory allocated for old one runs out. in that case the two frags have a fixed relationship wrt start address, so you could subtract a label in one frag from a label in the other. not doing so breaks anything that depends on being able to evaluate such an expression early. conditional assembly, .org/.space, relax... |