public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "rguenth at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug inline-asm/98991] ICE: Max. number of generated reload insns per insn is achieved (90)
Date: Mon, 08 Feb 2021 09:34:25 +0000	[thread overview]
Message-ID: <bug-98991-4-dm83i5mgNE@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-98991-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98991

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |accepts-invalid
          Component|c++                         |inline-asm

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
it looks reduced ad absurdum but the issue must lie in

 asm("":"=rmf"(f),"=d"([t(reinterpret_cast<int>(0))]{}):"0"(((0))),""((0)));

which I can't really parse but we expand from

int {anonymous}::n ()
{
  int D.2351;
  struct ._anon_1 t;
  float f;
  int D.2422;
  struct ._anon_0 D.2374;
  register int * D.2360;
  void * _1;
  int _5;

;;   basic block 2, loop depth 0
;;    pred:       ENTRY
  D.2374.__t = 0;
  __asm__("" : "=rmf" f, "=d" D.2374 : "0" 0, "" 0);

likely D.2374 is not re-loadable into DREG.  The zero seems to be SFmode:

(insn 6 2 7 2 (set (reg:SI 86)
        (const_int 0 [0])) "t.ii":1:163 75 {*movsi_internal}
     (nil))
(insn 7 6 11 2 (parallel [
            (set (mem/c:SF (plus:DI (reg/f:DI 19 frame)
                        (const_int -4 [0xfffffffffffffffc])) [1 f+0 S4 A32])
                (asm_operands:SF ("") ("=rmf") 0 [
                        (reg:SI 86)
                        (const_int 0 [0])
                    ]
                     [
                        (asm_input:SI ("0") t.ii:1)
                        (asm_input:SI ("") t.ii:1)
                    ]
                     [] t.ii:1))
            (set (reg:SI 84 [ D.2374 ])
                (asm_operands:SI ("") ("=d") 1 [
                        (reg:SI 86)
                        (const_int 0 [0])
                    ]
                     [
                        (asm_input:SI ("0") t.ii:1)
                        (asm_input:SI ("") t.ii:1)
                    ]
                     [] t.ii:1))
            (clobber (reg:CC 17 flags))
        ]) "t.ii":1:163 -1
     (expr_list:REG_DEAD (reg:SI 86)
        (expr_list:REG_UNUSED (reg:SI 84 [ D.2374 ])
            (expr_list:REG_UNUSED (reg:CC 17 flags)
                (nil)))))

and we fail to reload.  It _looks_ similar to

void foo(float f)
{
  struct { float f; } x;
  asm("": "=f" (f), "=d" (x) : "0" (0), "" (0));
}

but we reject this via

t.i: In function 'void foo(float)':
t.i:4:3: error: inconsistent operand constraints in an 'asm'
    4 |   asm("": "=f" (f), "=d" (x) : "0" (0), "" (0));
      |   ^~~

  parent reply	other threads:[~2021-02-08  9:34 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-07 23:00 [Bug c++/98991] New: " zhan3299 at purdue dot edu
2021-02-08  9:06 ` [Bug c++/98991] " marxin at gcc dot gnu.org
2021-02-08  9:34 ` rguenth at gcc dot gnu.org [this message]
2021-02-08 15:31 ` [Bug inline-asm/98991] " zhan3299 at purdue dot edu
2021-02-08 15:36 ` zhan3299 at purdue dot edu
2021-09-14  7:34 ` [Bug target/98991] " pinskia at gcc dot gnu.org

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=bug-98991-4-dm83i5mgNE@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /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).