This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/20991] [4.0/4.1 Regression] ICE in cgraph_mark_reachable_node
- From: "jakub at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 13 Apr 2005 14:27:08 -0000
- Subject: [Bug middle-end/20991] [4.0/4.1 Regression] ICE in cgraph_mark_reachable_node
- References: <20050413132503.20991.jakub@gcc.gnu.org>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From jakub at gcc dot gnu dot org 2005-04-13 14:26 -------
Somewhat simplified testcase:
#include <vector>
#include <string>
struct A { int i; };
struct B { int i; };
struct C { int i; };
struct D { int i; };
struct E
{
E (void);
E (bool b);
E (const A & m);
virtual ~ E (void);
virtual A m1 (bool x = false) const { return rep->m1 (x); }
virtual B m2 (bool x = false) const { return rep->m2 (x); }
virtual C m3 (bool x = false) const { return rep->m3 (x); }
virtual D m4 (bool x = false) const { return rep->m4 (x); }
virtual std::string m5 (void) const { return rep->m5 (); }
virtual std::string m6 (void) const { return rep->m6 (); }
union { E *rep; int count; };
};
struct F
{
F (void) : data () {}
F (const E & tc) : data (1, tc) {}
F (const F & obj):data (obj.data) {}
~F (void) {}
E operator () (int n) const { return n2 (n); }
int n1 (void) const { return data.size (); }
std::vector < E > data;
E n2 (int n) const { return data[n]; }
};
static bool foo (const E & arg) { return (arg.m6 () == "foo"); }
F bar (const F & args) { return E (foo (args (0))); }
F fn1 (const F & args)
{
E retval;
if (args (0).m6 () == "foo")
retval = args (0).m1 ();
return retval;
}
static F f2 (const B & v) { F retval; return retval; }
static F f2 (const C & v) { F retval; return retval; }
static F f2 (const D & v) { F retval; return retval; }
F
f3 (const F & x)
{
F retval;
int n = x.n1 ();
if (n != 1)
return retval;
E arg = x (0);
if (arg.m6 () == "foo")
{
if (arg.m5 () == "bar")
retval = f2 (x (0).m2 ());
else if (arg.m5 () == "baz")
retval = f2 (x (0).m3 ());
else
retval = f2 (x (0).m4 ());
}
return retval;
}
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20991