[Bug rtl-optimization/63718] [5 Regression] ARM Thumb1 bootstrap fail after fuse-caller-save info in cprop-hardreg
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63718 --- Comment #16 from vries at gcc dot gnu.org --- Author: vries Date: Tue Dec 2 13:35:10 2014 New Revision: 218271 URL: https://gcc.gnu.org/viewcvs?rev=218271root=gccview=rev Log: 2014-12-02 Tom de Vries t...@codesourcery.com PR rtl-optimization/63718 * config/arm/arm.c (arm_option_override): Disable fuse-caller-save for Thumb1. Modified: trunk/gcc/ChangeLog trunk/gcc/config/arm/arm.c
[Bug rtl-optimization/63718] [5 Regression] ARM Thumb1 bootstrap fail after fuse-caller-save info in cprop-hardreg
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63718 Joey Ye joey.ye at arm dot com changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED Resolution|--- |FIXED --- Comment #17 from Joey Ye joey.ye at arm dot com --- Resolved in 218271, which is a work around. A new PR is expected to open for a complete solution.
[Bug rtl-optimization/63718] [5 Regression] ARM Thumb1 bootstrap fail after fuse-caller-save info in cprop-hardreg
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63718 --- Comment #18 from vries at gcc dot gnu.org --- (In reply to Joey Ye from comment #17) A new PR is expected to open for a complete solution. PR 64154 - enable fuse-caller-save for Thumb1
[Bug rtl-optimization/63718] [5 Regression] ARM Thumb1 bootstrap fail after fuse-caller-save info in cprop-hardreg
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63718 vries at gcc dot gnu.org changed: What|Removed |Added Keywords||patch --- Comment #15 from vries at gcc dot gnu.org --- https://gcc.gnu.org/ml/gcc-patches/2014-11/msg02648.html
[Bug rtl-optimization/63718] [5 Regression] ARM Thumb1 bootstrap fail after fuse-caller-save info in cprop-hardreg
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63718 Richard Biener rguenth at gcc dot gnu.org changed: What|Removed |Added Keywords||wrong-code Priority|P3 |P1
[Bug rtl-optimization/63718] [5 Regression] ARM Thumb1 bootstrap fail after fuse-caller-save info in cprop-hardreg
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63718 --- Comment #13 from vries at gcc dot gnu.org --- I was planning to put this patch through build regtest Testing reveals: The r0 clobber is _not_ a good idea if the function has a result ... Ouch.
[Bug rtl-optimization/63718] [5 Regression] ARM Thumb1 bootstrap fail after fuse-caller-save info in cprop-hardreg
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63718 --- Comment #14 from Joey Ye joey.ye at arm dot com --- Em. Probably a more favorable solution is fix expand_epilogue to precisely elaborate the side effect?
[Bug rtl-optimization/63718] [5 Regression] ARM Thumb1 bootstrap fail after fuse-caller-save info in cprop-hardreg
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63718 --- Comment #11 from vries at gcc dot gnu.org --- reproduced with r217718
[Bug rtl-optimization/63718] [5 Regression] ARM Thumb1 bootstrap fail after fuse-caller-save info in cprop-hardreg
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63718 --- Comment #12 from vries at gcc dot gnu.org --- reproduced with r217718 Sorry, wrong PR
[Bug rtl-optimization/63718] [5 Regression] ARM Thumb1 bootstrap fail after fuse-caller-save info in cprop-hardreg
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63718 --- Comment #9 from Joey Ye joey.ye at arm dot com --- Indeed, the patch is conservative, but that's not such a bad idea for a correctness fix. We can always folllow up with a more optimal patch. Tom, are you going to submit this patch for review, or are you working on a more optimal one? Better to have this conservative patch to recover the bootstrap first. - Joey
[Bug rtl-optimization/63718] [5 Regression] ARM Thumb1 bootstrap fail after fuse-caller-save info in cprop-hardreg
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63718 --- Comment #10 from vries at gcc dot gnu.org --- Tom, are you going to submit this patch for review I was planning to put this patch through build regtest and submit, but next week. Unfortunately I don't have time until then, I'm trying to submit something else before stage1 closes.
[Bug rtl-optimization/63718] [5 Regression] ARM Thumb1 bootstrap fail after fuse-caller-save info in cprop-hardreg
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63718 Richard Biener rguenth at gcc dot gnu.org changed: What|Removed |Added Target||arm Target Milestone|--- |5.0 Summary|ARM Thumb1 bootstrap fail |[5 Regression] ARM Thumb1 |after fuse-caller-save info |bootstrap fail after |in cprop-hardreg|fuse-caller-save info in ||cprop-hardreg
[Bug rtl-optimization/63718] [5 Regression] ARM Thumb1 bootstrap fail after fuse-caller-save info in cprop-hardreg
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63718 vries at gcc dot gnu.org changed: What|Removed |Added CC||vries at gcc dot gnu.org --- Comment #5 from vries at gcc dot gnu.org --- Created attachment 33874 -- https://gcc.gnu.org/bugzilla/attachment.cgi?id=33874action=edit tentative patch, adds missing clobbers Joey, thanks for doing the analysis and the clear bug report. I cannot formally confirm at this point since I don't have an arm bootstrap setup, but I agree, those missing clobbers (while not causing problems otherwise) will cause problems with fuse-caller-save. I'd say the fix is to add the missing clobbers. Attached tentative patch implements that fix. Using the patch, I build a c-only arm compiler, compiled an example with -mthumb and -march=armv4t and observed the new clobbers on the return in the final dump: ... (jump_insn 19 18 20 (parallel [ (unspec_volatile [ (return) ] VUNSPEC_EPILOGUE) (clobber (reg:SI 0 r0)) (clobber (reg:SI 1 r1)) (clobber (reg:SI 2 r2)) (clobber (reg:SI 3 r3)) ]) test.c:9 773 {*epilogue_insns} (expr_list:REG_UNUSED (reg:SI 3 r3) (expr_list:REG_UNUSED (reg:SI 2 r2) (expr_list:REG_UNUSED (reg:SI 1 r1) (nil - return) ... Could you try out the patch and see if it fixes things for you? Thanks, - Tom
[Bug rtl-optimization/63718] [5 Regression] ARM Thumb1 bootstrap fail after fuse-caller-save info in cprop-hardreg
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63718 --- Comment #6 from Joey Ye joey.ye at arm dot com --- (In reply to vries from comment #5) Could you try out the patch and see if it fixes things for you? Tom, thanks for the quick action. Apparantly this patch should recover the bootstrap. I will test it and come back to you (bootstraping thumb1 with qemu takes hours!) However, I think the fix is too conservative. There are plenty of chances that r0-r3 will not be clobbered by return. For example armv6-m will pretty much never uses r0-r3 implicitly.
[Bug rtl-optimization/63718] [5 Regression] ARM Thumb1 bootstrap fail after fuse-caller-save info in cprop-hardreg
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63718 --- Comment #7 from vries at gcc dot gnu.org --- (In reply to Joey Ye from comment #6) (In reply to vries from comment #5) Could you try out the patch and see if it fixes things for you? Tom, thanks for the quick action. Apparantly this patch should recover the bootstrap. I will test it and come back to you (bootstraping thumb1 with qemu takes hours!) Great :) However, I think the fix is too conservative. There are plenty of chances that r0-r3 will not be clobbered by return. For example armv6-m will pretty much never uses r0-r3 implicitly. Indeed, the patch is conservative, but that's not such a bad idea for a correctness fix. We can always folllow up with a more optimal patch.
[Bug rtl-optimization/63718] [5 Regression] ARM Thumb1 bootstrap fail after fuse-caller-save info in cprop-hardreg
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63718 --- Comment #8 from Joey Ye joey.ye at arm dot com --- (In reply to vries from comment #5) Created attachment 33874 [details] tentative patch, adds missing clobbers This patch does recover thumb1 bootstrap - Joey