[Bug tree-optimization/89280] [7/8/9 Regression] ICE: Segmentation fault (in is_gimple_reg_type)
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89280 --- Comment #10 from Jakub Jelinek --- Author: jakub Date: Wed Feb 27 08:41:01 2019 New Revision: 269243 URL: https://gcc.gnu.org/viewcvs?rev=269243=gcc=rev Log: PR tree-optimization/89280 * tree-cfgcleanup.c (maybe_dead_abnormal_edge_p, builtin_setjmp_setup_bb): New functions. (cleanup_control_flow_pre): Ignore maybe_dead_abnormal_edge_p edges. When visiting __builtin_setjmp_setup block, queue in special setjmp_vec vector edges from .ABNORMAL_DISPATCHER to corresponding __builtin_setjmp_receiver. Remove .ABNORMAL_DISPATCHER basic blocks from visited after the loop if they don't have any visited successor blocks. * gcc.c-torture/compile/pr89280.c: New test. * gcc.dg/torture/pr57147-2.c: Don't expect a setjmp after noreturn function. Skip the test for -O0. Added: trunk/gcc/testsuite/gcc.c-torture/compile/pr89280.c Modified: trunk/gcc/ChangeLog trunk/gcc/testsuite/ChangeLog trunk/gcc/testsuite/gcc.dg/torture/pr57147-2.c trunk/gcc/tree-cfgcleanup.c
[Bug tree-optimization/89280] [7/8/9 Regression] ICE: Segmentation fault (in is_gimple_reg_type)
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89280 Jakub Jelinek changed: What|Removed |Added Attachment #45783|0 |1 is obsolete|| --- Comment #9 from Jakub Jelinek --- Created attachment 45798 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=45798=edit gcc9-pr89280.patch Updated patch. The previous patch completely broke __builtin_setjmp_{setup,receiver} handling, where the latter is normally only reachable through EDGE_ABNORMAL edge. We need to make those visited if the corresponding __builtin_setjmp_setup is visited.
[Bug tree-optimization/89280] [7/8/9 Regression] ICE: Segmentation fault (in is_gimple_reg_type)
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89280 --- Comment #8 from Jakub Jelinek --- Seems to work fine even if the dead returns_twice call is found later, e.g. on int a; void foo (void); __attribute__ ((returns_twice)) int bar (void); void baz (int, int); static inline void inl (int x) { while (x) foo (); } void qux (void) { inl (1); baz (bar (), a); } it simplifies the GIMPLE IL in einline (and further in ethread), in the end generates in this case the same assembly, because we don't have those edges in RTL and so RTL optimizations cure it. But the abnormal SSA_NAMEs etc. could get in the way of quite a few optimizations.
[Bug tree-optimization/89280] [7/8/9 Regression] ICE: Segmentation fault (in is_gimple_reg_type)
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89280 Jakub Jelinek changed: What|Removed |Added Status|NEW |ASSIGNED Assignee|unassigned at gcc dot gnu.org |jakub at gcc dot gnu.org --- Comment #7 from Jakub Jelinek --- Created attachment 45783 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=45783=edit gcc9-pr89280.patch Untested fix.
[Bug tree-optimization/89280] [7/8/9 Regression] ICE: Segmentation fault (in is_gimple_reg_type)
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89280 --- Comment #6 from Jakub Jelinek --- On the other side, after going into SSA, the ABNORMAL_DISPATCHER successors would have PHIs for the SSA_NAMEs and thus ICE like this wouldn't happen, so in theory we could do something in the cfg pass itself only.
[Bug tree-optimization/89280] [7/8/9 Regression] ICE: Segmentation fault (in is_gimple_reg_type)
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89280 --- Comment #5 from Jakub Jelinek --- The problem is that it might be still reachable through both normal and abnormal edges during cfg and might become unreachable only later (e.g. inlining or whatever other opt), so we need something that will be able to cope with it at any time. Even if we improve decisions from which bbs to add edges to the ABNORMAL_DISPATCHER, as we use one dispatcher for the whole function and can mix non-local gotos etc. with returns_twice functions, I think we can't avoid this problem, r8 e.g. could have a non-local goto to some other bb and so would have EDGE_ABNORMAL edge to the dispatcher.
[Bug tree-optimization/89280] [7/8/9 Regression] ICE: Segmentation fault (in is_gimple_reg_type)
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89280 --- Comment #4 from Richard Biener --- The issue is that r8 () is a source of abnormal edges which makes the abnormal dispatcher reachable. I think the testcase becomes clearer when one uses setjmp instead of vfork since I'm not sure why we have full abnormal handling for vfork at all. It might work if we build the CFG first w/o any abnormal edges, then prune unreachable blocks, and only after that do abnormal edge creation. Also we could then build dominators on the CFG w/o abnormal edges and use simple reachability analysis on that to determine if we need to add outgoing abnormal edges to calls or not (like in this case the one out of r8() is not needed). OTOH with non-local goto the reachability analysis w/o abnormals would be flawed...
[Bug tree-optimization/89280] [7/8/9 Regression] ICE: Segmentation fault (in is_gimple_reg_type)
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89280 --- Comment #3 from Jakub Jelinek --- *** Bug 89283 has been marked as a duplicate of this bug. ***
[Bug tree-optimization/89280] [7/8/9 Regression] ICE: Segmentation fault (in is_gimple_reg_type)
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89280 Jakub Jelinek changed: What|Removed |Added Target Milestone|--- |7.5
[Bug tree-optimization/89280] [7/8/9 Regression] ICE: Segmentation fault (in is_gimple_reg_type)
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89280 Jakub Jelinek changed: What|Removed |Added CC||jakub at gcc dot gnu.org --- Comment #2 from Jakub Jelinek --- Ugh, this is nasty. We add the ABNORMAL_DISPATCHER etc. because vfork returns twice, but because the call is in unreachable code, we remove the block that defines the SSA_NAME but nothing finds out that because the vfork was originally unreachable, it can't be reached abnormally either. So perhaps improve the unreachable block analysis that edges from ABNORMAL_DISPATCHER are only valid if a block is reachable through some other edges too?
[Bug tree-optimization/89280] [7/8/9 Regression] ICE: Segmentation fault (in is_gimple_reg_type)
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89280 Martin Liška changed: What|Removed |Added Status|UNCONFIRMED |NEW Last reconfirmed||2019-02-11 CC||marxin at gcc dot gnu.org, ||rguenth at gcc dot gnu.org Ever confirmed|0 |1 --- Comment #1 from Martin Liška --- Started with r235817.