This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/49519] [4.7 Regression] Revision 175272 miscompiled 447.dealII in SPEC CPU 2006
- From: "kirill.yukhin at intel dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 29 Jun 2011 12:24:45 +0000
- Subject: [Bug c++/49519] [4.7 Regression] Revision 175272 miscompiled 447.dealII in SPEC CPU 2006
- Auto-submitted: auto-generated
- References: <bug-49519-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49519
--- Comment #5 from Yukhin Kirill <kirill.yukhin at intel dot com> 2011-06-29 12:24:25 UTC ---
Problem here is that GCC incorrectly stores arguments to stack in case of
tail-call opt.
Here is snippet
movl 40(%esp), %eax
movl %eax, 28(%esp)
movl 36(%esp), %esi
movl %esi, 24(%esp)
movl 32(%esp), %esi
movl %esi, 20(%esp)
movl %eax, 16(%esp)
Argument from 28(%esp) is not copied to 28(%esp) at all.
Correct sequence must be (semantically) like that:
movl 40(%esp), %esi ; <----- Use esi to move memory
movl 28(%esp), %eax ; <----- Save overlapping value
movl %esi, 28(%esp)
movl 36(%esp), %esi
movl %esi, 24(%esp)
movl 32(%esp), %esi
movl %esi, 20(%esp)
movl %eax, 16(%esp) ; <----- Store saved value
Working toward the patch