Summary: | avr wrong size in asm comment (peephole) | ||
---|---|---|---|
Product: | gcc | Reporter: | Dmitry K. <dmixm> |
Component: | target | Assignee: | Not yet assigned to anyone <unassigned> |
Status: | RESOLVED FIXED | ||
Severity: | minor | CC: | eric.weddington, gcc-bugs |
Priority: | P5 | ||
Version: | 4.0.0 | ||
Target Milestone: | 4.3.0 | ||
Host: | Target: | avr | |
Build: | Known to work: | ||
Known to fail: | Last reconfirmed: | 2005-03-10 14:20:10 |
Description
Dmitry K.
2005-01-29 04:25:39 UTC
I can confirm this for gcc-4.0.0-20050228 This is almost certainly caused by code peepholes doing last minute optimisation of the code just before the assembler is generated. Prior to that, all RTL instructions have a length (in 16 bit words) that is *soley* used to select the appropriate jump and branch instructions. The size comments are generated from those lengths. If a peephole does indeed change some instructions, they will quite likely over estimate the final size (as is the case presented here) The length (and so size) is fine if it over estimates the actual size (Jumps/branches can always work over shorter distances.) The actual jump displacments are based on labels so they are unaffected. There may be some other areas of the backend that apply worse-case estimates of asm instruction size to avoid the complexity of calculating every situation. However, peepholes definitely do this! I would suggest this is a non-bug as the size is an internal compiler debug comment and there is no regression, misoptimisation or similar downside. If the size ever under-estimates the true size THAT IS A BUG! Also note peepholes should really be changed to peephole2. The code that which print size of prologue and epilogue was removed when avr port was switched from asm-prologue/epilogue to RTL-prologue/epilogue. Anatoly. Fixed in trunk. |