[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-gsl] Uninitialized variables and signaling NaNs
From: |
Jochen Küpper |
Subject: |
Re: [Help-gsl] Uninitialized variables and signaling NaNs |
Date: |
Tue, 10 Aug 2010 23:35:58 +0200 |
Hi,
On 08.Aug.2010, at 22:04, Andrew W. Steiner wrote:
> Thanks for your thoughts. My naive guess is
> that It would be difficult,
could be
> if not impossible for the
> optimizer to know this, as one could always
> insert a call to an external function which
> ostensibly initializes the variable but may or
> may not fail to do so. Additionally, I
> don't forsee any work on the C/C++ compilers
> which guarantees that the optimizer will
> accomplish this task, leaving it up to those
> who write the source code to take care of it.
However, the code you send is valid C and valid C++ (AFAICT).
Therefore, a correct (C or C++) compiler must create valid machine code from
it. It's that simple.
> On Sun, Aug 8, 2010 at 3:28 PM, Jochen Küpper
> <address@hidden> wrote:
>> Isn't that an issue that should be handled by the optimizer? That's the
>> instance that knows whether this issue might occur or not, i.e., it
>> knows whether the variable is put into a register or not.
>>
>> Therefore, the optimizer should initialize this variable if it's put into a
>> register (probably using a switch to turn off or on). Obviously, it then
>> has to determine whether it is still worth the register usage with
>> the added overhead of initialization.
>>
>> Or would it actually be feasible to use the register (for x) without
>> moving the content of &x but instead using whatever happens to
>> be in the register?
>>
Greetings,
Jochen
--
Einigkeit und Recht und Freiheit http://www.Jochen-Kuepper.de
Liberté, Égalité, Fraternité GnuPG key: CC1B0B4D
Sex, drugs and rock-n-roll