This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Live range splitting in new allocator
- To: aoliva at redhat dot com (Alexandre Oliva)
- Subject: Re: Live range splitting in new allocator
- From: Joe Buck <jbuck at racerx dot synopsys dot com>
- Date: Tue, 30 Jan 2001 14:02:33 -0800 (PST)
- Cc: espie at quatramaran dot ens dot fr (Marc Espie), dewar at gnat dot com, gcc at gcc dot gnu dot org
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.