Commit bf37bd88 by Dirk Mueller Committed by Dirk Mueller

re PR c++/31806 (miscompilation with -fschedule-insns2 -fno-threadsafe-statics)

2007-06-14  Dirk Mueller  <dmueller@suse.de>

       PR c++/31806
       * g++.dg/opt/static6.C: New testcase.

From-SVN: r125726
parent 5eafdd32
2007-06-14 Dirk Mueller <dmueller@suse.de>
PR c++/31806
* g++.dg/opt/static6.C: New testcase.
2007-06-14 Geoff Keating <geoffk@apple.com> 2007-06-14 Geoff Keating <geoffk@apple.com>
* g++.dg/ext/visibility/overload-1.C: New. * g++.dg/ext/visibility/overload-1.C: New.
// PR c++/31806
// { dg-do run }
// { dg-options "-O2 -fno-inline -fno-threadsafe-statics" }
extern "C" void abort(void);
struct A
{
void *d;
};
static const A& staticA()
{
static A s_static;
return s_static;
}
void assert_failed()
{
abort();
}
A testMethod()
{
static const A& s = staticA( );
if (&s == 0)
assert_failed();
return s;
}
int main()
{
testMethod();
return 0;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment