This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/24169] New: Address (full struct) escapes even though the called function does not cause it to escape
- 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: 2 Oct 2005 20:32:31 -0000
- Subject: [Bug tree-optimization/24169] New: Address (full struct) escapes even though the called function does not cause it to escape
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Just like PR 23134, here is another testcase for the aliasing thinking that the
address escapes but this time it has SFT's involved and we should not have a
V_MAY_DEF for k.i:
static void f(char *a)
{
*a = 1;
}
struct g
{
char i, j;
};
void h(void)
{
struct g k = {2, 2};
f(&k.j);
if (k.i != 2)
link_error ();
}
Compile with -O2 -fno-inline to force f not to inline.
--
Summary: Address (full struct) escapes even though the called
function does not cause it to escape
Product: gcc
Version: 4.1.0
Status: NEW
Keywords: missed-optimization, alias
Severity: enhancement
Priority: P2
Component: tree-optimization
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: pinskia at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24169