diff options
author | Marek Polacek <polacek@redhat.com> | 2022-03-07 16:15:46 -0500 |
---|---|---|
committer | Marek Polacek <polacek@redhat.com> | 2022-03-08 14:00:32 -0500 |
commit | e1133c0205a7e2a65834a1af780b8da15eead2a9 (patch) | |
tree | a28e28ea0b6de226326d501cf7b71dca07d4ff9a /gcc/fortran/frontend-passes.cc | |
parent | 23ed4df521db9d66782d3f9cf291fc2564cf313a (diff) | |
download | gcc-e1133c0205a7e2a65834a1af780b8da15eead2a9.zip gcc-e1133c0205a7e2a65834a1af780b8da15eead2a9.tar.gz gcc-e1133c0205a7e2a65834a1af780b8da15eead2a9.tar.bz2 |
rtl: ICE with thread_local and inline asm [PR104777]
In r270550, Jakub fixed classify_insn to handle asm goto: if the asm can
jump to a label, the insn should be a JUMP_INSN.
However, as the following testcase shows, non-null ASM_OPERANDS_LABEL_VEC
doesn't guarantee that the rtx has any actual labels it can branch to.
Here, the rtvec has 0 elements because expand_asm_stmt created it:
rtvec labelvec = rtvec_alloc (nlabels); // nlabels == 0
This causes an ICE in update_br_prob_note: BRANCH_EDGE (bb) crashes
because there's no branch edge. I think we can fix this by checking
that there is at least one label the asm can jump to before wrapping
the ASM_OPERANDS in a JUMP_INSN.
PR rtl-optimization/104777
gcc/ChangeLog:
* rtl.cc (classify_insn): For ASM_OPERANDS, return JUMP_INSN only if
ASM_OPERANDS_LABEL_VEC has at least one element.
gcc/testsuite/ChangeLog:
* gcc.dg/torture/tls/pr104777.c: New test.
Diffstat (limited to 'gcc/fortran/frontend-passes.cc')
0 files changed, 0 insertions, 0 deletions