public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug rtl-optimization/112381] New: [14 regression] ICE when building Mesa (internal compiler error: in lra_split_hard_reg_for)
@ 2023-11-04 17:11 sjames at gcc dot gnu.org
  2023-11-04 17:12 ` [Bug rtl-optimization/112381] " sjames at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: sjames at gcc dot gnu.org @ 2023-11-04 17:11 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 112381
           Summary: [14 regression] ICE when building Mesa (internal
                    compiler error: in lra_split_hard_reg_for)
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: rtl-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: sjames at gcc dot gnu.org
  Target Milestone: ---

Created attachment 56506
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=56506&action=edit
nir_opt_idiv_const.c.i.orig.xz

This appears fixed on trunk but not in the last 14 snapshot (20231029). Not
sure if it got really fixed or is now latent, so reporting just in case so can
bisect for the fix later if it's not an obvious dupe.

Originally reported downstream by Kostadin Shishmanov in
https://bugs.gentoo.org/916860. Interestingly, it is the same source file as in
PR112380 (which still occurs on trunk).

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

* [Bug rtl-optimization/112381] [14 regression] ICE when building Mesa (internal compiler error: in lra_split_hard_reg_for)
  2023-11-04 17:11 [Bug rtl-optimization/112381] New: [14 regression] ICE when building Mesa (internal compiler error: in lra_split_hard_reg_for) sjames at gcc dot gnu.org
@ 2023-11-04 17:12 ` sjames at gcc dot gnu.org
  2023-11-04 17:13 ` sjames at gcc dot gnu.org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: sjames at gcc dot gnu.org @ 2023-11-04 17:12 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Sam James <sjames at gcc dot gnu.org> ---
Created attachment 56507
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=56507&action=edit
reduced.i

Attached reduced version. Not bothered cleaning it up b/c of that issue with it
working on trunk.

Needs gcc -O2 -m32 -mstackrealign -march=raptorlake -c nir_opt_idiv_const.c.i
to reproduce.

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

* [Bug rtl-optimization/112381] [14 regression] ICE when building Mesa (internal compiler error: in lra_split_hard_reg_for)
  2023-11-04 17:11 [Bug rtl-optimization/112381] New: [14 regression] ICE when building Mesa (internal compiler error: in lra_split_hard_reg_for) sjames at gcc dot gnu.org
  2023-11-04 17:12 ` [Bug rtl-optimization/112381] " sjames at gcc dot gnu.org
@ 2023-11-04 17:13 ` sjames at gcc dot gnu.org
  2023-11-04 17:18 ` [Bug rtl-optimization/112381] [14 regression] ICE when building Mesa (in reload, internal " sjames at gcc dot gnu.org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: sjames at gcc dot gnu.org @ 2023-11-04 17:13 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Sam James <sjames at gcc dot gnu.org> ---
```
[...]
In file included from ../mesa-23.2.1/src/util/u_debug.h:49,
                 from ../mesa-23.2.1/src/util/format/u_format.h:35,
                 from ../mesa-23.2.1/src/compiler/nir/nir.h:43,
                 from ../mesa-23.2.1/src/compiler/nir/nir_opt_idiv_const.c:24:
../mesa-23.2.1/src/util/u_atomic.h:348:1: note: the alignment of ‘_Atomic long
long int’ fields changed in GCC 11.1
  348 | typedef int64_t __attribute__((aligned(_Alignof(_Atomic(int64_t)))))
p_atomic_int64_t;
      | ^~~~~~~
../mesa-23.2.1/src/compiler/nir/nir_opt_idiv_const.c: In function
‘nir_opt_idiv_const_instr’:
../mesa-23.2.1/src/compiler/nir/nir_opt_idiv_const.c:223:1: error: unable to
find a register to spill
  223 | }
      | ^
../mesa-23.2.1/src/compiler/nir/nir_opt_idiv_const.c:223:1: error: this is the
insn:
(insn 1701 2092 2188 122 (parallel [
            (set (reg:DI 911 [479])
                (and:DI (not:DI (reg/v:DI 671 [orig:119 d ] [119]))
                    (reg:DI 821 [389])))
            (clobber (reg:CC 17 flags))
        ]) "../mesa-23.2.1/src/compiler/nir/nir_opt_idiv_const.c":135:21
discrim 1 623 {*andndi3_doubleword_bmi}
     (expr_list:REG_DEAD (reg:DI 821 [389])
        (expr_list:REG_DEAD (reg/v:DI 671 [orig:119 d ] [119])
            (expr_list:REG_UNUSED (reg:CC 17 flags)
                (nil)))))
during RTL pass: reload
../mesa-23.2.1/src/compiler/nir/nir_opt_idiv_const.c:223:1: internal compiler
error: in lra_split_hard_reg_for, at lra-assigns.cc:1861
0x5638c60933fe internal_error(char const*, ...)
        ???:0
0x5638c60934ee fancy_abort(char const*, int, char const*)
        ???:0
0x5638c52ace1e _fatal_insn(char const*, rtx_def const*, char const*, int, char
const*)
        ???:0
0x5638c51a48f1 lra_split_hard_reg_for()
        ???:0
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://bugs.gentoo.org/> for instructions.
```

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

* [Bug rtl-optimization/112381] [14 regression] ICE when building Mesa (in reload, internal compiler error: in lra_split_hard_reg_for)
  2023-11-04 17:11 [Bug rtl-optimization/112381] New: [14 regression] ICE when building Mesa (internal compiler error: in lra_split_hard_reg_for) sjames at gcc dot gnu.org
  2023-11-04 17:12 ` [Bug rtl-optimization/112381] " sjames at gcc dot gnu.org
  2023-11-04 17:13 ` sjames at gcc dot gnu.org
@ 2023-11-04 17:18 ` sjames at gcc dot gnu.org
  2023-11-04 18:03 ` [Bug target/112381] " pinskia at gcc dot gnu.org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: sjames at gcc dot gnu.org @ 2023-11-04 17:18 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Sam James <sjames at gcc dot gnu.org> ---
(In reply to Sam James from comment #0)
> Interestingly, it is the same source file as
> in PR112380 (which still occurs on trunk).

sorry, I lied here, just similar names and I skimmed

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

* [Bug target/112381] [14 regression] ICE when building Mesa (in reload, internal compiler error: in lra_split_hard_reg_for)
  2023-11-04 17:11 [Bug rtl-optimization/112381] New: [14 regression] ICE when building Mesa (internal compiler error: in lra_split_hard_reg_for) sjames at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2023-11-04 17:18 ` [Bug rtl-optimization/112381] [14 regression] ICE when building Mesa (in reload, internal " sjames at gcc dot gnu.org
@ 2023-11-04 18:03 ` pinskia at gcc dot gnu.org
  2023-11-04 19:08 ` kocelfc at tutanota dot com
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-11-04 18:03 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |14.0
             Target|x86_64-linux-gnu            |x86_64-linux-gnu
                   |                            |i?86-linux-gnu

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

* [Bug target/112381] [14 regression] ICE when building Mesa (in reload, internal compiler error: in lra_split_hard_reg_for)
  2023-11-04 17:11 [Bug rtl-optimization/112381] New: [14 regression] ICE when building Mesa (internal compiler error: in lra_split_hard_reg_for) sjames at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2023-11-04 18:03 ` [Bug target/112381] " pinskia at gcc dot gnu.org
@ 2023-11-04 19:08 ` kocelfc at tutanota dot com
  2023-11-04 19:27 ` pinskia at gcc dot gnu.org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: kocelfc at tutanota dot com @ 2023-11-04 19:08 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Kostadin <kocelfc at tutanota dot com> ---
This is the first commit where it doesn't ICE. I reverted it from master, and
it did start ICEing again.

commit r14-5001-g8111b5c23bd14f
Author: Haochen Gui <guihaoc@gcc.gnu.org>
Date:   Mon Oct 30 10:59:51 2023 +0800

    Expand: Checking available optabs for scalar modes in by pieces operations

    The former patch (f08ca5903c7) examines the scalar modes by target
    hook scalar_mode_supported_p.  It causes some i386 regression cases
    as XImode and OImode are not enabled in i386 target function.  This
    patch examines the scalar mode by checking if the corresponding optabs
    are available for the mode.

    gcc/
            PR target/111449
            * expr.cc (qi_vector_mode_supported_p): Rename to...
            (by_pieces_mode_supported_p): ...this, and extends it to do
            the checking for both scalar and vector mode.
            (widest_fixed_size_mode_for_size): Call
            by_pieces_mode_supported_p to examine the mode.
            (op_by_pieces_d::smallest_fixed_size_mode_for_size): Likewise.

 gcc/expr.cc | 23 +++++++++++++----------
 1 file changed, 13 insertions(+), 10 deletions(-)

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

* [Bug target/112381] [14 regression] ICE when building Mesa (in reload, internal compiler error: in lra_split_hard_reg_for)
  2023-11-04 17:11 [Bug rtl-optimization/112381] New: [14 regression] ICE when building Mesa (internal compiler error: in lra_split_hard_reg_for) sjames at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2023-11-04 19:08 ` kocelfc at tutanota dot com
@ 2023-11-04 19:27 ` pinskia at gcc dot gnu.org
  2023-11-04 19:41 ` kocelfc at tutanota dot com
  2023-11-04 19:41 ` pinskia at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-11-04 19:27 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Kostadin from comment #4)
> This is the first commit where it doesn't ICE. I reverted it from master,
> and it did start ICEing again.

Does the ICE start at f08ca5903c7 ? If so this was the fix for that.


> 
> commit r14-5001-g8111b5c23bd14f
> Author: Haochen Gui <guihaoc@gcc.gnu.org>
> Date:   Mon Oct 30 10:59:51 2023 +0800
> 
>     Expand: Checking available optabs for scalar modes in by pieces
> operations
>     
>     The former patch (f08ca5903c7) examines the scalar modes by target
>     hook scalar_mode_supported_p.  It causes some i386 regression cases
>     as XImode and OImode are not enabled in i386 target function.  This
>     patch examines the scalar mode by checking if the corresponding optabs
>     are available for the mode.
>     
>     gcc/
>             PR target/111449
>             * expr.cc (qi_vector_mode_supported_p): Rename to...
>             (by_pieces_mode_supported_p): ...this, and extends it to do
>             the checking for both scalar and vector mode.
>             (widest_fixed_size_mode_for_size): Call
>             by_pieces_mode_supported_p to examine the mode.
>             (op_by_pieces_d::smallest_fixed_size_mode_for_size): Likewise.
> 
>  gcc/expr.cc | 23 +++++++++++++----------
>  1 file changed, 13 insertions(+), 10 deletions(-)

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

* [Bug target/112381] [14 regression] ICE when building Mesa (in reload, internal compiler error: in lra_split_hard_reg_for)
  2023-11-04 17:11 [Bug rtl-optimization/112381] New: [14 regression] ICE when building Mesa (internal compiler error: in lra_split_hard_reg_for) sjames at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2023-11-04 19:27 ` pinskia at gcc dot gnu.org
@ 2023-11-04 19:41 ` kocelfc at tutanota dot com
  2023-11-04 19:41 ` pinskia at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: kocelfc at tutanota dot com @ 2023-11-04 19:41 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Kostadin <kocelfc at tutanota dot com> ---
(In reply to Andrew Pinski from comment #5)
> (In reply to Kostadin from comment #4)
> > This is the first commit where it doesn't ICE. I reverted it from master,
> > and it did start ICEing again.
> 
> Does the ICE start at f08ca5903c7 ? If so this was the fix for that.


It does indeed start there, just tested that commit (r14-4835-gf08ca5903c7a02),
and it does ICE, and the one before it: r14-4834-gdbde384bd56f07, which doesn't
ICE.

So, I think we are all clear here.

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

* [Bug target/112381] [14 regression] ICE when building Mesa (in reload, internal compiler error: in lra_split_hard_reg_for)
  2023-11-04 17:11 [Bug rtl-optimization/112381] New: [14 regression] ICE when building Mesa (internal compiler error: in lra_split_hard_reg_for) sjames at gcc dot gnu.org
                   ` (6 preceding siblings ...)
  2023-11-04 19:41 ` kocelfc at tutanota dot com
@ 2023-11-04 19:41 ` pinskia at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-11-04 19:41 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #7 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Fixed.

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

end of thread, other threads:[~2023-11-04 19:41 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-04 17:11 [Bug rtl-optimization/112381] New: [14 regression] ICE when building Mesa (internal compiler error: in lra_split_hard_reg_for) sjames at gcc dot gnu.org
2023-11-04 17:12 ` [Bug rtl-optimization/112381] " sjames at gcc dot gnu.org
2023-11-04 17:13 ` sjames at gcc dot gnu.org
2023-11-04 17:18 ` [Bug rtl-optimization/112381] [14 regression] ICE when building Mesa (in reload, internal " sjames at gcc dot gnu.org
2023-11-04 18:03 ` [Bug target/112381] " pinskia at gcc dot gnu.org
2023-11-04 19:08 ` kocelfc at tutanota dot com
2023-11-04 19:27 ` pinskia at gcc dot gnu.org
2023-11-04 19:41 ` kocelfc at tutanota dot com
2023-11-04 19:41 ` 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).