public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/115521] New: ICE at -O1 with "-fno-tree-ccp -fno-tree-dominator-opts" on x86_64-linux-gnu: in extract_constrain_insn, at recog.cc:2713
@ 2024-06-17 11:59 zhendong.su at inf dot ethz.ch
  2024-06-17 12:50 ` [Bug rtl-optimization/115521] " ubizjak at gmail dot com
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: zhendong.su at inf dot ethz.ch @ 2024-06-17 11:59 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 115521
           Summary: ICE at -O1 with "-fno-tree-ccp
                    -fno-tree-dominator-opts" on x86_64-linux-gnu: in
                    extract_constrain_insn, at recog.cc:2713
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: zhendong.su at inf dot ethz.ch
  Target Milestone: ---

It appears to be a recent regression as it doesn't reproduce with 13.* and
earlier. 

Compiler Explorer: https://godbolt.org/z/qEb7fcaf1

The reduced test is still quite big, but it seems difficult to get it to be
much smaller. 


[524] % gcctk -v
Using built-in specs.
COLLECT_GCC=gcctk
COLLECT_LTO_WRAPPER=/local/suz-local/software/local/gcc-trunk/libexec/gcc/x86_64-pc-linux-gnu/15.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc-trunk/configure --disable-bootstrap
--enable-checking=yes --prefix=/local/suz-local/software/local/gcc-trunk
--enable-sanitizers --enable-languages=c,c++ --disable-werror --enable-multilib
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 15.0.0 20240617 (experimental) (GCC) 
[525] % 
[525] % gcctk -O1 -fno-tree-ccp -fno-tree-dominator-opts -c -w small.c
small.c: In function ‘bi’:
small.c:188:1: error: insn does not satisfy its constraints:
  188 | }
      | ^
(insn 19 968 967 2 (parallel [
            (set (strict_low_part (reg:QI 2 cx [orig:415 bj ] [415]))
                (ior:QI (subreg:QI (zero_extract:HI (reg/v:HI 2 cx [orig:415 bj
] [415])
                            (const_int 8 [0x8])
                            (const_int 8 [0x8])) 0)
                    (reg:QI 0 ax [orig:99 c.3_4 ] [99])))
            (clobber (reg:CC 17 flags))
        ]) "small.c":21:7 656 {*iorqi_exthi_1_slp}
     (nil))
during RTL pass: reload
small.c:188:1: internal compiler error: in extract_constrain_insn, at
recog.cc:2713
0x84dde4 _fatal_insn(char const*, rtx_def const*, char const*, int, char
const*)
        ../../gcc-trunk/gcc/rtl-error.cc:108
0x84de10 _fatal_insn_not_found(rtx_def const*, char const*, int, char const*)
        ../../gcc-trunk/gcc/rtl-error.cc:118
0x84c04a extract_constrain_insn(rtx_insn*)
        ../../gcc-trunk/gcc/recog.cc:2713
0xf6aca7 check_rtl
        ../../gcc-trunk/gcc/lra.cc:2189
0xf70131 lra(_IO_FILE*, int)
        ../../gcc-trunk/gcc/lra.cc:2610
0xf2044f do_reload
        ../../gcc-trunk/gcc/ira.cc:5973
0xf2044f execute
        ../../gcc-trunk/gcc/ira.cc:6161
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
[526] % 
[526] % cat small.c
typedef int a;
long b, c, ab, d, e, g, h, j, k, l, m, n, at;
a o, p, **q, r, aa, s, t, ac, ad, u, v, w, x, f;
unsigned ae, z, af;
short ag, ah, ai, aj, ak, al, am, an, ao, ap, aq, y, ar, as;
static char au, av;
static volatile short aw;
a *ax, *ay, *az, *ba;
a **bb, **bc;
int bd();
char be();
void bf();
short bg();
long bh();
a *bi() {
  char bj[2];
  char *bk = &bj[0];
  int i = 0;
  for (; i < 2; i++)
    bj[i] = 0;
  *bk = c | bj[1];
  l = e = af = ac = 0;
  short bl[16] = {c, an, c, ao, an, ai, ag, c, ag, c, f, f, ag};
  char bm[] = {f, f, d, f, f, d, f}, bn = 0, bo = m && au;
  aw;
  if (b) {
    int bp = 0, bq = 0, bs = o, bw = aj = an;
    while (aw)
    br:
      v = aa = --am;
    while (au)
      ai = b = r = p = av;
    as = s = c = 0;
    az = bi();
    b = f = be();
    t = bd();
    b = bg();
    d = bg();
    for (; b; ++at) {
      a *d = &bq;
      for (; i; i++)
        for (; c; ad++)
          c = e = b = bd();
      f = bg();
      ar = c = bg();
      f = be();
      *q = ba = bi();
    }
    an = c = av;
    h = bh();
    z = be();
    d = bg();
    e = i = be();
    j = bh();
    k = bh(++k);
    v = be();
    a *bt = &i, *bu = &bp;
    b = bd();
    e = bg();
    d = bg();
    f = be();
    *bc = *bb = bi(&bs);
  bv:
    f = av;
    f = bh();
    y = bg();
    n = bh();
    {
      short f = aw, bz = au;
      aw;
      --ab;
      p = aw - av;
    bx:
      ag = aw - ag;
      if (an || c && av) {
        ag = aw ^ av;
        goto by;
      }
      aw;
      aw;
      am = ai = au > &bz;
      c = av;
      bd();
      if (av)
        bd();
      am = av;
      bd();
    }
    an = aa = ag = e = bd();
    char ca = b;
  by:
    c = bg();
    d = bh();
    e = bh();
    e = bh();
    g = bh();
    x = bg();
    an = al > &ca;
    if (av)
      i = 0;
    for (; i; i++)
      bd();
    b = v = be();
    *ba = b = bg();
    c = p && bw;
    if (bw)
      an = p = bg();
    d = bd();
    e = bg();
    ay = bi();
    b = be();
    c = bd();
    b = be();
    f = bg();
    while (au)
      d = bd();
    e = bd();
    bf();
    long cb = am && au & av;
    {
      short cc = b = aw, cd = aw || au, ce = au ^ aw, cf = c, cg = --ag;
      long ch = e = c < &cf;
      ap = aw < &ch;
      am = c = ai = f;
      if (av) {
        am = 0;
        goto bx;
      }
      c = ai = (ai > &cg) << aw;
      ag = aw;
      aj = aw || ce;
      e = ah = aw;
      aw || cd || aw;
      aw;
      ak = cb;
      e = b = d = f = ae = r = bh();
      if (b)
        goto br;
      if (av)
        d = e = c = f = bh();
      x = bg();
      bd();
      bd();
      bd();
    }
    aw;
    bd();
    bd();
    c = u = r = aa = aw;
    bd();
    f = aw;
    if (aw)
      ag = aw ^ av;
    if (av)
      am++;
    be();
    p = bd();
    bg();
    b = f = bd();
    b = bg();
    ax = bi(aw);
    f = be();
    e = bd();
    c = bg();
    be();
    d = bg();
    w = bd();
    aw &aw;
    ah = aw;
    av = av + aw;
    ao = c = aw;
    bd(aw);
    ag = aw;
    aa = 0;
    bd();
    c = aq = f = b = n = aa = i = aw;
    e = 0 < f + &bn;
  }
  r = v = c = u = bd();
  if (u)
    goto bv;
  int ci = e || au | av;
  if (bo && av)
    if (au)
      bd();
  au = av < au ^ ci;
  bg(bj[1]);
}

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug rtl-optimization/115521] ICE at -O1 with "-fno-tree-ccp -fno-tree-dominator-opts" on x86_64-linux-gnu: in extract_constrain_insn, at recog.cc:2713
  2024-06-17 11:59 [Bug tree-optimization/115521] New: ICE at -O1 with "-fno-tree-ccp -fno-tree-dominator-opts" on x86_64-linux-gnu: in extract_constrain_insn, at recog.cc:2713 zhendong.su at inf dot ethz.ch
@ 2024-06-17 12:50 ` ubizjak at gmail dot com
  2024-06-17 12:54 ` ubizjak at gmail dot com
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: ubizjak at gmail dot com @ 2024-06-17 12:50 UTC (permalink / raw)
  To: gcc-bugs

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

Uroš Bizjak <ubizjak at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ra
     Ever confirmed|0                           |1
          Component|target                      |rtl-optimization
   Last reconfirmed|                            |2024-06-17
                 CC|                            |vmakarov at gcc dot gnu.org
             Status|UNCONFIRMED                 |NEW

--- Comment #1 from Uroš Bizjak <ubizjak at gmail dot com> ---
This is the case of reload failure, trying to satisfy:

(define_insn_and_split "*<code>qi_ext<mode>_1_slp"
  [(set (strict_low_part (match_operand:QI 0 "register_operand" "+Q,&Q"))
        (any_logic:QI
          (subreg:QI
            (match_operator:SWI248 3 "extract_operator"
              [(match_operand 2 "int248_register_operand" "Q,Q")
               (const_int 8)
               (const_int 8)]) 0)
          (match_operand:QI 1 "nonimmediate_operand" "0,!qm")))
   (clobber (reg:CC FLAGS_REG))]

Cc added.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug rtl-optimization/115521] ICE at -O1 with "-fno-tree-ccp -fno-tree-dominator-opts" on x86_64-linux-gnu: in extract_constrain_insn, at recog.cc:2713
  2024-06-17 11:59 [Bug tree-optimization/115521] New: ICE at -O1 with "-fno-tree-ccp -fno-tree-dominator-opts" on x86_64-linux-gnu: in extract_constrain_insn, at recog.cc:2713 zhendong.su at inf dot ethz.ch
  2024-06-17 12:50 ` [Bug rtl-optimization/115521] " ubizjak at gmail dot com
@ 2024-06-17 12:54 ` ubizjak at gmail dot com
  2024-06-17 15:18 ` pinskia at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: ubizjak at gmail dot com @ 2024-06-17 12:54 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Uroš Bizjak <ubizjak at gmail dot com> ---
Similar to PR114942.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug rtl-optimization/115521] ICE at -O1 with "-fno-tree-ccp -fno-tree-dominator-opts" on x86_64-linux-gnu: in extract_constrain_insn, at recog.cc:2713
  2024-06-17 11:59 [Bug tree-optimization/115521] New: ICE at -O1 with "-fno-tree-ccp -fno-tree-dominator-opts" on x86_64-linux-gnu: in extract_constrain_insn, at recog.cc:2713 zhendong.su at inf dot ethz.ch
  2024-06-17 12:50 ` [Bug rtl-optimization/115521] " ubizjak at gmail dot com
  2024-06-17 12:54 ` ubizjak at gmail dot com
@ 2024-06-17 15:18 ` pinskia at gcc dot gnu.org
  2024-06-17 15:22 ` zhendong.su at inf dot ethz.ch
  2024-06-17 15:27 ` pinskia at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-06-17 15:18 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |DUPLICATE
             Status|NEW                         |RESOLVED

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Dup then.

*** This bug has been marked as a duplicate of bug 114942 ***

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug rtl-optimization/115521] ICE at -O1 with "-fno-tree-ccp -fno-tree-dominator-opts" on x86_64-linux-gnu: in extract_constrain_insn, at recog.cc:2713
  2024-06-17 11:59 [Bug tree-optimization/115521] New: ICE at -O1 with "-fno-tree-ccp -fno-tree-dominator-opts" on x86_64-linux-gnu: in extract_constrain_insn, at recog.cc:2713 zhendong.su at inf dot ethz.ch
                   ` (2 preceding siblings ...)
  2024-06-17 15:18 ` pinskia at gcc dot gnu.org
@ 2024-06-17 15:22 ` zhendong.su at inf dot ethz.ch
  2024-06-17 15:27 ` pinskia at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: zhendong.su at inf dot ethz.ch @ 2024-06-17 15:22 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Zhendong Su <zhendong.su at inf dot ethz.ch> ---
(In reply to Andrew Pinski from comment #3)
> Dup then.
> 
> *** This bug has been marked as a duplicate of bug 114942 ***

Similar, but perhaps not a dup as PR114942 doesn't reproduce on the trunk
anymore.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug rtl-optimization/115521] ICE at -O1 with "-fno-tree-ccp -fno-tree-dominator-opts" on x86_64-linux-gnu: in extract_constrain_insn, at recog.cc:2713
  2024-06-17 11:59 [Bug tree-optimization/115521] New: ICE at -O1 with "-fno-tree-ccp -fno-tree-dominator-opts" on x86_64-linux-gnu: in extract_constrain_insn, at recog.cc:2713 zhendong.su at inf dot ethz.ch
                   ` (3 preceding siblings ...)
  2024-06-17 15:22 ` zhendong.su at inf dot ethz.ch
@ 2024-06-17 15:27 ` pinskia at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-06-17 15:27 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|DUPLICATE                   |---
             Status|RESOLVED                    |NEW

--- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Zhendong Su from comment #4)
> (In reply to Andrew Pinski from comment #3)
> > Dup then.
> > 
> > *** This bug has been marked as a duplicate of bug 114942 ***
> 
> Similar, but perhaps not a dup as PR114942 doesn't reproduce on the trunk
> anymore.

Oh there was a change on the trunk which partly solved the issue but it looks
like not all of the issue with the RA.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-06-17 15:27 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-06-17 11:59 [Bug tree-optimization/115521] New: ICE at -O1 with "-fno-tree-ccp -fno-tree-dominator-opts" on x86_64-linux-gnu: in extract_constrain_insn, at recog.cc:2713 zhendong.su at inf dot ethz.ch
2024-06-17 12:50 ` [Bug rtl-optimization/115521] " ubizjak at gmail dot com
2024-06-17 12:54 ` ubizjak at gmail dot com
2024-06-17 15:18 ` pinskia at gcc dot gnu.org
2024-06-17 15:22 ` zhendong.su at inf dot ethz.ch
2024-06-17 15:27 ` pinskia at gcc dot gnu.org

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).