[Bug tree-optimization/43784] [4.6 Regression] -Os -fkeep-inline-functions causes FAIL: gcc.c-torture/execute/builtins/pr22237.c execution
matz at gcc dot gnu dot org
gcc-bugzilla@gcc.gnu.org
Mon Jul 26 15:06:00 GMT 2010
------- Comment #9 from matz at gcc dot gnu dot org 2010-07-26 15:06 -------
Here's a testcase (nicer in the sense of not requiring inlining) that shows
the current compiler botching the nrv <-> retslot optimizations:
struct S {int x, y, makemelarge[5];};
S __attribute__((noinline)) f (S &s) {
S r;
r.x = s.y;
r.y = s.x;
return r;
}
int __attribute__((noinline)) glob (int a, int b)
{
S local = { a, b };
local = f (local);
return local.y;
}
extern "C" void abort (void);
int main (void)
{
if (glob (1, 3) != 1)
abort ();
return 0;
}
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43784
More information about the Gcc-bugs
mailing list