[Bug rtl-optimization/38534] gcc 4.2.1 and above: No need to save called-saved registers in 'noreturn' function

2024-03-08 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=38534 --- Comment #46 from GCC Commits --- The master branch has been updated by Jakub Jelinek : https://gcc.gnu.org/g:a307a26e8b392ba65edfdae15489556b7701db81 commit r14-9387-ga307a26e8b392ba65edfdae15489556b7701db81 Author: Jakub Jelinek Date:

[Bug rtl-optimization/38534] gcc 4.2.1 and above: No need to save called-saved registers in 'noreturn' function

2024-02-29 Thread lukas.graetz--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=38534 --- Comment #45 from Lukas Grätz --- (In reply to Jakub Jelinek from comment #28) > (In reply to Lukas Grätz from comment #9) > > Well it is not my testcase. But I added backtracing and observed that the > > printed backtrace is unchanged with

[Bug rtl-optimization/38534] gcc 4.2.1 and above: No need to save called-saved registers in 'noreturn' function

2024-02-29 Thread lukas.graetz--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=38534 --- Comment #44 from Lukas Grätz --- (In reply to Tom Tromey from comment #39) > (In reply to Lukas Grätz from comment #36) > > > > #2 0x004011d2 in baz (a=a@entry=42, b=b@entry=43, c=c@entry=44, > > > d=, > > > e=, f= > > reading

[Bug rtl-optimization/38534] gcc 4.2.1 and above: No need to save called-saved registers in 'noreturn' function

2024-02-28 Thread lukas.graetz--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=38534 --- Comment #43 from Lukas Grätz --- (In reply to Lukas Grätz from comment #42) > (In reply to Jakub Jelinek from comment #41) > > > > No. When PR78685 would be fixed by adding artificial hidden uses of > > variables at the end of their

[Bug rtl-optimization/38534] gcc 4.2.1 and above: No need to save called-saved registers in 'noreturn' function

2024-02-28 Thread lukas.graetz--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=38534 --- Comment #42 from Lukas Grätz --- (In reply to Jakub Jelinek from comment #41) > (In reply to Lukas Grätz from comment #40) > > It seems that the reason for is ultimately -Og, not this > > patch. See Bug 78685. > > No. When PR78685 would

[Bug rtl-optimization/38534] gcc 4.2.1 and above: No need to save called-saved registers in 'noreturn' function

2024-02-28 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=38534 --- Comment #41 from Jakub Jelinek --- (In reply to Lukas Grätz from comment #40) > It seems that the reason for is ultimately -Og, not this > patch. See Bug 78685. No. When PR78685 would be fixed by adding artificial hidden uses of variables

[Bug rtl-optimization/38534] gcc 4.2.1 and above: No need to save called-saved registers in 'noreturn' function

2024-02-28 Thread lukas.graetz--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=38534 --- Comment #40 from Lukas Grätz --- (In reply to Jakub Jelinek from comment #30) > (In reply to Lukas Grätz from comment #29) > > I belief this could and should be somehow be fixed by adding DWARF info that > > certain callee-saved registers (=

[Bug rtl-optimization/38534] gcc 4.2.1 and above: No need to save called-saved registers in 'noreturn' function

2024-02-27 Thread tromey at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=38534 --- Comment #39 from Tom Tromey --- (In reply to Lukas Grätz from comment #36) > > #2 0x004011d2 in baz (a=a@entry=42, b=b@entry=43, c=c@entry=44, > > d=, > > e=, f= > reading variable: value has been optimized out>, g=48, h=49)

[Bug rtl-optimization/38534] gcc 4.2.1 and above: No need to save called-saved registers in 'noreturn' function

2024-02-27 Thread lukas.graetz--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=38534 --- Comment #38 from Lukas Grätz --- (In reply to Jakub Jelinek from comment #37) > Nowhere, just run and when it stops due to abort, just up several times > until reaching the appropriate frame. I see, this gives me: (gdb) frame 4 #4

[Bug rtl-optimization/38534] gcc 4.2.1 and above: No need to save called-saved registers in 'noreturn' function

2024-02-27 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=38534 --- Comment #37 from Jakub Jelinek --- Nowhere, just run and when it stops due to abort, just up several times until reaching the appropriate frame.

[Bug rtl-optimization/38534] gcc 4.2.1 and above: No need to save called-saved registers in 'noreturn' function

2024-02-27 Thread lukas.graetz--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=38534 --- Comment #36 from Lukas Grätz --- (In reply to Jakub Jelinek from comment #35) > If I hand edit the gcc trunk + PR114116 patch assembly, add to bar > + .cfi_undefined 3 > + .cfi_undefined 12 > + .cfi_undefined 13 > +

[Bug rtl-optimization/38534] gcc 4.2.1 and above: No need to save called-saved registers in 'noreturn' function

2024-02-27 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=38534 --- Comment #35 from Jakub Jelinek --- If I hand edit the gcc trunk + PR114116 patch assembly, add to bar + .cfi_undefined 3 + .cfi_undefined 12 + .cfi_undefined 13 + .cfi_undefined 14 + .cfi_undefined 15 then bt in

[Bug rtl-optimization/38534] gcc 4.2.1 and above: No need to save called-saved registers in 'noreturn' function

2024-02-27 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=38534 --- Comment #34 from Jakub Jelinek --- Best effort are the whatever@entry values, that is used if an argument is no longer used across the function call and isn't stored in any call saved register or stack slot. There can be also automatic

[Bug rtl-optimization/38534] gcc 4.2.1 and above: No need to save called-saved registers in 'noreturn' function

2024-02-27 Thread lukas.graetz--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=38534 --- Comment #33 from Lukas Grätz --- (In reply to Jakub Jelinek from comment #32) > (In reply to Lukas Grätz from comment #31) > > Even when I compile a simple program with gcc -O2 -g: > > > > #include > > int main(int argc, char** argv) { > >

[Bug rtl-optimization/38534] gcc 4.2.1 and above: No need to save called-saved registers in 'noreturn' function

2024-02-27 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=38534 --- Comment #32 from Jakub Jelinek --- (In reply to Lukas Grätz from comment #31) > Even when I compile a simple program with gcc -O2 -g: > > #include > int main(int argc, char** argv) { > abort(); > } > > > I still get an "argc=":

[Bug rtl-optimization/38534] gcc 4.2.1 and above: No need to save called-saved registers in 'noreturn' function

2024-02-27 Thread lukas.graetz--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=38534 --- Comment #31 from Lukas Grätz --- (In reply to Jakub Jelinek from comment #30) > (In reply to Lukas Grätz from comment #29) > > Yes, when a backtrace is based on rbp, one needs -fno-omit-frame-pointer. I > > trusted comment #10 here, as it

[Bug rtl-optimization/38534] gcc 4.2.1 and above: No need to save called-saved registers in 'noreturn' function

2024-02-27 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=38534 --- Comment #30 from Jakub Jelinek --- (In reply to Lukas Grätz from comment #29) > Yes, when a backtrace is based on rbp, one needs -fno-omit-frame-pointer. I > trusted comment #10 here, as it made sense. See PR114116. > glibc's backtrace()

[Bug rtl-optimization/38534] gcc 4.2.1 and above: No need to save called-saved registers in 'noreturn' function

2024-02-27 Thread lukas.graetz--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=38534 --- Comment #29 from Lukas Grätz --- (In reply to Jakub Jelinek from comment #28) > (In reply to Lukas Grätz from comment #9) > > Well it is not my testcase. But I added backtracing and observed that the > > printed backtrace is unchanged with

[Bug rtl-optimization/38534] gcc 4.2.1 and above: No need to save called-saved registers in 'noreturn' function

2024-02-27 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=38534 --- Comment #28 from Jakub Jelinek --- (In reply to Lukas Grätz from comment #9) > Well it is not my testcase. But I added backtracing and observed that the > printed backtrace is unchanged with your patch. The new > no_return_to_caller(): You

[Bug rtl-optimization/38534] gcc 4.2.1 and above: No need to save called-saved registers in 'noreturn' function

2024-02-01 Thread lukas.graetz--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=38534 --- Comment #27 from Lukas Grätz --- (In reply to Jakub Jelinek from comment #26) > (In reply to Lukas Grätz from comment #25) > > (In reply to Jakub Jelinek from comment #19) > > > (In reply to H.J. Lu from comment #18) > > > > (In reply to

[Bug rtl-optimization/38534] gcc 4.2.1 and above: No need to save called-saved registers in 'noreturn' function

2024-02-01 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=38534 --- Comment #26 from Jakub Jelinek --- (In reply to Lukas Grätz from comment #25) > (In reply to Jakub Jelinek from comment #19) > > (In reply to H.J. Lu from comment #18) > > > (In reply to Jakub Jelinek from comment #17) > > > > E.g. shouldn't

[Bug rtl-optimization/38534] gcc 4.2.1 and above: No need to save called-saved registers in 'noreturn' function

2024-02-01 Thread lukas.graetz--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=38534 --- Comment #25 from Lukas Grätz --- (In reply to Jakub Jelinek from comment #19) > (In reply to H.J. Lu from comment #18) > > (In reply to Jakub Jelinek from comment #17) > > > E.g. shouldn't it at least be disabled for -O0 and -Og and

[Bug rtl-optimization/38534] gcc 4.2.1 and above: No need to save called-saved registers in 'noreturn' function

2024-01-29 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=38534 --- Comment #24 from GCC Commits --- The master branch has been updated by H.J. Lu : https://gcc.gnu.org/g:291f75fa1bc6a23c6184bb99c726074b13f2f18e commit r14-8495-g291f75fa1bc6a23c6184bb99c726074b13f2f18e Author: H.J. Lu Date: Sat Jan 27

[Bug rtl-optimization/38534] gcc 4.2.1 and above: No need to save called-saved registers in 'noreturn' function

2024-01-27 Thread hjl.tools at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=38534 --- Comment #23 from H.J. Lu --- (In reply to Andrew Burgess from comment #21) > Setting to DW_CFA_undefined is the right thing to do. DWARF says: > > The DW_CFA_undefined instruction takes a single unsigned LEB128 operand > that

[Bug rtl-optimization/38534] gcc 4.2.1 and above: No need to save called-saved registers in 'noreturn' function

2024-01-27 Thread hjl.tools at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=38534 --- Comment #22 from H.J. Lu --- Created attachment 57243 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57243=edit A patch to generate .cfi_undefined for unsaved callee-saved registers

[Bug rtl-optimization/38534] gcc 4.2.1 and above: No need to save called-saved registers in 'noreturn' function

2024-01-27 Thread aburgess at redhat dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=38534 --- Comment #21 from Andrew Burgess --- Setting to DW_CFA_undefined is the right thing to do. DWARF says: The DW_CFA_undefined instruction takes a single unsigned LEB128 operand that represents a register number. The required action is to

[Bug rtl-optimization/38534] gcc 4.2.1 and above: No need to save called-saved registers in 'noreturn' function

2024-01-27 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=38534 Jakub Jelinek changed: What|Removed |Added CC||aburgess at redhat dot com,

[Bug rtl-optimization/38534] gcc 4.2.1 and above: No need to save called-saved registers in 'noreturn' function

2024-01-27 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=38534 --- Comment #19 from Jakub Jelinek --- (In reply to H.J. Lu from comment #18) > (In reply to Jakub Jelinek from comment #17) > > E.g. shouldn't it at least be disabled for -O0 and -Og and shouldn't we > > We can disable this for -O0 and -Og. I

[Bug rtl-optimization/38534] gcc 4.2.1 and above: No need to save called-saved registers in 'noreturn' function

2024-01-27 Thread hjl.tools at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=38534 --- Comment #18 from H.J. Lu --- (In reply to Jakub Jelinek from comment #17) > E.g. shouldn't it at least be disabled for -O0 and -Og and shouldn't we We can disable this for -O0 and -Og. > somehow indicate in DWARF unwind info that the

[Bug rtl-optimization/38534] gcc 4.2.1 and above: No need to save called-saved registers in 'noreturn' function

2024-01-27 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=38534 --- Comment #17 from Jakub Jelinek --- E.g. shouldn't it at least be disabled for -O0 and -Og and shouldn't we somehow indicate in DWARF unwind info that the callee saved registers weren't saved and were clobbered? Even if backtrace itself

[Bug rtl-optimization/38534] gcc 4.2.1 and above: No need to save called-saved registers in 'noreturn' function

2024-01-27 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=38534 Jakub Jelinek changed: What|Removed |Added CC||jakub at gcc dot gnu.org --- Comment

[Bug rtl-optimization/38534] gcc 4.2.1 and above: No need to save called-saved registers in 'noreturn' function

2024-01-27 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=38534 --- Comment #15 from GCC Commits --- The master branch has been updated by H.J. Lu : https://gcc.gnu.org/g:7cc9adc62cee0aa91ce834b3dd6296ce38f1d79d commit r14-8470-g7cc9adc62cee0aa91ce834b3dd6296ce38f1d79d Author: H.J. Lu Date: Tue Jan 23

[Bug rtl-optimization/38534] gcc 4.2.1 and above: No need to save called-saved registers in 'noreturn' function

2024-01-15 Thread lukas.graetz--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=38534 --- Comment #14 from Lukas Grätz --- Never mind my above comments. I just realized that attribute nothrow has no effect in C, unless -fexceptions. So nothrow is not needed (only -fno-exceptions). Furthermore, most noreturn functions throw in

[Bug rtl-optimization/38534] gcc 4.2.1 and above: No need to save called-saved registers in 'noreturn' function

2024-01-15 Thread lukas.graetz--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=38534 --- Comment #13 from Lukas Grätz --- (In reply to Lukas Grätz from comment #12) > CODE, uses loop unwinding functions >a) restores all callee-saved registers in f3(), f2() >b) restores %rsp and %rip from stack of f2() I meant

[Bug rtl-optimization/38534] gcc 4.2.1 and above: No need to save called-saved registers in 'noreturn' function

2024-01-15 Thread lukas.graetz--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=38534 --- Comment #12 from Lukas Grätz --- (In reply to H.J. Lu from comment #10) > The C++ test issue is caused by missing callee-saved registers for > exception supports in noreturn functions in libstdc++. I fixed it by > keeping callee-saved

[Bug rtl-optimization/38534] gcc 4.2.1 and above: No need to save called-saved registers in 'noreturn' function

2024-01-14 Thread lukas.graetz--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=38534 --- Comment #11 from Lukas Grätz --- (In reply to H.J. Lu from comment #10) > The C++ test issue is caused by missing callee-saved registers for > exception supports in noreturn functions in libstdc++. I fixed it by > keeping callee-saved

[Bug rtl-optimization/38534] gcc 4.2.1 and above: No need to save called-saved registers in 'noreturn' function

2024-01-14 Thread hjl.tools at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=38534 --- Comment #10 from H.J. Lu --- (In reply to Lukas Grätz from comment #9) > Well it is not my testcase. But I added backtracing and observed that the > printed backtrace is unchanged with your patch. The new > no_return_to_caller(): > > void

[Bug rtl-optimization/38534] gcc 4.2.1 and above: No need to save called-saved registers in 'noreturn' function

2024-01-14 Thread lukas.graetz--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=38534 --- Comment #9 from Lukas Grätz --- (In reply to H.J. Lu from comment #8) > (In reply to Lukas Grätz from comment #7) > > (In reply to H.J. Lu from comment #4) > > > When I compiled __cxxabiv1::__cxa_throw, which is a noreturn function in > > >

[Bug rtl-optimization/38534] gcc 4.2.1 and above: No need to save called-saved registers in 'noreturn' function

2024-01-14 Thread hjl.tools at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=38534 H.J. Lu changed: What|Removed |Added Ever confirmed|0 |1 Last reconfirmed|

[Bug rtl-optimization/38534] gcc 4.2.1 and above: No need to save called-saved registers in 'noreturn' function

2024-01-14 Thread lukas.graetz--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=38534 --- Comment #7 from Lukas Grätz --- (In reply to H.J. Lu from comment #4) > When I compiled __cxxabiv1::__cxa_throw, which is a noreturn function in > libstdc++-v3/libsupc++/eh_throw.cc not to save callee-saved registers, > most of C++ exception

[Bug rtl-optimization/38534] gcc 4.2.1 and above: No need to save called-saved registers in 'noreturn' function

2024-01-14 Thread lukas.graetz--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=38534 Lukas Grätz changed: What|Removed |Added CC||lukas.graetz@tu-darmstadt.d

[Bug rtl-optimization/38534] gcc 4.2.1 and above: No need to save called-saved registers in 'noreturn' function

2024-01-12 Thread sjames at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=38534 Sam James changed: What|Removed |Added CC||sjames at gcc dot gnu.org See

[Bug rtl-optimization/38534] gcc 4.2.1 and above: No need to save called-saved registers in 'noreturn' function

2024-01-12 Thread hjl.tools at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=38534 --- Comment #4 from H.J. Lu --- When I compiled __cxxabiv1::__cxa_throw, which is a noreturn function in libstdc++-v3/libsupc++/eh_throw.cc not to save callee-saved registers, most of C++ exception tests crashed.

[Bug rtl-optimization/38534] gcc 4.2.1 and above: No need to save called-saved registers in 'noreturn' function

2011-11-06 Thread js at alien8 dot de
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38534 Julian Stecklina js at alien8 dot de changed: What|Removed |Added CC||js at alien8 dot de

[Bug rtl-optimization/38534] gcc 4.2.1 and above: No need to save called-saved registers in 'noreturn' function

2008-12-16 Thread thutt at vmware dot com
--- Comment #2 from thutt at vmware dot com 2008-12-16 14:03 --- (In reply to comment #1) The reason why they are saved is so that you can have a good way of debugging noreturn functions. Can you please elaborate? How is saving these registers, which will never be restored, going

[Bug rtl-optimization/38534] gcc 4.2.1 and above: No need to save called-saved registers in 'noreturn' function

2008-12-15 Thread pinskia at gcc dot gnu dot org
--- Comment #1 from pinskia at gcc dot gnu dot org 2008-12-15 23:26 --- The reason why they are saved is so that you can have a good way of debugging noreturn functions. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38534