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]

Re: Live range splitting in new allocator


I wrote:
> > For floating point on IEEE platforms, it's easy enough: use a NaN.
> > However, for variables that are used as boolean values (whether a C++ bool
> > or a C int used as a flag), you'll make things more deterministic than
> > before: an uninitialized Boolean auto variable used to be random, under your
> > proposal it will always be true.

Alexandre writes:
> How about using some bit in the return value of random() instead? :-)

How about using whatever bit happens to be in the uninitialized variable
instead? :-)

Seriously, though, Robert does have a point; the perfect can be the enemy
of the good.  And I've even used the technique back when I did embedded
systems stuff, initializing "uninitialized memory" to 0xdeadbeef because
it looked cool on the screen of our emulator:

001000 DEAD BEEF DEAD BEEF ....
...

But it's important not to expect too much from it other than for floats
where the NaN concept exists.

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