This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/34048] [4.3 Regression]: Revision 130040 miscompiles 450.soplex
- From: "rguenth at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 10 Nov 2007 16:42:42 -0000
- Subject: [Bug tree-optimization/34048] [4.3 Regression]: Revision 130040 miscompiles 450.soplex
- References: <bug-34048-682@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #6 from rguenth at gcc dot gnu dot org 2007-11-10 16:42 -------
This looks like a bug in soplex. It does:
class UnitVector : public SVector
{
private:
Element themem;
Element themem1;
public:
...
UnitVector(int i = 0)
: SVector(2, &themem)
{
add(i, 1.0);
}
and:
class SVector
{
...
struct Element
{
Real val;
int idx;
};
Element *m_elem;
...
SVector(int n = 0, Element* p_mem = 0)
{
setMem(n, p_mem);
}
...
void setMem(int n, Element* elmem)
{
(static_cast<void> (0));
if (n > 0)
{
(static_cast<void> (0));
elmem->val = 0;
m_elem = &(elmem[1]);
set_size( 0 );
set_max ( n - 1 );
}
else
m_elem = 0;
}
that is, SVector accesses themem, themem1 as array (obviously to avoid
unneccessary default construction). If you fix this, the miscompile
goes away.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34048