struct S { int w, x, y, z; }; struct T { int r; struct S s; }; void bar (struct S, int); void foo (int a, struct T b) { struct S *c = 0; if (a) c = &b.s; bar (*c, a); }
The call to bar appears to not be marked [tail-call] because b is marked as a call-clobbered local variable. Which IIRC means that the aliasing code thinks that the address of b escapes. Which is untrue -- no address escapes from this function. -- Summary: local address incorrectly thought to escape Product: gcc Version: 4.0.0 Status: UNCONFIRMED Keywords: missed-optimization Severity: enhancement Priority: P2 Component: tree-optimization AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: rth at gcc dot gnu dot org CC: dnovillo at gcc dot gnu dot org,gcc-bugs at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19633