[Bug target/45804] ARM: unnecessary sign extension
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45804 Richard Guenther rguenth at gcc dot gnu.org changed: What|Removed |Added Keywords||missed-optimization Target||arm-*-* Component|c |target Severity|normal |enhancement
[Bug target/45804] ARM: unnecessary sign extension
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45804 Richard Earnshaw rearnsha at gcc dot gnu.org changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED CC||rearnsha at gcc dot gnu.org Resolution||INVALID --- Comment #1 from Richard Earnshaw rearnsha at gcc dot gnu.org 2010-09-27 16:30:35 UTC --- This particular case is invalid. The ARM ABI requires that short and char result types are extended to 32 bits (using signed or unsigned extension as appropriate) before being returned. Since the compiler can't see inside the asm block to work out what is being done it cannot remove the uxth instruction on the result. This does not mean that some of your x-refed reports are invalid though.
[Bug target/45804] ARM: unnecessary sign extension
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45804 --- Comment #2 from Felipe Contreras felipe.contreras at gmail dot com 2010-09-27 19:02:19 UTC --- (In reply to comment #1) This particular case is invalid. The ARM ABI requires that short and char result types are extended to 32 bits (using signed or unsigned extension as appropriate) before being returned. Since the compiler can't see inside the asm block to work out what is being done it cannot remove the uxth instruction on the result. What do you mean by returned? This is an inline function, so it depends entirely on what the referencing code is doing whether or not this value is returned, as function return. Say: if ((read16_be(data) 0xfffe) == 0xfff8) This does not mean that some of your x-refed reports are invalid though. Come again?
[Bug target/45804] ARM: unnecessary sign extension
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45804 --- Comment #3 from Richard Earnshaw rearnsha at gcc dot gnu.org 2010-09-27 21:52:38 UTC --- (In reply to comment #2) What do you mean by returned? This is an inline function, so it depends entirely on what the referencing code is doing whether or not this value is returned, as function return. You didn't cite any context of the use. Just a single function.