RFA: Orphaned jumptable not deleted causing enable checking abort.

Graham Stott graham.stott@btinternet.com
Wed Aug 7 17:43:00 GMT 2002


All,

I've got an interesting testcase which fails on mips, sh, frv, x86, ppceabi,
d30v, h8300, ip2k, mcore, s390, xstormy16, v850 but passes on  sh64, arm, xscale,

The failures are all the same enable checking failure in verify_flow_insn. which
triggers compiling the testcase at -O2

bug.c: In function `main':
bug.c:39: error: verify_flow_info: Incorrect fallthru 5->6
bug.c:39: error: wrong insn in the fallthru edge
(jump_insn:HI 124 123 329 (nil) (addr_vec:SI [
             (label_ref:SI 163)
             (label_ref:SI 163)
             (label_ref:SI 163)
             (label_ref:SI 163)
             (label_ref:SI 163)
         ]) -1 (nil)
     (nil))

The problem is we end up with an orphaned jumptable for exmaple on x86

(jump_insn 330 116 331 (nil) (set (pc)
         (label_ref 329)) 368 {jump} (insn_list 115 (insn_list 116 (nil)))
     (nil))

(barrier 331 330 123)

(code_label:HI 123 331 124 21 "" [0 uses])

(jump_insn:HI 124 123 125 (nil) (addr_vec:SI [
             (label_ref:SI 163)
             (label_ref:SI 163)
             (label_ref:SI 163)
             (label_ref:SI 163)
             (label_ref:SI 163)
         ]) -1 (nil)
     (nil))

Where the code_label at insn 123 is not used and the insn 163 refered to by
the label_ref is no longer in the insn chain.

Q. Is there any code which is supposed to get purge these orphaned jumptables?

Graham
ps. -fno-reorder-blocks allows the testcase to compile but not link because of
an undefined label (i.e. code label associated with label_ref:SI 164.)

It looks like the jumptable is orphaned during the flow2 pass.

------------------------------------------------------------------------------
int insn_code;
int insn2_code;

int
main ()
{
  switch (insn_code)
    {
    case 0: return  (insn2_code != 62 ? 0 : 0);
    case 20:
      switch (insn2_code)
        {
        case 34: return 4;
        default: return (insn2_code != 62 ? 3 : 0);
        }
    case 22:
      switch (insn2_code)
        {
        case 32: return 4;
        case 31: return 4;
        case 30: return 4;
        case 29: return 4;
        case 28: return 4;
        default: return (insn2_code != 62 ? 3 : 0);
        }
    case 25:
      switch (insn2_code)
        {
        case 34: return 4;
        case 33: return 4;
        case 32: return 4;
        case 31: return 4;
        case 30: return 4;
        default: return (insn2_code != 62 ? 3 : 0);
        }
    case 26: return (insn2_code != 62 ? 0 : 0);
    default: return 0;
    }
}
---------------------------------------------------------------




More information about the Gcc-bugs mailing list