On Mon, Mar 07, 2022 at 07:03:17PM -0500, Marek Polacek via Gcc-patches wrote:
> 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.

But it should.

> Here, the rtvec has 0 elements because of the __thread variable: we perform
> ix86_rewrite_tls_address which calls copy_isns and that allocates the rtvec:
> 
>     XVEC (copy, i) = rtvec_alloc (XVECLEN (orig, i));

So fix *that* instead?  Everywhere else does not use length zero RTL
vectors.  copy_rtx makes sure to do the right thing here, for example.

We do not have notation to create zero-length vectors in RTL source
code either, btw.:
    case 'V':
      /* 'V' is an optional vector: if a closeparen follows,
         just store NULL for this element.  */
(optional vectors are at the end of an RTX), and if you write [] you
will hit
          fatal_with_file_and_line ("vector must have at least one element");


Segher

Reply via email to