This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: why GCC does implicit promotion to unsigned char?


On Thu, Jan 26, 2012 at 03:53:59PM +0400, Konstantin Vladimirov wrote:
> If I know what I am doing, and my code itself guarantees, that there
> will be no overflows and UB here, can I switch off this signed char to
> unsigned char expansion in favor of signed char to signed int
> expansion?

Obviously promotion to signed int, doing addition there and demoting
back to char would create much worse code when vectorized.
The primary problem is that your GCC is too old, retry with 4.6+.
In particular you are interested in http://gcc.gnu.org/PR44284 .
Current GCC vectorizes it just fine.

	Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]