This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/39002] New: codegen bug?
- From: "r dot emrich at de dot tecosim dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 28 Jan 2009 14:17:54 -0000
- Subject: [Bug c++/39002] New: codegen bug?
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
I have a complex C++ application, which used to work at least until gcc-4.4.0
snapshot 20081219, which now segfaults in a strange way.
double distance_2(NODE *P_node1, NODE *P_node2)
{
return
sqrt(((*P_node1).globalx-(*P_node2).globalx)*((*P_node1).globalx-(*P_node2).globalx)+
((*P_node1).globaly-(*P_node2).globaly)*((*P_node1).globaly-(*P_node2).globaly)+
((*P_node1).globalz-(*P_node2).globalz)*((*P_node1).globalz-(*P_node2).globalz));
}
void calc_tria_height_2(NODE *n1, NODE *n2, NODE *n11,ostream &out_info,int
&xerror,int &xwarning,double &x,double &y,double &z)
{
if( distance_2(n1,n2) == 0.0 )
{
x = (*n11).globalx;
y = (*n11).globaly;
z = (*n11).globalz;
return;
}
if( distance_2(n1,n11) == 0.0 )
{
x = (*n11).globalx;
y = (*n11).globaly;
z = (*n11).globalz;
return;
}
if( distance_2(n2,n11) == 0.0 )
{
x = (*n11).globalx;
y = (*n11).globaly;
z = (*n11).globalz;
return;
}
double a1, b1 , c1, la1, la1max;
double dx, dy, dz, dxyz;
double dxa1;
a1 = (*n2).globalx - (*n1).globalx;
b1 = (*n2).globaly - (*n1).globaly;
c1 = (*n2).globalz - (*n1).globalz;
la1max = sqrt (a1 * a1 + b1 * b1 + c1 * c1);
a1 = a1 / la1max;
b1 = b1 / la1max;
c1 = c1 / la1max;
dx = (*n1).globalx - (*n11).globalx;
dy = (*n1).globaly - (*n11).globaly;
dz = (*n1).globalz - (*n11).globalz;
dxyz = dx * dx + dy * dy + dz * dz;
dxa1 = 2.0 * dx * a1 + 2.0 * dy * b1 + 2.0 * dz * c1;
la1 = -dxa1 / 2.0;
x = (*n1).globalx + (a1 * la1);
y = (*n1).globaly + (b1 * la1);
z = (*n1).globalz + (c1 * la1);
return;
}
compiled with -g0 -O3 it segfaults at the last return.
I will upload the assembler files for gcc snapshot and for trunk.
--
Summary: codegen bug?
Product: gcc
Version: 4.4.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: r dot emrich at de dot tecosim dot com
GCC build triplet: x86_64-unknown-linux-gnu
GCC host triplet: x86_64-unknown-linux-gnu
GCC target triplet: x86_64-mingw32
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39002
- Follow-Ups:
- [Bug c++/39002] codegen bug?
- From: r dot emrich at de dot tecosim dot com
- [Bug c++/39002] codegen bug?
- From: r dot emrich at de dot tecosim dot com
- [Bug c++/39002] codegen bug?
- From: falk at debian dot org
- [Bug c++/39002] codegen bug?
- From: r dot emrich at de dot tecosim dot com
- [Bug c++/39002] codegen bug?
- From: falk at debian dot org
- [Bug c++/39002] codegen bug?
- From: r dot emrich at de dot tecosim dot com
- [Bug c++/39002] codegen bug?
- From: r dot emrich at de dot tecosim dot com
- [Bug c++/39002] codegen bug?
- From: r dot emrich at de dot tecosim dot com
- [Bug c++/39002] codegen bug?
- From: r dot emrich at de dot tecosim dot com
- [Bug c++/39002] codegen bug?
- From: r dot emrich at de dot tecosim dot com
- [Bug c++/39002] codegen bug?
- From: r dot emrich at de dot tecosim dot com
- [Bug c++/39002] codegen bug?
- From: r dot emrich at de dot tecosim dot com
- [Bug c++/39002] codegen bug?
- From: r dot emrich at de dot tecosim dot com
- [Bug target/39002] codegen bug, stack pointer is not restored
- From: ubizjak at gmail dot com
- [Bug target/39002] [4,4 Regression] codegen bug, stack pointer is not restored
- From: ubizjak at gmail dot com
- [Bug target/39002] [4.4 Regression] codegen bug, stack pointer is not restored
- From: jakub at gcc dot gnu dot org
- [Bug target/39002] [4.4 Regression] codegen bug, stack pointer is not restored
- From: r dot emrich at de dot tecosim dot com
- [Bug target/39002] [4.4 Regression] codegen bug, stack pointer is not restored
- From: r dot emrich at de dot tecosim dot com
- [Bug target/39002] [4.4 Regression] codegen bug, stack pointer is not restored
- From: jakub at gcc dot gnu dot org
- [Bug target/39002] [4.4 Regression] codegen bug, stack pointer is not restored
- From: ktietz at gcc dot gnu dot org
- [Bug target/39002] [4.4 Regression] codegen bug, stack pointer is not restored
- From: ktietz at gcc dot gnu dot org
- [Bug target/39002] [4.4 Regression] codegen bug, stack pointer is not restored
- From: ktietz at gcc dot gnu dot org
- [Bug target/39002] [4.4 Regression] codegen bug, stack pointer is not restored
- From: jakub at gcc dot gnu dot org
- [Bug target/39002] [4.4 Regression] codegen bug, stack pointer is not restored
- From: ktietz at gcc dot gnu dot org
- [Bug target/39002] [4.4 Regression] codegen bug, stack pointer is not restored
- From: jakub at gcc dot gnu dot org
- [Bug target/39002] [4.4 Regression] codegen bug, stack pointer is not restored
- From: ktietz at gcc dot gnu dot org
- [Bug target/39002] [4.4 Regression] codegen bug, stack pointer is not restored
- From: jakub at gcc dot gnu dot org
- [Bug target/39002] [4.4 Regression] codegen bug, stack pointer is not restored
- From: sezeroz at gmail dot com
- [Bug target/39002] [4.4 Regression] codegen bug, stack pointer is not restored
- From: ktietz at gcc dot gnu dot org
- [Bug target/39002] [4.4 Regression] codegen bug, stack pointer is not restored
- From: jakub at gcc dot gnu dot org
- [Bug target/39002] [4.4 Regression] codegen bug, stack pointer is not restored
- From: jakub at gcc dot gnu dot org