This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug rtl-optimization/57763] [4.9 Regression]: comp-goto-1.c: ICE verify_flow_info failed, error: EDGE_CROSSING missing across section boundary


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57763

--- Comment #18 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Created attachment 31852
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=31852&action=edit
gcc49-pr57763.patch

Untested fix.

So, from what I can understand, the really computed jumps are just fine, the
problem is that on some targets (well, most of them except for a few exceptions
that define HAS_LONG_UNCOND_BRANCH to non-zero)
fix_crossing_unconditional_branches turns the unconditional normal crossing
jumps into indirect jumps.  Those then satisfy computed_jump_p predicate, and
if current function has forced_labels, then make_edge later on wants to see
edges from those jumps to all the forced_labels.
But, while those crossing jumps are indirect jumps, they actually can't jump to
arbitrary labels, they will only jump to the single label they load a few insns
before the indirect jump into register, so there is no point in having edges
from them to all the forced_labels, the insns are indirect just because normal
uncondjumps aren't guaranteed to be able to jump to arbitrary code distances.

Attached is an attempt to fix this just by setting JUMP_LABEL on the indirect
jump, then computed_jump_p predicate will be false and the various places in
RTL optimizers will be told where it jumps to.  Not 100% how adding the
JUMP_LABEL plays with e.g. LABEL_NUSES, should it increment it or not, or do
only LABEL_REFs count for that?  In any case, the patch fixes the bug in the
cross compiler, can't test it on Alpha though, perhaps could test say on ppc64
and s390x which also don't define HAS_LONG_UNCOND_BRANCH to non-zero.  But, our
testsuite coverage for -freorder-blocks-and-partition is very limited anyway.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]