Re: Is PRE architecture dependent? aarch64 vs x86_64

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

 



* Segher Boessenkool:

> On Mon, Jul 14, 2025 at 03:03:46PM -0700, Florian Weimer wrote:
>> * Segher Boessenkool:
>> 
>> > -fwrapv is a great way to get slower code, too.  Is there something in
>> > your code that does not work without this reality-distorting flag?
>> 
>> It really depends on the code.  In many cases, -fwrapv enables
>> additional optimizations.  For example, it's much easier to use (in C
>> code) the implicit sign bit many CPUs compute for free.
>
> -fwrapv says "I want something that is not valid C code".  Code that
> requires -fwrapv to work as intended is not valid C code (will have UB).

It would be just another extension, and one that many compilers already
enable by default.  Even GCC makes casting from unsigned to int defined
in all cases because doing that in a standard-conforming way is way too
painful.

Thanks,
Florian




[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