This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug optimization/11269] [tree-ssa] wrong-code
- 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: 15 Aug 2003 03:10:35 -0000
- Subject: [Bug optimization/11269] [tree-ssa] wrong-code
- References: <20030620183319.11269.reichelt@gcc.gnu.org>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11269
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Severity|normal |critical
Status|UNCONFIRMED |NEW
Ever Confirmed| |1
Last reconfirmed|0000-00-00 00:00:00 |2003-08-15 03:10:34
date| |
------- Additional Comments From pinskia at gcc dot gnu dot org 2003-08-15 03:10 -------
I can confirm this on the tree-ssa (20030814).
Looks like the inline is messing this one up:
int main() ()
{
int & retval.8;
struct A retval.7;
struct A * b.3;
int & T.4;
int T.5;
{
{
struct A b;
{
struct A a;
{
{
struct A a;
{
<UL5cb0>:;
};
goto <UL5bd0>;;
}
};
<UL5bd0>:;;
retval.7 = a;
};
b = retval.7;
{
b.3 = &b;
{
struct A * const this;
int & <UV5ee0>;
this = (struct A * const)b.3;
{
{
{
<UV5ee0> = (int &)this;
goto <UL5e70>;;
}
}
};
<UL5e70>:;;
retval.8 = <UV5ee0>;
};
T.4 = retval.8;
T.5 = *T.4;
if (T.5 != 1)
{
{
abort ()
}
}
else
{
(void)0
};
};
return 0;;
}
};
return 0;;
}
There is no setting anything to 1.
Here is the source I used (self checking):
struct A
{
int x[2];
int& GetFirst() { return x[0]; }
};
A foo ()
{
A a;
a.GetFirst()=1;
return a;
}
extern "C" void abort();
int main()
{
A b=foo();
if (b.GetFirst()!=1)
abort();
return 0;
}