* [Bug rtl-optimization/63718] ARM Thumb1 bootstrap fail after fuse-caller-save info in cprop-hardreg
2014-11-03 7:32 [Bug rtl-optimization/63718] New: ARM Thumb1 bootstrap fail after fuse-caller-save info in cprop-hardreg joey.ye at arm dot com
@ 2014-11-03 8:15 ` joey.ye at arm dot com
2014-11-03 8:16 ` joey.ye at arm dot com
` (15 subsequent siblings)
16 siblings, 0 replies; 18+ messages in thread
From: joey.ye at arm dot com @ 2014-11-03 8:15 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63718
--- Comment #2 from Joey Ye <joey.ye at arm dot com> ---
Created attachment 33871
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=33871&action=edit
Reduced rtl dump
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug rtl-optimization/63718] ARM Thumb1 bootstrap fail after fuse-caller-save info in cprop-hardreg
2014-11-03 7:32 [Bug rtl-optimization/63718] New: ARM Thumb1 bootstrap fail after fuse-caller-save info in cprop-hardreg joey.ye at arm dot com
2014-11-03 8:15 ` [Bug rtl-optimization/63718] " joey.ye at arm dot com
@ 2014-11-03 8:16 ` joey.ye at arm dot com
2014-11-03 8:38 ` joey.ye at arm dot com
` (14 subsequent siblings)
16 siblings, 0 replies; 18+ messages in thread
From: joey.ye at arm dot com @ 2014-11-03 8:16 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63718
--- Comment #3 from Joey Ye <joey.ye at arm dot com> ---
Created attachment 33872
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=33872&action=edit
Reduced rtl dump previous pass
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug rtl-optimization/63718] ARM Thumb1 bootstrap fail after fuse-caller-save info in cprop-hardreg
2014-11-03 7:32 [Bug rtl-optimization/63718] New: ARM Thumb1 bootstrap fail after fuse-caller-save info in cprop-hardreg joey.ye at arm dot com
2014-11-03 8:15 ` [Bug rtl-optimization/63718] " joey.ye at arm dot com
2014-11-03 8:16 ` joey.ye at arm dot com
@ 2014-11-03 8:38 ` joey.ye at arm dot com
2014-11-03 9:19 ` [Bug rtl-optimization/63718] [5 Regression] " rguenth at gcc dot gnu.org
` (13 subsequent siblings)
16 siblings, 0 replies; 18+ messages in thread
From: joey.ye at arm dot com @ 2014-11-03 8:38 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63718
--- Comment #4 from Joey Ye <joey.ye at arm dot com> ---
Created attachment 33873
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=33873&action=edit
Preprocessed testcase
Options to reproduce:
-march=armv4t -mthumb -O2
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug rtl-optimization/63718] [5 Regression] ARM Thumb1 bootstrap fail after fuse-caller-save info in cprop-hardreg
2014-11-03 7:32 [Bug rtl-optimization/63718] New: ARM Thumb1 bootstrap fail after fuse-caller-save info in cprop-hardreg joey.ye at arm dot com
` (2 preceding siblings ...)
2014-11-03 8:38 ` joey.ye at arm dot com
@ 2014-11-03 9:19 ` rguenth at gcc dot gnu.org
2014-11-03 10:17 ` vries at gcc dot gnu.org
` (12 subsequent siblings)
16 siblings, 0 replies; 18+ messages in thread
From: rguenth at gcc dot gnu.org @ 2014-11-03 9:19 UTC (permalink / raw)
To: gcc-bugs
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
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug rtl-optimization/63718] [5 Regression] ARM Thumb1 bootstrap fail after fuse-caller-save info in cprop-hardreg
2014-11-03 7:32 [Bug rtl-optimization/63718] New: ARM Thumb1 bootstrap fail after fuse-caller-save info in cprop-hardreg joey.ye at arm dot com
` (3 preceding siblings ...)
2014-11-03 9:19 ` [Bug rtl-optimization/63718] [5 Regression] " rguenth at gcc dot gnu.org
@ 2014-11-03 10:17 ` vries at gcc dot gnu.org
2014-11-03 10:26 ` joey.ye at arm dot com
` (11 subsequent siblings)
16 siblings, 0 replies; 18+ messages in thread
From: vries at gcc dot gnu.org @ 2014-11-03 10:17 UTC (permalink / raw)
To: gcc-bugs
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=33874&action=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
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug rtl-optimization/63718] [5 Regression] ARM Thumb1 bootstrap fail after fuse-caller-save info in cprop-hardreg
2014-11-03 7:32 [Bug rtl-optimization/63718] New: ARM Thumb1 bootstrap fail after fuse-caller-save info in cprop-hardreg joey.ye at arm dot com
` (4 preceding siblings ...)
2014-11-03 10:17 ` vries at gcc dot gnu.org
@ 2014-11-03 10:26 ` joey.ye at arm dot com
2014-11-04 1:46 ` joey.ye at arm dot com
` (10 subsequent siblings)
16 siblings, 0 replies; 18+ messages in thread
From: joey.ye at arm dot com @ 2014-11-03 10:26 UTC (permalink / raw)
To: gcc-bugs
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.
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug rtl-optimization/63718] [5 Regression] ARM Thumb1 bootstrap fail after fuse-caller-save info in cprop-hardreg
2014-11-03 7:32 [Bug rtl-optimization/63718] New: ARM Thumb1 bootstrap fail after fuse-caller-save info in cprop-hardreg joey.ye at arm dot com
` (5 preceding siblings ...)
2014-11-03 10:26 ` joey.ye at arm dot com
@ 2014-11-04 1:46 ` joey.ye at arm dot com
2014-11-10 1:57 ` joey.ye at arm dot com
` (9 subsequent siblings)
16 siblings, 0 replies; 18+ messages in thread
From: joey.ye at arm dot com @ 2014-11-04 1:46 UTC (permalink / raw)
To: gcc-bugs
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
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug rtl-optimization/63718] [5 Regression] ARM Thumb1 bootstrap fail after fuse-caller-save info in cprop-hardreg
2014-11-03 7:32 [Bug rtl-optimization/63718] New: ARM Thumb1 bootstrap fail after fuse-caller-save info in cprop-hardreg joey.ye at arm dot com
` (6 preceding siblings ...)
2014-11-04 1:46 ` joey.ye at arm dot com
@ 2014-11-10 1:57 ` joey.ye at arm dot com
2014-11-10 7:50 ` vries at gcc dot gnu.org
` (8 subsequent siblings)
16 siblings, 0 replies; 18+ messages in thread
From: joey.ye at arm dot com @ 2014-11-10 1:57 UTC (permalink / raw)
To: gcc-bugs
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
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug rtl-optimization/63718] [5 Regression] ARM Thumb1 bootstrap fail after fuse-caller-save info in cprop-hardreg
2014-11-03 7:32 [Bug rtl-optimization/63718] New: ARM Thumb1 bootstrap fail after fuse-caller-save info in cprop-hardreg joey.ye at arm dot com
` (7 preceding siblings ...)
2014-11-10 1:57 ` joey.ye at arm dot com
@ 2014-11-10 7:50 ` vries at gcc dot gnu.org
2014-11-18 15:08 ` vries at gcc dot gnu.org
` (7 subsequent siblings)
16 siblings, 0 replies; 18+ messages in thread
From: vries at gcc dot gnu.org @ 2014-11-10 7:50 UTC (permalink / raw)
To: gcc-bugs
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.
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug rtl-optimization/63718] [5 Regression] ARM Thumb1 bootstrap fail after fuse-caller-save info in cprop-hardreg
2014-11-03 7:32 [Bug rtl-optimization/63718] New: ARM Thumb1 bootstrap fail after fuse-caller-save info in cprop-hardreg joey.ye at arm dot com
` (8 preceding siblings ...)
2014-11-10 7:50 ` vries at gcc dot gnu.org
@ 2014-11-18 15:08 ` vries at gcc dot gnu.org
2014-11-18 15:09 ` vries at gcc dot gnu.org
` (6 subsequent siblings)
16 siblings, 0 replies; 18+ messages in thread
From: vries at gcc dot gnu.org @ 2014-11-18 15:08 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63718
--- Comment #11 from vries at gcc dot gnu.org ---
reproduced with r217718
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug rtl-optimization/63718] [5 Regression] ARM Thumb1 bootstrap fail after fuse-caller-save info in cprop-hardreg
2014-11-03 7:32 [Bug rtl-optimization/63718] New: ARM Thumb1 bootstrap fail after fuse-caller-save info in cprop-hardreg joey.ye at arm dot com
` (9 preceding siblings ...)
2014-11-18 15:08 ` vries at gcc dot gnu.org
@ 2014-11-18 15:09 ` vries at gcc dot gnu.org
2014-11-19 17:44 ` vries at gcc dot gnu.org
` (5 subsequent siblings)
16 siblings, 0 replies; 18+ messages in thread
From: vries at gcc dot gnu.org @ 2014-11-18 15:09 UTC (permalink / raw)
To: gcc-bugs
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
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug rtl-optimization/63718] [5 Regression] ARM Thumb1 bootstrap fail after fuse-caller-save info in cprop-hardreg
2014-11-03 7:32 [Bug rtl-optimization/63718] New: ARM Thumb1 bootstrap fail after fuse-caller-save info in cprop-hardreg joey.ye at arm dot com
` (10 preceding siblings ...)
2014-11-18 15:09 ` vries at gcc dot gnu.org
@ 2014-11-19 17:44 ` vries at gcc dot gnu.org
2014-11-20 2:34 ` joey.ye at arm dot com
` (4 subsequent siblings)
16 siblings, 0 replies; 18+ messages in thread
From: vries at gcc dot gnu.org @ 2014-11-19 17:44 UTC (permalink / raw)
To: gcc-bugs
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.
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug rtl-optimization/63718] [5 Regression] ARM Thumb1 bootstrap fail after fuse-caller-save info in cprop-hardreg
2014-11-03 7:32 [Bug rtl-optimization/63718] New: ARM Thumb1 bootstrap fail after fuse-caller-save info in cprop-hardreg joey.ye at arm dot com
` (11 preceding siblings ...)
2014-11-19 17:44 ` vries at gcc dot gnu.org
@ 2014-11-20 2:34 ` joey.ye at arm dot com
2014-11-20 12:46 ` rguenth at gcc dot gnu.org
` (3 subsequent siblings)
16 siblings, 0 replies; 18+ messages in thread
From: joey.ye at arm dot com @ 2014-11-20 2:34 UTC (permalink / raw)
To: gcc-bugs
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?
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug rtl-optimization/63718] [5 Regression] ARM Thumb1 bootstrap fail after fuse-caller-save info in cprop-hardreg
2014-11-03 7:32 [Bug rtl-optimization/63718] New: ARM Thumb1 bootstrap fail after fuse-caller-save info in cprop-hardreg joey.ye at arm dot com
` (12 preceding siblings ...)
2014-11-20 2:34 ` joey.ye at arm dot com
@ 2014-11-20 12:46 ` rguenth at gcc dot gnu.org
2014-11-24 17:06 ` vries at gcc dot gnu.org
` (2 subsequent siblings)
16 siblings, 0 replies; 18+ messages in thread
From: rguenth at gcc dot gnu.org @ 2014-11-20 12:46 UTC (permalink / raw)
To: gcc-bugs
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
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug rtl-optimization/63718] [5 Regression] ARM Thumb1 bootstrap fail after fuse-caller-save info in cprop-hardreg
2014-11-03 7:32 [Bug rtl-optimization/63718] New: ARM Thumb1 bootstrap fail after fuse-caller-save info in cprop-hardreg joey.ye at arm dot com
` (13 preceding siblings ...)
2014-11-20 12:46 ` rguenth at gcc dot gnu.org
@ 2014-11-24 17:06 ` vries at gcc dot gnu.org
2014-12-02 14:13 ` joey.ye at arm dot com
2014-12-02 17:18 ` vries at gcc dot gnu.org
16 siblings, 0 replies; 18+ messages in thread
From: vries at gcc dot gnu.org @ 2014-11-24 17:06 UTC (permalink / raw)
To: gcc-bugs
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
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug rtl-optimization/63718] [5 Regression] ARM Thumb1 bootstrap fail after fuse-caller-save info in cprop-hardreg
2014-11-03 7:32 [Bug rtl-optimization/63718] New: ARM Thumb1 bootstrap fail after fuse-caller-save info in cprop-hardreg joey.ye at arm dot com
` (14 preceding siblings ...)
2014-11-24 17:06 ` vries at gcc dot gnu.org
@ 2014-12-02 14:13 ` joey.ye at arm dot com
2014-12-02 17:18 ` vries at gcc dot gnu.org
16 siblings, 0 replies; 18+ messages in thread
From: joey.ye at arm dot com @ 2014-12-02 14:13 UTC (permalink / raw)
To: gcc-bugs
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.
^ permalink raw reply [flat|nested] 18+ messages in thread
* [Bug rtl-optimization/63718] [5 Regression] ARM Thumb1 bootstrap fail after fuse-caller-save info in cprop-hardreg
2014-11-03 7:32 [Bug rtl-optimization/63718] New: ARM Thumb1 bootstrap fail after fuse-caller-save info in cprop-hardreg joey.ye at arm dot com
` (15 preceding siblings ...)
2014-12-02 14:13 ` joey.ye at arm dot com
@ 2014-12-02 17:18 ` vries at gcc dot gnu.org
16 siblings, 0 replies; 18+ messages in thread
From: vries at gcc dot gnu.org @ 2014-12-02 17:18 UTC (permalink / raw)
To: gcc-bugs
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
^ permalink raw reply [flat|nested] 18+ messages in thread