[Bug c/98630] Seg-fault when using a goto after condition (if)

2021-01-12 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98630 --- Comment #15 from Jakub Jelinek --- Yes, that -Wjump-misses-init or -Wc++-compat.

[Bug c/98630] Seg-fault when using a goto after condition (if)

2021-01-12 Thread k.even-mendoza at imperial dot ac.uk via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98630 --- Comment #14 from Karine EM --- I did compile it that way: > gcc-10 -w -O2 r.c -pedantic -Wall -Wextra but got no warnings at all. Should I add any flag? Thanks!

[Bug c/98630] Seg-fault when using a goto after condition (if)

2021-01-12 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98630 --- Comment #13 from Jakub Jelinek --- Then -Wjump-misses-init should warn even on the unreduced testcase...

[Bug c/98630] Seg-fault when using a goto after condition (if)

2021-01-12 Thread k.even-mendoza at imperial dot ac.uk via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98630 --- Comment #12 from Karine EM --- Yes, I could do that (comment #7). But I reduce manually the program and the problem was indeed the scenario in comment #8 (not between functions, only different blocks, but I assume it is pretty much the same).

[Bug c/98630] Seg-fault when using a goto after condition (if)

2021-01-12 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98630 --- Comment #11 from Jakub Jelinek --- The reason why C++ has it as hard error is I think object construction/destruction, in C the warning is for code to be portable to C++, in plain C it is all about making sure variables are initialized, which

[Bug c/98630] Seg-fault when using a goto after condition (if)

2021-01-12 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98630 --- Comment #10 from Jakub Jelinek --- Maybe, but I think it is too late to do it now for GCC 11, it will take time before we figure out how many projects will be affected by that.

[Bug c/98630] Seg-fault when using a goto after condition (if)

2021-01-12 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98630 --- Comment #9 from Richard Biener --- Given we now place CLOBBERS at scope ends even for C code (which is why we "miscompile" the reduced testcase) doesn't it make sense to at least include -Wjump-misses-init into -W[extra] or even -Wall?

[Bug c/98630] Seg-fault when using a goto after condition (if)

2021-01-12 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98630 --- Comment #8 from Jakub Jelinek --- For goto crossing initialization, C++ makes it a hard error and C only has a non-default warning (not even in -W), -Wjump-misses-init included in -Wc++-compat. As can be seen on: int foo (void) { goto a;

[Bug c/98630] Seg-fault when using a goto after condition (if)

2021-01-12 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98630 Jakub Jelinek changed: What|Removed |Added CC||jakub at gcc dot gnu.org --- Comment #7

[Bug c/98630] Seg-fault when using a goto after condition (if)

2021-01-12 Thread k.even-mendoza at imperial dot ac.uk via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98630 --- Comment #6 from Karine EM --- Created attachment 49945 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=49945&action=edit Original large code that caused Seg-fault in GCC-10

[Bug c/98630] Seg-fault when using a goto after condition (if)

2021-01-12 Thread k.even-mendoza at imperial dot ac.uk via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98630 --- Comment #5 from Karine EM --- This is an automatically reduced program. If GCC will give the Wuninitialized warning I can reduce the original program again, taking it into account. I attached the long program in case you find it helpful. It

[Bug c/98630] Seg-fault when using a goto after condition (if)

2021-01-12 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98630 Richard Biener changed: What|Removed |Added Status|RESOLVED|NEW Assignee|rguenth at gcc d