This is the mail archive of the
mailing list for the GCC project.
[Bug middle-end/23497] [4.1 regression] Bogus 'is used uninitialized...' warning about std::complex<T>
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 16 Nov 2005 18:54:00 -0000
- Subject: [Bug middle-end/23497] [4.1 regression] Bogus 'is used uninitialized...' warning about std::complex<T>
- References: <email@example.com/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #29 from pinskia at gcc dot gnu dot org 2005-11-16 18:54 -------
(In reply to comment #27)
> From libstdc++ perspective, __imag__ ought to be an lvalue. This is a recurent
> issue for C++ complex<>.
Of course the lvalue is moot, I never said __imag__ should not be lvalue, I
don't know where Mark gets that from (maybe it is because I was showing why the
warning is correct or something I don't know).
>From the C perspective the warning is correct as you are loading piece wise
which is not really supported at all, even shown by my integer testcase.
As I said before __imag__ a should be an lvalue but __imag__ a = b is
equivalent to a = COMPLEX < REAL<a>, b> there is nothing from any point of view
doing it this way.
Also I should note that __imag__ being around is an extension, a not so well
documented one at that. So changing this to behavior this way is well defined.
And if you look and you will see that now we actually perform a lot more
optimizations on complex unlike before when we split it up. (this is also in
reference to RTH's comments in comment #24).