public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Segher Boessenkool <segher@kernel.crashing.org>
To: Marek Polacek <polacek@redhat.com>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>, Jakub Jelinek <jakub@redhat.com>
Subject: Re: [PATCH] rtl: ICE with thread_local and inline asm  [PR104777]
Date: Mon, 7 Mar 2022 19:19:09 -0600	[thread overview]
Message-ID: <20220308011909.GN614@gate.crashing.org> (raw)
In-Reply-To: <20220308000317.93455-1-polacek@redhat.com>

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	other threads:[~2022-03-08  1:20 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-08  0:03 Marek Polacek
2022-03-08  1:19 ` Segher Boessenkool [this message]
2022-03-08 15:08   ` Marek Polacek
2022-03-08 15:14     ` Segher Boessenkool
2022-03-08 15:25       ` Marek Polacek
2022-03-08 15:49         ` Segher Boessenkool
2022-03-08 16:09           ` Marek Polacek
2022-03-08 16:12           ` Jakub Jelinek
2022-03-08 16:18             ` Marek Polacek
2022-03-08 16:24             ` Segher Boessenkool
2022-03-08 16:33               ` [PATCH v2] " Marek Polacek
2022-03-08 16:40                 ` Jakub Jelinek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220308011909.GN614@gate.crashing.org \
    --to=segher@kernel.crashing.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jakub@redhat.com \
    --cc=polacek@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).