public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/111010] New: [13 regression] error: unable to find a register to spill compiling GCDAProfiling.c
@ 2023-08-14  9:42 ro at gcc dot gnu.org
  2023-08-14  9:43 ` [Bug target/111010] " ro at gcc dot gnu.org
                   ` (20 more replies)
  0 siblings, 21 replies; 22+ messages in thread
From: ro at gcc dot gnu.org @ 2023-08-14  9:42 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 111010
           Summary: [13 regression] error: unable to find a register to
                    spill compiling GCDAProfiling.c
           Product: gcc
           Version: 13.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ro at gcc dot gnu.org
  Target Milestone: ---
              Host: i386-pc-solaris2.11
            Target: i386-pc-solaris2.11
             Build: i386-pc-solaris2.11

Building current LLVM main with GCC 13.1.0 fails on Solaris/amd64, compiling
compiler-rt/lib/profile/GCDAProfiling.c.  I could reduce that file to the
attached
testcase:

$ gcc -O3 -m32 -fPIC -c GCDAProfiling.i -w
GCDAProfiling.i: In function ‘c’:
GCDAProfiling.i:21:1: error: unable to find a register to spill
   21 | }
      | ^
GCDAProfiling.i:21:1: error: this is the insn:
(insn 109 333 249 9 (set (reg:DI 300)
        (ior:DI (ashift:DI (zero_extend:DI (mem:SI (plus:SI (mult:SI (reg:SI
377 [orig:229 _118 ] [229])
                                (const_int 4 [0x4]))
                            (reg/f:SI 338 [orig:83 a.0_1 ] [83])) [3
MEM[(unsigned int *)_11]+0 S4 A32]))
                (const_int 32 [0x20]))
            (zero_extend:DI (mem:SI (plus:SI (mult:SI (reg:SI 299 [233])
                            (const_int 4 [0x4]))
                        (reg/f:SI 338 [orig:83 a.0_1 ] [83])) [3 MEM[(unsigned
int *)_15]+0 S4 A32])))) "GCDAProfiling.i":15:7 680 {*concatsidi3_3}
     (expr_list:REG_DEAD (reg:SI 377 [orig:229 _118 ] [229])
        (expr_list:REG_DEAD (reg/f:SI 338 [orig:83 a.0_1 ] [83])
            (expr_list:REG_DEAD (reg:SI 299 [233])
                (nil)))))

The corresponding cc1 invocation is

cc1 -fpreprocessed GCDAProfiling.i -quiet -m32 -mtune=generic -march=pentium4
-O3 -w -fPIC

The testcase compiles on the gcc-12 branch and trunk, so this is gcc-13 branch
regression only.

However, it does compile with a Linux/x86_64 gcc 13.1.0.

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

* [Bug target/111010] [13 regression] error: unable to find a register to spill compiling GCDAProfiling.c
  2023-08-14  9:42 [Bug target/111010] New: [13 regression] error: unable to find a register to spill compiling GCDAProfiling.c ro at gcc dot gnu.org
@ 2023-08-14  9:43 ` ro at gcc dot gnu.org
  2023-08-14  9:44 ` ro at gcc dot gnu.org
                   ` (19 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: ro at gcc dot gnu.org @ 2023-08-14  9:43 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Rainer Orth <ro at gcc dot gnu.org> ---
Created attachment 55733
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=55733&action=edit
reduced testcase

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

* [Bug target/111010] [13 regression] error: unable to find a register to spill compiling GCDAProfiling.c
  2023-08-14  9:42 [Bug target/111010] New: [13 regression] error: unable to find a register to spill compiling GCDAProfiling.c ro at gcc dot gnu.org
  2023-08-14  9:43 ` [Bug target/111010] " ro at gcc dot gnu.org
@ 2023-08-14  9:44 ` ro at gcc dot gnu.org
  2023-08-14 11:14 ` rguenth at gcc dot gnu.org
                   ` (18 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: ro at gcc dot gnu.org @ 2023-08-14  9:44 UTC (permalink / raw)
  To: gcc-bugs

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

Rainer Orth <ro at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to work|                            |12.3.1, 14.0
      Known to fail|                            |13.2.1
   Target Milestone|---                         |13.3

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

* [Bug target/111010] [13 regression] error: unable to find a register to spill compiling GCDAProfiling.c
  2023-08-14  9:42 [Bug target/111010] New: [13 regression] error: unable to find a register to spill compiling GCDAProfiling.c ro at gcc dot gnu.org
  2023-08-14  9:43 ` [Bug target/111010] " ro at gcc dot gnu.org
  2023-08-14  9:44 ` ro at gcc dot gnu.org
@ 2023-08-14 11:14 ` rguenth at gcc dot gnu.org
  2023-08-14 14:38 ` ro at CeBiTec dot Uni-Bielefeld.DE
                   ` (17 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-08-14 11:14 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2023-08-14
           Priority|P3                          |P2
     Ever confirmed|0                           |1
             Target|i386-pc-solaris2.11         |i386-pc-solaris2.11
                   |                            |i?86-linux-gnu
           Keywords|                            |needs-bisection

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
I can confirm on x86_64-unknown-linux-gnu if you add -fno-omit-frame-pointer:

> ../../gcc13-g/gcc/cc1 -quiet t.c -m32 -O3 -fPIC -march=pentium4 -mtune=generic -fpreprocessed -w -fno-omit-frame-pointer
t.c: In function 'c':
t.c:21:1: error: unable to find a register to spill
   21 | }
      | ^
t.c:21:1: error: this is the insn:
(insn 109 283 243 9 (set (reg:DI 295)
        (ior:DI (ashift:DI (zero_extend:DI (mem:SI (plus:SI (mult:SI (reg:SI
329 [orig:229 _118 ] [229])
                                (const_int 4 [0x4]))
                            (reg/f:SI 328 [orig:83 a.0_1 ] [83])) [3
MEM[(unsigned int *)_11]+0 S4 A32]))
                (const_int 32 [0x20]))
            (zero_extend:DI (mem:SI (plus:SI (mult:SI (reg:SI 294 [233])
                            (const_int 4 [0x4]))
                        (reg/f:SI 328 [orig:83 a.0_1 ] [83])) [3 MEM[(unsigned
int *)_15]+0 S4 A32])))) "t.c":15:7 681 {*concatsidi3_3}
     (expr_list:REG_DEAD (reg/f:SI 328 [orig:83 a.0_1 ] [83])
        (expr_list:REG_DEAD (reg:SI 329 [orig:229 _118 ] [229])
            (expr_list:REG_DEAD (reg:SI 294 [233])
                (nil)))))
during RTL pass: reload
t.c:21:1: internal compiler error: in lra_split_hard_reg_for, at
lra-assigns.cc:1871
0x15066db _fatal_insn(char const*, rtx_def const*, char const*, int, char
const*)
        /space/rguenther/src/gcc-13-branch/gcc/rtl-error.cc:108
0x131bb9a lra_split_hard_reg_for()
        /space/rguenther/src/gcc-13-branch/gcc/lra-assigns.cc:1871
0x1314d74 lra(_IO_FILE*)
        /space/rguenther/src/gcc-13-branch/gcc/lra.cc:2451
0x12bdb69 do_reload
        /space/rguenther/src/gcc-13-branch/gcc/ira.cc:5963
0x12be060 execute
        /space/rguenther/src/gcc-13-branch/gcc/ira.cc:6149
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.

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

* [Bug target/111010] [13 regression] error: unable to find a register to spill compiling GCDAProfiling.c
  2023-08-14  9:42 [Bug target/111010] New: [13 regression] error: unable to find a register to spill compiling GCDAProfiling.c ro at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2023-08-14 11:14 ` rguenth at gcc dot gnu.org
@ 2023-08-14 14:38 ` ro at CeBiTec dot Uni-Bielefeld.DE
  2023-08-14 14:54 ` ro at gcc dot gnu.org
                   ` (16 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: ro at CeBiTec dot Uni-Bielefeld.DE @ 2023-08-14 14:38 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from ro at CeBiTec dot Uni-Bielefeld.DE <ro at CeBiTec dot Uni-Bielefeld.DE> ---
I've just completed a reghunt which identified

commit 4e0b504f26f78ff02e80ad98ebbf8ded3aa6ffa1
Author: Richard Biener <rguenther@suse.de>
Date:   Tue Jan 10 13:48:51 2023 +0100

    tree-optimization/106293 - missed DSE with virtual LC PHI

as the culprit.

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

* [Bug target/111010] [13 regression] error: unable to find a register to spill compiling GCDAProfiling.c
  2023-08-14  9:42 [Bug target/111010] New: [13 regression] error: unable to find a register to spill compiling GCDAProfiling.c ro at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2023-08-14 14:38 ` ro at CeBiTec dot Uni-Bielefeld.DE
@ 2023-08-14 14:54 ` ro at gcc dot gnu.org
  2023-08-18 11:04 ` [Bug target/111010] [13/14 " ro at gcc dot gnu.org
                   ` (15 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: ro at gcc dot gnu.org @ 2023-08-14 14:54 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Rainer Orth <ro at gcc dot gnu.org> ---
Created attachment 55736
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=55736&action=edit
original testcase

I just noticed that the original testcase still fails on trunk.

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

* [Bug target/111010] [13/14 regression] error: unable to find a register to spill compiling GCDAProfiling.c
  2023-08-14  9:42 [Bug target/111010] New: [13 regression] error: unable to find a register to spill compiling GCDAProfiling.c ro at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2023-08-14 14:54 ` ro at gcc dot gnu.org
@ 2023-08-18 11:04 ` ro at gcc dot gnu.org
  2023-08-18 12:03 ` [Bug target/111010] [13/14 regression] error: unable to find a register to spill compiling GCDAProfiling.c since r13-5092-g4e0b504f26f78f rguenth at gcc dot gnu.org
                   ` (14 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: ro at gcc dot gnu.org @ 2023-08-18 11:04 UTC (permalink / raw)
  To: gcc-bugs

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

Rainer Orth <ro at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |rguenth at gcc dot gnu.org
           Keywords|needs-bisection             |

--- Comment #5 from Rainer Orth <ro at gcc dot gnu.org> ---
Bisection completed, culprit patch identified.

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

* [Bug target/111010] [13/14 regression] error: unable to find a register to spill compiling GCDAProfiling.c since r13-5092-g4e0b504f26f78f
  2023-08-14  9:42 [Bug target/111010] New: [13 regression] error: unable to find a register to spill compiling GCDAProfiling.c ro at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2023-08-18 11:04 ` [Bug target/111010] [13/14 " ro at gcc dot gnu.org
@ 2023-08-18 12:03 ` rguenth at gcc dot gnu.org
  2023-08-18 12:12 ` rguenth at gcc dot gnu.org
                   ` (13 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-08-18 12:03 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |uros at gcc dot gnu.org,
                   |                            |vmakarov at gcc dot gnu.org
           Keywords|                            |ice-on-valid-code,
                   |                            |missed-optimization, ra

--- Comment #6 from Richard Biener <rguenth at gcc dot gnu.org> ---
The culprit hardly is responsible - it's the RA failing, this can be fixed for
example by using -fschedule-insns -fsched-pressure.

I think this define-insn-and-split is a bit heavy-weight for i386 and a split
after reload given we allow arbitrary memory operands (in this case the
addressing modes are simple though)

(insn 109 283 243 9 (set (reg:DI 295)
        (ior:DI (ashift:DI (zero_extend:DI (mem:SI (plus:SI (mult:SI (reg:SI
329 [orig:229 _118 ] [229])
                                (const_int 4 [0x4]))
                            (reg/f:SI 328 [orig:83 a.0_1 ] [83])) [3
MEM[(unsigned int *)_11]+0 S4 A32]))
                (const_int 32 [0x20]))
            (zero_extend:DI (mem:SI (plus:SI (mult:SI (reg:SI 294 [233])
                            (const_int 4 [0x4]))
                        (reg/f:SI 328 [orig:83 a.0_1 ] [83])) [3 MEM[(unsigned
int *)_15]+0 S4 A32])))) "t.c":15:7 680 {*concatsidi3_3}
     (expr_list:REG_DEAD (reg/f:SI 328 [orig:83 a.0_1 ] [83])
        (expr_list:REG_DEAD (reg:SI 329 [orig:229 _118 ] [229])
            (expr_list:REG_DEAD (reg:SI 294 [233])
                (nil)))))

this requires 5 GPRs (and it's not even the most complicated form of
addressing).  I'm not sure if LRA is supposed to fix this up, spilling
the two MEMs will still result in 5 registers needed, and with
32bits that's somewhat difficult to have?

So IMHO this is a bug in the machine description.

The LRA dump isn't really enlightening, it seems to succeed for the above
insn:

            0 Non input pseudo reload: reject++
            1 Non pseudo reload: reject++
            Cycle danger: overall += LRA_MAX_REJECT
          alt=0,overall=608,losers=1,rld_nregs=1
            0 Non pseudo reload: reject++
            1 Non pseudo reload: reject++
          alt=1,overall=2,losers=0,rld_nregs=0
         Choosing alt 1 in insn 239:  (0) m  (1) re {*movsi_internal}
      Creating newreg=292 from oldreg=97, assigning class GENERAL_REGS to
address r292
      Creating newreg=293 from oldreg=157, assigning class INDEX_REGS to
address r293
           Change to class INDEX_REGS for r292
      Creating newreg=294 from oldreg=233, assigning class INDEX_REGS to
address r294
            1 Non-pseudo reload: reject+=2
            1 Non input pseudo reload: reject++
            3 Non-pseudo reload: reject+=2
            3 Non input pseudo reload: reject++
          alt=0,overall=18,losers=2,rld_nregs=2
            0 Non-pseudo reload: reject+=2
            0 Non input pseudo reload: reject++
            3 Non-pseudo reload: reject+=2
            3 Non input pseudo reload: reject++
          alt=1,overall=18,losers=2,rld_nregs=3
            0 Non-pseudo reload: reject+=2
            0 Non input pseudo reload: reject++
            1 Non-pseudo reload: reject+=2
            1 Non input pseudo reload: reject++
          alt=2,overall=18,losers=2,rld_nregs=3
            0 Non-pseudo reload: reject+=2
            0 Non input pseudo reload: reject++
            0 Early clobber: reject++
          alt=3,overall=10,losers=1,rld_nregs=2
         Choosing alt 3 in insn 109:  (0) &r  (1) m  (3) m {*concatsidi3_3}
      Creating newreg=295, assigning class GENERAL_REGS to r295
  109:
r295:DI=zero_extend([r229:SI*0x4+r83:SI])<<0x20|zero_extend([r294:SI*0x4+r83:SI])
      REG_DEAD r233:SI
      REG_DEAD r229:SI
    Inserting insn reload before:
  240: r292:SI=r97:SI
  241: r293:SI=r157:SI
  242: r294:SI=r233:SI
    Inserting insn reload after:
  243: [r292:SI+r293:SI+0x8]=r295:DI

but then the ICE is very much later ...


****** Splitting a hard reg after assignment #2: ******

        Hard reg 0 is preferable by r350 with profit 174



EMERGENCY DUMP:

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

* [Bug target/111010] [13/14 regression] error: unable to find a register to spill compiling GCDAProfiling.c since r13-5092-g4e0b504f26f78f
  2023-08-14  9:42 [Bug target/111010] New: [13 regression] error: unable to find a register to spill compiling GCDAProfiling.c ro at gcc dot gnu.org
                   ` (6 preceding siblings ...)
  2023-08-18 12:03 ` [Bug target/111010] [13/14 regression] error: unable to find a register to spill compiling GCDAProfiling.c since r13-5092-g4e0b504f26f78f rguenth at gcc dot gnu.org
@ 2023-08-18 12:12 ` rguenth at gcc dot gnu.org
  2023-08-21 11:46 ` ro at CeBiTec dot Uni-Bielefeld.DE
                   ` (12 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-08-18 12:12 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from Richard Biener <rguenth at gcc dot gnu.org> ---
diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
index f3a3305ac4f..d38b9d764d8 100644
--- a/gcc/config/i386/i386.md
+++ b/gcc/config/i386/i386.md
@@ -11511,7 +11511,7 @@
 })

 (define_insn_and_split "*concat<mode><dwi>3_3"
-  [(set (match_operand:<DWI> 0 "nonimmediate_operand" "=ro,r,r,&r")
+  [(set (match_operand:<DWI> 0 "nonimmediate_operand" "=ro,r,r,!&r")
        (any_or_plus:<DWI>
          (ashift:<DWI>
            (zero_extend:<DWI>

fixes the issue for me, this disparages the &r,m,m alternative since
that makes any reloading difficult(?) and the early-clobber output
makes register pressure even harder to deal with.

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

* [Bug target/111010] [13/14 regression] error: unable to find a register to spill compiling GCDAProfiling.c since r13-5092-g4e0b504f26f78f
  2023-08-14  9:42 [Bug target/111010] New: [13 regression] error: unable to find a register to spill compiling GCDAProfiling.c ro at gcc dot gnu.org
                   ` (7 preceding siblings ...)
  2023-08-18 12:12 ` rguenth at gcc dot gnu.org
@ 2023-08-21 11:46 ` ro at CeBiTec dot Uni-Bielefeld.DE
  2023-08-21 11:53 ` ubizjak at gmail dot com
                   ` (11 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: ro at CeBiTec dot Uni-Bielefeld.DE @ 2023-08-21 11:46 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 from ro at CeBiTec dot Uni-Bielefeld.DE <ro at CeBiTec dot Uni-Bielefeld.DE> ---
> --- Comment #7 from Richard Biener <rguenth at gcc dot gnu.org> ---
>
> diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
> index f3a3305ac4f..d38b9d764d8 100644
> --- a/gcc/config/i386/i386.md
> +++ b/gcc/config/i386/i386.md
> @@ -11511,7 +11511,7 @@
>  })
>
>  (define_insn_and_split "*concat<mode><dwi>3_3"
> -  [(set (match_operand:<DWI> 0 "nonimmediate_operand" "=ro,r,r,&r")
> +  [(set (match_operand:<DWI> 0 "nonimmediate_operand" "=ro,r,r,!&r")
>         (any_or_plus:<DWI>
>           (ashift:<DWI>
>             (zero_extend:<DWI>
>
> fixes the issue for me, this disparages the &r,m,m alternative since
> that makes any reloading difficult(?) and the early-clobber output
> makes register pressure even harder to deal with.

On the gcc-13 branch, it does indeed, both for the reduced testcase and
the original one.  I've also successfully regtested the patch just in
case.

On trunk, the situation is different, however: even without the patch,
the reduced testcase works while the full one fails.  With the patch
(adjusted to apply to "*concat<mode><dwi>3_4", unless I'm mistaken
here), the situation stays the same: ok for the reduced testcase,
failure for the original one.

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

* [Bug target/111010] [13/14 regression] error: unable to find a register to spill compiling GCDAProfiling.c since r13-5092-g4e0b504f26f78f
  2023-08-14  9:42 [Bug target/111010] New: [13 regression] error: unable to find a register to spill compiling GCDAProfiling.c ro at gcc dot gnu.org
                   ` (8 preceding siblings ...)
  2023-08-21 11:46 ` ro at CeBiTec dot Uni-Bielefeld.DE
@ 2023-08-21 11:53 ` ubizjak at gmail dot com
  2023-08-21 12:47 ` ubizjak at gmail dot com
                   ` (10 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: ubizjak at gmail dot com @ 2023-08-21 11:53 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #9 from Uroš Bizjak <ubizjak at gmail dot com> ---
(In reply to ro@CeBiTec.Uni-Bielefeld.DE from comment #8)
> > --- Comment #7 from Richard Biener <rguenth at gcc dot gnu.org> ---
> >
> > diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
> > index f3a3305ac4f..d38b9d764d8 100644
> > --- a/gcc/config/i386/i386.md
> > +++ b/gcc/config/i386/i386.md
> > @@ -11511,7 +11511,7 @@
> >  })
> >
> >  (define_insn_and_split "*concat<mode><dwi>3_3"
> > -  [(set (match_operand:<DWI> 0 "nonimmediate_operand" "=ro,r,r,&r")
> > +  [(set (match_operand:<DWI> 0 "nonimmediate_operand" "=ro,r,r,!&r")
> >         (any_or_plus:<DWI>
> >           (ashift:<DWI>
> >             (zero_extend:<DWI>
> >
> > fixes the issue for me, this disparages the &r,m,m alternative since
> > that makes any reloading difficult(?) and the early-clobber output
> > makes register pressure even harder to deal with.
> 
> On the gcc-13 branch, it does indeed, both for the reduced testcase and
> the original one.  I've also successfully regtested the patch just in
> case.

I think you should add:

(set_attr "isa" "*,*,*,x64")

attribute to hard disable 32bit targets from having two memory operands.

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

* [Bug target/111010] [13/14 regression] error: unable to find a register to spill compiling GCDAProfiling.c since r13-5092-g4e0b504f26f78f
  2023-08-14  9:42 [Bug target/111010] New: [13 regression] error: unable to find a register to spill compiling GCDAProfiling.c ro at gcc dot gnu.org
                   ` (9 preceding siblings ...)
  2023-08-21 11:53 ` ubizjak at gmail dot com
@ 2023-08-21 12:47 ` ubizjak at gmail dot com
  2023-08-21 12:48 ` ubizjak at gmail dot com
                   ` (9 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: ubizjak at gmail dot com @ 2023-08-21 12:47 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #10 from Uroš Bizjak <ubizjak at gmail dot com> ---
Created attachment 55771
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=55771&action=edit
Proposed patch

This (untested) patch should solve the PR on trunk.

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

* [Bug target/111010] [13/14 regression] error: unable to find a register to spill compiling GCDAProfiling.c since r13-5092-g4e0b504f26f78f
  2023-08-14  9:42 [Bug target/111010] New: [13 regression] error: unable to find a register to spill compiling GCDAProfiling.c ro at gcc dot gnu.org
                   ` (10 preceding siblings ...)
  2023-08-21 12:47 ` ubizjak at gmail dot com
@ 2023-08-21 12:48 ` ubizjak at gmail dot com
  2023-08-21 14:59 ` ubizjak at gmail dot com
                   ` (8 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: ubizjak at gmail dot com @ 2023-08-21 12:48 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #55771|0                           |1
        is obsolete|                            |

--- Comment #11 from Uroš Bizjak <ubizjak at gmail dot com> ---
Created attachment 55772
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=55772&action=edit
The correct proposed patch

Eh, sorry for wrong attachment.  This is the correct one.

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

* [Bug target/111010] [13/14 regression] error: unable to find a register to spill compiling GCDAProfiling.c since r13-5092-g4e0b504f26f78f
  2023-08-14  9:42 [Bug target/111010] New: [13 regression] error: unable to find a register to spill compiling GCDAProfiling.c ro at gcc dot gnu.org
                   ` (11 preceding siblings ...)
  2023-08-21 12:48 ` ubizjak at gmail dot com
@ 2023-08-21 14:59 ` ubizjak at gmail dot com
  2023-08-22  7:08 ` ro at CeBiTec dot Uni-Bielefeld.DE
                   ` (7 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: ubizjak at gmail dot com @ 2023-08-21 14:59 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #12 from Uroš Bizjak <ubizjak at gmail dot com> ---
gcc-13 version:

--cut here--
diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
index 5363b37d448..df476763f85 100644
--- a/gcc/config/i386/i386.md
+++ b/gcc/config/i386/i386.md
@@ -11527,7 +11527,8 @@ (define_insn_and_split "*concat<mode><dwi>3_3"
 {
   split_double_concat (<DWI>mode, operands[0], operands[3], operands[1]);
   DONE;
-})
+}
+  [(set_attr "isa" "*,*,*,x64")])

 (define_insn_and_split "*concat<mode><dwi>3_4"
   [(set (match_operand:<DWI> 0 "nonimmediate_operand" "=ro,r,r,&r")
@@ -11545,7 +11546,8 @@ (define_insn_and_split "*concat<mode><dwi>3_4"
 {
   split_double_concat (<DWI>mode, operands[0], operands[1], operands[2]);
   DONE;
-})
+}
+  [(set_attr "isa" "*,*,*,x64")])

 (define_insn_and_split "*concat<half><mode>3_5"
   [(set (match_operand:DWI 0 "nonimmediate_operand" "=r,o,o")
--cut here--

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

* [Bug target/111010] [13/14 regression] error: unable to find a register to spill compiling GCDAProfiling.c since r13-5092-g4e0b504f26f78f
  2023-08-14  9:42 [Bug target/111010] New: [13 regression] error: unable to find a register to spill compiling GCDAProfiling.c ro at gcc dot gnu.org
                   ` (12 preceding siblings ...)
  2023-08-21 14:59 ` ubizjak at gmail dot com
@ 2023-08-22  7:08 ` ro at CeBiTec dot Uni-Bielefeld.DE
  2023-08-22  7:09 ` ro at CeBiTec dot Uni-Bielefeld.DE
                   ` (6 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: ro at CeBiTec dot Uni-Bielefeld.DE @ 2023-08-22  7:08 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #13 from ro at CeBiTec dot Uni-Bielefeld.DE <ro at CeBiTec dot Uni-Bielefeld.DE> ---
> --- Comment #11 from Uroš Bizjak <ubizjak at gmail dot com> ---
> Created attachment 55772
>   --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=55772&action=edit
> The correct proposed patch
>
> Eh, sorry for wrong attachment.  This is the correct one.

Regtested on i386-pc-solaris2.11; compiles both the reduced and the full
testcase with ICE.

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

* [Bug target/111010] [13/14 regression] error: unable to find a register to spill compiling GCDAProfiling.c since r13-5092-g4e0b504f26f78f
  2023-08-14  9:42 [Bug target/111010] New: [13 regression] error: unable to find a register to spill compiling GCDAProfiling.c ro at gcc dot gnu.org
                   ` (13 preceding siblings ...)
  2023-08-22  7:08 ` ro at CeBiTec dot Uni-Bielefeld.DE
@ 2023-08-22  7:09 ` ro at CeBiTec dot Uni-Bielefeld.DE
  2023-08-22  7:59 ` ubizjak at gmail dot com
                   ` (5 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: ro at CeBiTec dot Uni-Bielefeld.DE @ 2023-08-22  7:09 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #14 from ro at CeBiTec dot Uni-Bielefeld.DE <ro at CeBiTec dot Uni-Bielefeld.DE> ---
> --- Comment #12 from Uroš Bizjak <ubizjak at gmail dot com> ---
> gcc-13 version:
[...]
Same here: successfully regtested on i386-pc-solaris2.11; reduced and
full testcase compile without issues.

Thanks a lot.

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

* [Bug target/111010] [13/14 regression] error: unable to find a register to spill compiling GCDAProfiling.c since r13-5092-g4e0b504f26f78f
  2023-08-14  9:42 [Bug target/111010] New: [13 regression] error: unable to find a register to spill compiling GCDAProfiling.c ro at gcc dot gnu.org
                   ` (14 preceding siblings ...)
  2023-08-22  7:09 ` ro at CeBiTec dot Uni-Bielefeld.DE
@ 2023-08-22  7:59 ` ubizjak at gmail dot com
  2023-08-22  8:01 ` ro at CeBiTec dot Uni-Bielefeld.DE
                   ` (4 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: ubizjak at gmail dot com @ 2023-08-22  7:59 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #15 from Uroš Bizjak <ubizjak at gmail dot com> ---
(In reply to ro@CeBiTec.Uni-Bielefeld.DE from comment #13)
> > --- Comment #11 from Uroš Bizjak <ubizjak at gmail dot com> ---
> > Created attachment 55772 [details]
> >   --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=55772&action=edit
> > The correct proposed patch
> >
> > Eh, sorry for wrong attachment.  This is the correct one.
> 
> Regtested on i386-pc-solaris2.11; compiles both the reduced and the full
> testcase with ICE.

*WITH* ICE?

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

* [Bug target/111010] [13/14 regression] error: unable to find a register to spill compiling GCDAProfiling.c since r13-5092-g4e0b504f26f78f
  2023-08-14  9:42 [Bug target/111010] New: [13 regression] error: unable to find a register to spill compiling GCDAProfiling.c ro at gcc dot gnu.org
                   ` (15 preceding siblings ...)
  2023-08-22  7:59 ` ubizjak at gmail dot com
@ 2023-08-22  8:01 ` ro at CeBiTec dot Uni-Bielefeld.DE
  2023-08-22  8:03 ` ubizjak at gmail dot com
                   ` (3 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: ro at CeBiTec dot Uni-Bielefeld.DE @ 2023-08-22  8:01 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #16 from ro at CeBiTec dot Uni-Bielefeld.DE <ro at CeBiTec dot Uni-Bielefeld.DE> ---
> --- Comment #15 from Uroš Bizjak <ubizjak at gmail dot com> ---
> (In reply to ro@CeBiTec.Uni-Bielefeld.DE from comment #13)
>> > --- Comment #11 from Uroš Bizjak <ubizjak at gmail dot com> ---
>> > Created attachment 55772 [details]
>> >   --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=55772&action=edit
>> > The correct proposed patch
>> >
>> > Eh, sorry for wrong attachment.  This is the correct one.
>> 
>> Regtested on i386-pc-solaris2.11; compiles both the reduced and the full
>> testcase with ICE.
>
> *WITH* ICE?

With*out* ICE.  Sorry for being too dumb to type ;-)

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

* [Bug target/111010] [13/14 regression] error: unable to find a register to spill compiling GCDAProfiling.c since r13-5092-g4e0b504f26f78f
  2023-08-14  9:42 [Bug target/111010] New: [13 regression] error: unable to find a register to spill compiling GCDAProfiling.c ro at gcc dot gnu.org
                   ` (16 preceding siblings ...)
  2023-08-22  8:01 ` ro at CeBiTec dot Uni-Bielefeld.DE
@ 2023-08-22  8:03 ` ubizjak at gmail dot com
  2023-08-23 14:42 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  20 siblings, 0 replies; 22+ messages in thread
From: ubizjak at gmail dot com @ 2023-08-22  8:03 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |ubizjak at gmail dot com

--- Comment #17 from Uroš Bizjak <ubizjak at gmail dot com> ---
(In reply to ro@CeBiTec.Uni-Bielefeld.DE from comment #16)
> >> Regtested on i386-pc-solaris2.11; compiles both the reduced and the full
> >> testcase with ICE.
> >
> > *WITH* ICE?
> 
> With*out* ICE.  Sorry for being too dumb to type ;-)

Oh, thanks. I'll take care of the bug later today/tomorrow.

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

* [Bug target/111010] [13/14 regression] error: unable to find a register to spill compiling GCDAProfiling.c since r13-5092-g4e0b504f26f78f
  2023-08-14  9:42 [Bug target/111010] New: [13 regression] error: unable to find a register to spill compiling GCDAProfiling.c ro at gcc dot gnu.org
                   ` (17 preceding siblings ...)
  2023-08-22  8:03 ` ubizjak at gmail dot com
@ 2023-08-23 14:42 ` cvs-commit at gcc dot gnu.org
  2023-08-23 14:45 ` cvs-commit at gcc dot gnu.org
  2023-08-23 14:46 ` ubizjak at gmail dot com
  20 siblings, 0 replies; 22+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-08-23 14:42 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #18 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Uros Bizjak <uros@gcc.gnu.org>:

https://gcc.gnu.org/g:94a25d3dede035ce8318ae25388d658753c90a3b

commit r14-3410-g94a25d3dede035ce8318ae25388d658753c90a3b
Author: Uros Bizjak <ubizjak@gmail.com>
Date:   Wed Aug 23 16:39:21 2023 +0200

    i386: Fix register spill failure with concat RTX [PR111010]

    Disable (=&r,m,m) alternative for 32-bit targets. The combination of two
    memory operands (possibly with complex addressing mode), early clobbered
    output, frame pointer and PIC registers uses too much registers on
    a register constrained 32-bit target.

    Also merge two similar patterns using DWIH mode iterator.

            PR target/111010

    gcc/ChangeLog:

            * config/i386/i386.md (*concat<any_or_plus:mode><dwi>3_3):
            Merge pattern from *concatditi3_3 and *concatsidi3_3 using
            DWIH mode iterator.  Disable (=&r,m,m) alternative for
            32-bit targets.
            (*concat<any_or_plus:mode><dwi>3_3): Disable (=&r,m,m)
            alternative for 32-bit targets.

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

* [Bug target/111010] [13/14 regression] error: unable to find a register to spill compiling GCDAProfiling.c since r13-5092-g4e0b504f26f78f
  2023-08-14  9:42 [Bug target/111010] New: [13 regression] error: unable to find a register to spill compiling GCDAProfiling.c ro at gcc dot gnu.org
                   ` (18 preceding siblings ...)
  2023-08-23 14:42 ` cvs-commit at gcc dot gnu.org
@ 2023-08-23 14:45 ` cvs-commit at gcc dot gnu.org
  2023-08-23 14:46 ` ubizjak at gmail dot com
  20 siblings, 0 replies; 22+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-08-23 14:45 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #19 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-13 branch has been updated by Uros Bizjak <uros@gcc.gnu.org>:

https://gcc.gnu.org/g:8e828c10249d895de5f55db58e1f10448498398f

commit r13-7746-g8e828c10249d895de5f55db58e1f10448498398f
Author: Uros Bizjak <ubizjak@gmail.com>
Date:   Wed Aug 23 16:42:38 2023 +0200

    i386: Fix register spill failure with concat RTX [PR111010]

    Disable (=&r,m,m) alternative for 32-bit targets. The combination of two
    memory operands (possibly with complex addressing mode), early clobbered
    output, frame pointer and PIC registers uses too much registers on
    a register constrained 32-bit target.

            PR target/111010

    gcc/ChangeLog:

            * config/i386/i386.md (*concat<any_or_plus:mode><dwi>3_3):
            Disable (=&r,m,m) alternative for 32-bit targets.
            (*concat<any_or_plus:mode><dwi>3_4): Ditto.

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

* [Bug target/111010] [13/14 regression] error: unable to find a register to spill compiling GCDAProfiling.c since r13-5092-g4e0b504f26f78f
  2023-08-14  9:42 [Bug target/111010] New: [13 regression] error: unable to find a register to spill compiling GCDAProfiling.c ro at gcc dot gnu.org
                   ` (19 preceding siblings ...)
  2023-08-23 14:45 ` cvs-commit at gcc dot gnu.org
@ 2023-08-23 14:46 ` ubizjak at gmail dot com
  20 siblings, 0 replies; 22+ messages in thread
From: ubizjak at gmail dot com @ 2023-08-23 14:46 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED

--- Comment #20 from Uroš Bizjak <ubizjak at gmail dot com> ---
Fixed for gcc-13.3+

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

end of thread, other threads:[~2023-08-23 14:46 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-14  9:42 [Bug target/111010] New: [13 regression] error: unable to find a register to spill compiling GCDAProfiling.c ro at gcc dot gnu.org
2023-08-14  9:43 ` [Bug target/111010] " ro at gcc dot gnu.org
2023-08-14  9:44 ` ro at gcc dot gnu.org
2023-08-14 11:14 ` rguenth at gcc dot gnu.org
2023-08-14 14:38 ` ro at CeBiTec dot Uni-Bielefeld.DE
2023-08-14 14:54 ` ro at gcc dot gnu.org
2023-08-18 11:04 ` [Bug target/111010] [13/14 " ro at gcc dot gnu.org
2023-08-18 12:03 ` [Bug target/111010] [13/14 regression] error: unable to find a register to spill compiling GCDAProfiling.c since r13-5092-g4e0b504f26f78f rguenth at gcc dot gnu.org
2023-08-18 12:12 ` rguenth at gcc dot gnu.org
2023-08-21 11:46 ` ro at CeBiTec dot Uni-Bielefeld.DE
2023-08-21 11:53 ` ubizjak at gmail dot com
2023-08-21 12:47 ` ubizjak at gmail dot com
2023-08-21 12:48 ` ubizjak at gmail dot com
2023-08-21 14:59 ` ubizjak at gmail dot com
2023-08-22  7:08 ` ro at CeBiTec dot Uni-Bielefeld.DE
2023-08-22  7:09 ` ro at CeBiTec dot Uni-Bielefeld.DE
2023-08-22  7:59 ` ubizjak at gmail dot com
2023-08-22  8:01 ` ro at CeBiTec dot Uni-Bielefeld.DE
2023-08-22  8:03 ` ubizjak at gmail dot com
2023-08-23 14:42 ` cvs-commit at gcc dot gnu.org
2023-08-23 14:45 ` cvs-commit at gcc dot gnu.org
2023-08-23 14:46 ` ubizjak at gmail dot com

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