[Bug target/39002] [4.4 Regression] codegen bug, stack pointer is not restored
--- Comment #28 from ktietz at gcc dot gnu dot org 2009-01-30 08:54 --- (In reply to comment #19) Anyone else could test it, please? ok, I tested it for linux64 and and for w64 without any new problems. I applied the patch (see rev. #143780). Just the testcase is missing. Do you apply it and set then the bug as fixed? -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39002
[Bug target/39002] [4.4 Regression] codegen bug, stack pointer is not restored
--- Comment #29 from jakub at gcc dot gnu dot org 2009-01-30 09:23 --- Subject: Bug 39002 Author: jakub Date: Fri Jan 30 09:22:48 2009 New Revision: 143782 URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=143782 Log: PR target/39002 * g++.dg/torture/pr39002.C: New test. Added: trunk/gcc/testsuite/g++.dg/torture/pr39002.C Modified: trunk/gcc/testsuite/ChangeLog -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39002
[Bug target/39002] [4.4 Regression] codegen bug, stack pointer is not restored
--- Comment #30 from jakub at gcc dot gnu dot org 2009-01-30 09:29 --- Fixed. -- jakub at gcc dot gnu dot org changed: What|Removed |Added Status|ASSIGNED|RESOLVED Resolution||FIXED http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39002
[Bug target/39002] [4.4 Regression] codegen bug, stack pointer is not restored
--- Comment #16 from jakub at gcc dot gnu dot org 2009-01-29 10:31 --- Created an attachment (id=17208) -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=17208action=view) gcc44-pr39002.patch As MS_ABI sseregs save area isn't counted into frame.allocate anymore, IMHO ix86_can_use_return_insn_p has to check for that too. This patch cures the testcase for visual inspection. Could somebody please bootstrap/regtest it on mingw? I can bootstrap/regtest it on x86_64-linux, but as nsseregs is always zero there, this won't be sufficient test. -- jakub at gcc dot gnu dot org changed: What|Removed |Added AssignedTo|unassigned at gcc dot gnu |jakub at gcc dot gnu dot org |dot org | Status|NEW |ASSIGNED http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39002
[Bug target/39002] [4.4 Regression] codegen bug, stack pointer is not restored
--- Comment #17 from r dot emrich at de dot tecosim dot com 2009-01-29 10:47 --- (In reply to comment #16) Created an attachment (id=17208) -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=17208action=view) [edit] gcc44-pr39002.patch As MS_ABI sseregs save area isn't counted into frame.allocate anymore, IMHO ix86_can_use_return_insn_p has to check for that too. This patch cures the testcase for visual inspection. Could somebody please bootstrap/regtest it on mingw? I can bootstrap/regtest it on x86_64-linux, but as nsseregs is always zero there, this won't be sufficient test. I can will do my cross build and test in the afternoon. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39002
[Bug target/39002] [4.4 Regression] codegen bug, stack pointer is not restored
--- Comment #18 from r dot emrich at de dot tecosim dot com 2009-01-29 11:34 --- (In reply to comment #17) (In reply to comment #16) Created an attachment (id=17208) -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=17208action=view) [edit] gcc44-pr39002.patch As MS_ABI sseregs save area isn't counted into frame.allocate anymore, IMHO ix86_can_use_return_insn_p has to check for that too. This patch cures the testcase for visual inspection. Could somebody please bootstrap/regtest it on mingw? I can bootstrap/regtest it on x86_64-linux, but as nsseregs is always zero there, this won't be sufficient test. I can will do my cross build and test in the afternoon. Solves my problem. But I can't run the testsuite, because I don't have a sufficient setup. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39002
[Bug target/39002] [4.4 Regression] codegen bug, stack pointer is not restored
--- Comment #19 from jakub at gcc dot gnu dot org 2009-01-29 12:03 --- Anyone else could test it, please? -- jakub at gcc dot gnu dot org changed: What|Removed |Added CC||ktietz at gcc dot gnu dot ||org, dannysmith at gcc dot ||gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39002
[Bug target/39002] [4.4 Regression] codegen bug, stack pointer is not restored
--- Comment #20 from ktietz at gcc dot gnu dot org 2009-01-29 12:21 --- (In reply to comment #19) Anyone else could test it, please? I am currently on to test it for w64. We noticed a regression reasoned by this for this target, too (sadly we found it pretty late). This patch seems fine, but I guess that in ix86_expand_epilogue also the checks for frame.nregs should be altered to (frame.nregs + frame.nsseregs), too. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39002
[Bug target/39002] [4.4 Regression] codegen bug, stack pointer is not restored
--- Comment #21 from ktietz at gcc dot gnu dot org 2009-01-29 12:27 --- Created an attachment (id=17210) -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=17210action=view) Alternative patch suggested This is the patch I test at the moment. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39002
[Bug target/39002] [4.4 Regression] codegen bug, stack pointer is not restored
--- Comment #22 from ktietz at gcc dot gnu dot org 2009-01-29 12:52 --- (In reply to comment #21) Created an attachment (id=17210) -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=17210action=view) [edit] Alternative patch suggested This is the patch I test at the moment. The patch I posted works for w64 without any regressions. For linux64 it needs to be tested, too. I have here at work no linux64 box. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39002
[Bug target/39002] [4.4 Regression] codegen bug, stack pointer is not restored
--- Comment #23 from jakub at gcc dot gnu dot org 2009-01-29 13:23 --- I don't see why ix86_expand_epilogue should be changed. Do you have some testcase which shows where your change improves generated code? I can certainly test on Linux, but as frame.nsseregs is always 0 there, it should make zilch difference. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39002
[Bug target/39002] [4.4 Regression] codegen bug, stack pointer is not restored
--- Comment #24 from ktietz at gcc dot gnu dot org 2009-01-29 13:45 --- (In reply to comment #23) I don't see why ix86_expand_epilogue should be changed. Do you have some testcase which shows where your change improves generated code? I can certainly test on Linux, but as frame.nsseregs is always 0 there, it should make zilch difference. It is the same testcase for w64. Just the option -fno-omit-frame-pointer has to be added. This leads on w64 to an ICE (internal abort) without this patch. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39002
[Bug target/39002] [4.4 Regression] codegen bug, stack pointer is not restored
--- Comment #25 from jakub at gcc dot gnu dot org 2009-01-29 13:54 --- Can't reproduce that with a cross compiler. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39002
[Bug target/39002] [4.4 Regression] codegen bug, stack pointer is not restored
--- Comment #26 from ktietz at gcc dot gnu dot org 2009-01-29 14:04 --- (In reply to comment #25) Can't reproduce that with a cross compiler. You are right, I changed something else, too. Sorry. But this patch to expand_epilogue is proper IIUC Comment tells If we're only restoring one register and sp is not valid then using a move instruction to restore the register since it's less work than reloading sp and popping the register. ... for w64 the can be more then one register in use but the check in the if doesn't verify this, and produces therefore slower code. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39002
[Bug target/39002] [4.4 Regression] codegen bug, stack pointer is not restored
-- jakub at gcc dot gnu dot org changed: What|Removed |Added Priority|P3 |P1 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39002
[Bug target/39002] [4.4 Regression] codegen bug, stack pointer is not restored
--- Comment #27 from sezeroz at gmail dot com 2009-01-29 22:48 --- I can confirm that after applying pr_w64.diff of Kai Tietz to svn rev 143768, my similar problem which I reported at mingw-w64 site (which is also related to the 143119 commit) is fixed. Thanks to all who wonked on this. -- sezeroz at gmail dot com changed: What|Removed |Added CC||sezeroz at gmail dot com http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39002