This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/18882] [3.3/3.4 Regression] wrong results with complex long double
- From: "bangerth at dealii dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 8 Dec 2004 16:29:24 -0000
- Subject: [Bug middle-end/18882] [3.3/3.4 Regression] wrong results with complex long double
- References: <20041208084814.18882.mikulik@physics.muni.cz>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From bangerth at dealii dot org 2004-12-08 16:29 -------
Here's my shortest version:
-------------------
extern "C" void abort ();
struct C {
__complex__ long double c;
};
int main() {
C x = {2+2i};
int n = 1;
C y = (n==1) ? x : (C){3+3i};
if (__imag__ y.c != 2)
abort ();
}
----------------------
This fails on 3.3 and 3.4 branches:
g/x> /home/bangerth/bin/gcc-3.2*/bin/c++ x.cc ; ./a.out
g/x> /home/bangerth/bin/gcc-3.3*/bin/c++ x.cc ; ./a.out
Aborted
g/x> /home/bangerth/bin/gcc-3.4*/bin/c++ x.cc ; ./a.out
Aborted
g/x> /home/bangerth/bin/gcc-4*/bin/c++ x.cc ; ./a.out
W.
--
What |Removed |Added
----------------------------------------------------------------------------
Summary|[3.3/3.4 Regression] wrong |[3.3/3.4 Regression] wrong
|results of pow( complex<long|results with complex long
|double>(2, 1), odd integer )|double
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18882