Re: AW: optimizer discards sign information

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 10/04/2024 16:25, Stefan Franke wrote:


Thank you for the detailed explanation.

I'm glad if it helped you a little.

It still doesn't fit together, since if the compiler knows that it's unsigned, why does it emit code for sign extension on the m68k target?


It's nothing more than a sub-optimal code generation issue, since sign extension and zero extension are equally correct. gcc's code generation is pretty good by any standard, but it is not always perfectly optimal. Maybe it's hard to improve this one without a lot of effort or knock-on effects. Maybe the circumstances occur so rarely it is not worth the effort. Maybe the sign extension is actually faster (or no slower) on some targets - sometimes real-world speeds are not what we expect by looking at the assembly.

(I thought you were using x86-64, not m68k? The m68k target is not nearly as popular as it used to be in the early days of gcc. My first use of gcc was building a cross-compiler of gcc 2.7 to run on DOS for a 68332 target. Happy days :-) )

Well. Since there are enough explanations and my expectations are simply wrong consider this as closed.

Kind regards

Stefan






[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux