Let me try again:
I've prepared a patch for: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49519

It fixes the problem of tailcall optimization: check for stack
overlapping was not strict enough.
Patch adds another check for clobbered stack area. If address comes
from a register - we have no idea about destination of that address.
That means we must act in conservative way - address possibly overlaps
with stack area of interest, and we should not perform tailcall
optimization

ChangeLog entry:
2011-07-06  Kirill Yukhin  <kirill.yuk...@intel.com>

       PR middle-end/49519
       * calls.c (mem_overlaps_already_clobbered_arg_p): Additional
       check if address is stored in register. If so - give up.
       (check_sibcall_argument_overlap_1): Do not perform check of
       overlapping when it is call to address.

tessuite/ChangeLog entry:
2011-07-06  Kirill Yukhin  <kirill.yuk...@intel.com>

       * g++.dg/torture/pr49519.C: New test for tailcall fix.

Bootstrapped, new test fails without patch, passes when it is applied.
This fixes the problem with SPEC2006/447.dealII miscompile

Ok for trunk?

Thanks, K

Attachment: pr49519-1.gcc.patch
Description: Binary data

Reply via email to