[Bug target/93047] frename-registers does not work well with __builtin_return
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93047 --- Comment #7 from CVS Commits --- The releases/gcc-9 branch has been updated by Jiu Fu Guo : https://gcc.gnu.org/g:0ce89ea10d93a583854f02bc115e05cfd9d818e4 commit r9-8282-g0ce89ea10d93a583854f02bc115e05cfd9d818e4 Author: Jiufu Guo Date: Mon Feb 17 10:48:39 2020 +0800 rs6000: mark clobber for registers changed by untpyed_call As PR93047 said, __builtin_apply/__builtin_return does not work well with -frename-registers. This is caused by return register(e.g. r3) is used to rename another register, before return register is stored to stack. This patch fix this issue by emitting clobber for those egisters which maybe changed by untyped call. gcc/ 2020-02-26 Jiufu Guo PR target/93047 * config/rs6000/rs6000.md (untyped_call): Add emit_clobber. gcc/testsuite 2020-02-26 Jiufu Guo PR target/93047 * gcc.dg/torture/stackalign/builtin-return-2.c: New test case.
[Bug target/93047] frename-registers does not work well with __builtin_return
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93047 Jiu Fu Guo changed: What|Removed |Added Status|ASSIGNED|RESOLVED Resolution|--- |FIXED --- Comment #6 from Jiu Fu Guo --- Patch committed.
[Bug target/93047] frename-registers does not work well with __builtin_return
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93047 --- Comment #5 from CVS Commits --- The master branch has been updated by Jiu Fu Guo : https://gcc.gnu.org/g:a8532e9927ad6e4bbedbb957b02ca413aedf9098 commit r10-6664-ga8532e9927ad6e4bbedbb957b02ca413aedf9098 Author: Jiufu Guo Date: Mon Feb 17 10:48:39 2020 +0800 rs6000: mark clobber for registers changed by untpyed_call As PR93047 said, __builtin_apply/__builtin_return does not work well with -frename-registers. This is caused by return register(e.g. r3) is used to rename another register, before return register is stored to stack. This patch fix this issue by emitting clobber for those egisters which maybe changed by untyped call. gcc/ 2020-02-17 Jiufu Guo PR target/93047 * config/rs6000/rs6000.md (untyped_call): Add emit_clobber. gcc/testsuite 2020-02-17 Jiufu Guo PR target/93047 * gcc.dg/torture/stackalign/builtin-return-2.c: New test case.
[Bug target/93047] frename-registers does not work well with __builtin_return
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93047 Jiu Fu Guo changed: What|Removed |Added Status|UNCONFIRMED |ASSIGNED Last reconfirmed||2020-02-17 Assignee|unassigned at gcc dot gnu.org |guojiufu at gcc dot gnu.org Ever confirmed|0 |1
[Bug target/93047] frename-registers does not work well with __builtin_return
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93047 --- Comment #4 from Jiu Fu Guo --- Checking dumps, some info like below: Before rnreg, there are insns: 127: call [`foo'] argc 0 242: %0:DI=%31:DI+0x220 128: [%31:DI+0x200]=%3:DI 359: %2:TI=%2:TI<-<0x40 449: %3:DI=%0:DI 360: [%3:DI]=%2:TI<-<0x40 391: %2:TI=[%3:DI]<-<0x40 1. During rnreg, two chains "242--449" and "449--360--391" are tied, since "449:" is just a reg move. And rnreg selects the dest reg(%3:DI) of "449" as regno of the tied chain. 2. While actually, %3:DI is used at "128:", and set by "127: call [`foo'] argc 0". "127--128" overlap with "242--449". 3. __builtin_apply generates "127: call [`foo'] argc 0". this insn does not set "return register". For a normal function call "int r = foo ();", "127: %3:DI=call [`foo'] argc 0 may be generated.
[Bug target/93047] frename-registers does not work well with __builtin_return
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93047 --- Comment #3 from Jiu Fu Guo --- On P9, "gcc $GCC_SRC/gcc/testsuite/gcc.dg/torture/stackalign/builtin-return-1.c -O3 -frename-registers -o ./builtin-return-1.exe" could reproduce this issue without -fpic. On P8, to reproduce this issue, -fpic is needed.
[Bug target/93047] frename-registers does not work well with __builtin_return
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93047 --- Comment #2 from Jiu Fu Guo --- Sorry for missing -fpic gcc builtin-return-1.c -O3 -fpic -frename-registers -o ./builtin-return-1.exe and this issue can be reproduced on gcc7.4, gcc6.4 is ok.
[Bug target/93047] frename-registers does not work well with __builtin_return
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93047 Segher Boessenkool changed: What|Removed |Added CC||segher at gcc dot gnu.org --- Comment #1 from Segher Boessenkool --- I cannot reproduce this problem. What am I missing?