public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/104489] New: nvptx, sm_53: internal compiler error: in gen_rtx_SUBREG, at emit-rtl.cc:1022
@ 2022-02-10 15:05 vries at gcc dot gnu.org
  2022-02-10 15:18 ` [Bug target/104489] " vries at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: vries at gcc dot gnu.org @ 2022-02-10 15:05 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 104489
           Summary: nvptx, sm_53: internal compiler error: in
                    gen_rtx_SUBREG, at emit-rtl.cc:1022
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: vries at gcc dot gnu.org
  Target Milestone: ---

With patch:
...
$ git diff
diff --git a/gcc/config/nvptx/nvptx.h b/gcc/config/nvptx/nvptx.h
index edffd088b15a..8d389da679e4 100644
--- a/gcc/config/nvptx/nvptx.h
+++ b/gcc/config/nvptx/nvptx.h
@@ -32,7 +32,7 @@
 /* Default needs to be in sync with default for misa in nvptx.opt.
    We add a default here to work around a hard-coded sm_30 default in
    nvptx-as.  */
-#define ASM_SPEC "%{misa=*:-m %*; :-m sm_35}"
+#define ASM_SPEC "%{misa=*:-m %*; :-m sm_53}"

 #define TARGET_CPU_CPP_BUILTINS() nvptx_cpu_cpp_builtins ()

diff --git a/gcc/config/nvptx/nvptx.opt b/gcc/config/nvptx/nvptx.opt
index 93a678b63367..c89e658c82e0 100644
--- a/gcc/config/nvptx/nvptx.opt
+++ b/gcc/config/nvptx/nvptx.opt
@@ -72,7 +72,7 @@ Enum(ptx_isa) String(sm_80) Value(PTX_ISA_SM80)

 ; Default needs to be in sync with default in ASM_SPEC in nvptx.h.
 misa=
-Target RejectNegative ToLower Joined Enum(ptx_isa) Var(ptx_isa_option)
Init(PTX_ISA_SM35)

+Target RejectNegative ToLower Joined Enum(ptx_isa) Var(ptx_isa_option)
Init(PTX_ISA
_SM53)
 Specify the version of the ptx ISA to use.

 Enum
...
we run into:
...
during RTL pass: expand
/home/vries/nvptx/trunk/source-gcc/libgcc/libgcc2.c: In function ‘__mulhc3’:
/home/vries/nvptx/trunk/source-gcc/libgcc/libgcc2.c:1959:10: internal compiler
error: in gen_rtx_SUBREG, at emit-rtl.cc:1022
 1959 |   ac = a * c;
      |          ^
0xd9c1b7 gen_rtx_SUBREG(machine_mode, rtx_def*, poly_int<1u, unsigned long>)
        /home/vries/nvptx/trunk/source-gcc/gcc/emit-rtl.cc:1022
0xd9c22f gen_lowpart_SUBREG(machine_mode, rtx_def*)
        /home/vries/nvptx/trunk/source-gcc/gcc/emit-rtl.cc:1038
0xe0ef52 expand_expr_real_1(tree_node*, rtx_def*, machine_mode,
expand_modifier, rtx_def**, bool)
        /home/vries/nvptx/trunk/source-gcc/gcc/expr.cc:10677
0xe06316 expand_expr_real(tree_node*, rtx_def*, machine_mode, expand_modifier,
rtx_def**, bool)
        /home/vries/nvptx/trunk/source-gcc/gcc/expr.cc:8736
0xde4ef9 expand_expr
        /home/vries/nvptx/trunk/source-gcc/gcc/expr.h:301
0xe0783c expand_expr_real_2(separate_ops*, rtx_def*, machine_mode,
expand_modifier)
        /home/vries/nvptx/trunk/source-gcc/gcc/expr.cc:9070
0xc69dec expand_gimple_stmt_1
        /home/vries/nvptx/trunk/source-gcc/gcc/cfgexpand.cc:3967
0xc6a047 expand_gimple_stmt
        /home/vries/nvptx/trunk/source-gcc/gcc/cfgexpand.cc:4028
0xc7282a expand_gimple_basic_block
        /home/vries/nvptx/trunk/source-gcc/gcc/cfgexpand.cc:6069
0xc74cba execute
        /home/vries/nvptx/trunk/source-gcc/gcc/cfgexpand.cc:6795
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.
make[4]: *** [Makefile:501: _mulhc3.o] Error 1
...

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

* [Bug target/104489] nvptx, sm_53: internal compiler error: in gen_rtx_SUBREG, at emit-rtl.cc:1022
  2022-02-10 15:05 [Bug target/104489] New: nvptx, sm_53: internal compiler error: in gen_rtx_SUBREG, at emit-rtl.cc:1022 vries at gcc dot gnu.org
@ 2022-02-10 15:18 ` vries at gcc dot gnu.org
  2022-02-11 10:15 ` vries at gcc dot gnu.org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: vries at gcc dot gnu.org @ 2022-02-10 15:18 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Tom de Vries <vries at gcc dot gnu.org> ---
Created attachment 52407
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=52407&action=edit
reproducer

$ xgcc -B/home/vries/nvptx/trunk/build-gcc/./gcc/ -O2 -S mulhc3.c

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

* [Bug target/104489] nvptx, sm_53: internal compiler error: in gen_rtx_SUBREG, at emit-rtl.cc:1022
  2022-02-10 15:05 [Bug target/104489] New: nvptx, sm_53: internal compiler error: in gen_rtx_SUBREG, at emit-rtl.cc:1022 vries at gcc dot gnu.org
  2022-02-10 15:18 ` [Bug target/104489] " vries at gcc dot gnu.org
@ 2022-02-11 10:15 ` vries at gcc dot gnu.org
  2022-02-11 10:18 ` roger at nextmovesoftware dot com
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: vries at gcc dot gnu.org @ 2022-02-11 10:15 UTC (permalink / raw)
  To: gcc-bugs

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

Tom de Vries <vries at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |roger at nextmovesoftware dot com

--- Comment #2 from Tom de Vries <vries at gcc dot gnu.org> ---
Minimal reproducer:
...
typedef float HFtype __attribute__ ((mode (HF)));

HFtype
mulhf (HFtype a, HFtype b)
{
  return a * b;
}
...

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

* [Bug target/104489] nvptx, sm_53: internal compiler error: in gen_rtx_SUBREG, at emit-rtl.cc:1022
  2022-02-10 15:05 [Bug target/104489] New: nvptx, sm_53: internal compiler error: in gen_rtx_SUBREG, at emit-rtl.cc:1022 vries at gcc dot gnu.org
  2022-02-10 15:18 ` [Bug target/104489] " vries at gcc dot gnu.org
  2022-02-11 10:15 ` vries at gcc dot gnu.org
@ 2022-02-11 10:18 ` roger at nextmovesoftware dot com
  2022-02-14  9:06 ` burnus at gcc dot gnu.org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: roger at nextmovesoftware dot com @ 2022-02-11 10:18 UTC (permalink / raw)
  To: gcc-bugs

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

Roger Sayle <roger at nextmovesoftware dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
     Ever confirmed|0                           |1
           Assignee|unassigned at gcc dot gnu.org      |roger at nextmovesoftware dot com
   Last reconfirmed|                            |2022-02-11

--- Comment #3 from Roger Sayle <roger at nextmovesoftware dot com> ---
Patch proposed:
https://gcc.gnu.org/pipermail/gcc-patches/2022-February/590139.html

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

* [Bug target/104489] nvptx, sm_53: internal compiler error: in gen_rtx_SUBREG, at emit-rtl.cc:1022
  2022-02-10 15:05 [Bug target/104489] New: nvptx, sm_53: internal compiler error: in gen_rtx_SUBREG, at emit-rtl.cc:1022 vries at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2022-02-11 10:18 ` roger at nextmovesoftware dot com
@ 2022-02-14  9:06 ` burnus at gcc dot gnu.org
  2022-02-23  7:26 ` cvs-commit at gcc dot gnu.org
  2022-07-04 15:47 ` cvs-commit at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: burnus at gcc dot gnu.org @ 2022-02-14  9:06 UTC (permalink / raw)
  To: gcc-bugs

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

Tobias Burnus <burnus at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |burnus at gcc dot gnu.org

--- Comment #4 from Tobias Burnus <burnus at gcc dot gnu.org> ---
(In reply to Roger Sayle from comment #3)
> Patch proposed:
> https://gcc.gnu.org/pipermail/gcc-patches/2022-February/590139.html

which is the machine-independent part. The associated nvptx patch (also by
Roger) is at
https://gcc.gnu.org/pipermail/gcc-patches/2022-February/590250.html

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

* [Bug target/104489] nvptx, sm_53: internal compiler error: in gen_rtx_SUBREG, at emit-rtl.cc:1022
  2022-02-10 15:05 [Bug target/104489] New: nvptx, sm_53: internal compiler error: in gen_rtx_SUBREG, at emit-rtl.cc:1022 vries at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2022-02-14  9:06 ` burnus at gcc dot gnu.org
@ 2022-02-23  7:26 ` cvs-commit at gcc dot gnu.org
  2022-07-04 15:47 ` cvs-commit at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-02-23  7:26 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Roger Sayle <sayle@gcc.gnu.org>:

https://gcc.gnu.org/g:06770148711226ba243b964451dfa8816d5d23e5

commit r12-7357-g06770148711226ba243b964451dfa8816d5d23e5
Author: Roger Sayle <roger@nextmovesoftware.com>
Date:   Wed Feb 23 07:24:50 2022 +0000

    nvptx: Back-end portion of a fix for PR target/104489.

    This one line fix/tweak is the back-end specific change for a fix for
    PR target/104489, that allows the ISA for GCC's nvptx backend to be bumped
    to sm_53.  The machine-independent middle-end pieces were posted here:
    https://gcc.gnu.org/pipermail/gcc-patches/2022-February/590139.html

    2022-02-23  Roger Sayle  <roger@nextmovesoftware.com>

    gcc/ChangeLog
            PR target/104489
            * config/nvptx/nvptx.md (*movhf_insn): Add subregs_ok attribute.

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

* [Bug target/104489] nvptx, sm_53: internal compiler error: in gen_rtx_SUBREG, at emit-rtl.cc:1022
  2022-02-10 15:05 [Bug target/104489] New: nvptx, sm_53: internal compiler error: in gen_rtx_SUBREG, at emit-rtl.cc:1022 vries at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2022-02-23  7:26 ` cvs-commit at gcc dot gnu.org
@ 2022-07-04 15:47 ` cvs-commit at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-07-04 15:47 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Roger Sayle <sayle@gcc.gnu.org>:

https://gcc.gnu.org/g:ac4c8f53b0f735be17aa020796602de2299da1c5

commit r13-1462-gac4c8f53b0f735be17aa020796602de2299da1c5
Author: Roger Sayle <roger@nextmovesoftware.com>
Date:   Mon Jul 4 16:45:47 2022 +0100

    middle-end: Support ABIs that pass FP values as wider integers.

    Sorry for the long delay getting back to this, but after deeper
    investigation, it turns out that Jeff Law's tingling spider senses
    that the original patch wasn't updating everywhere that was required
    were spot on.  Although my nvptx testing showed no problems with -O2,
    compiling the same tests with -O0 found several additional assertion
    ICEs (exactly where he'd predicted they'd be).

    Here's a revised patch that updates five locations (up from the
    previous two).  Finding any remaining locations (if any) might be
    easier once folks are able to test things on their targets.  This
    also implements Jeff's suggestion to factor the common code into
    helper routines.

    2022-07-04  Roger Sayle  <roger@nextmovesoftware.com>

    gcc/ChangeLog
            PR target/104489
            * calls.cc (precompute_register_parameters): Allow promotion
            of floating point values to be passed in wider integer modes
            by calling new convert_float_to_wider_int.
            (expand_call): Allow floating point results to be returned in
            wider integer modes by calling new convert wider_int_to_float.
            * cfgexpand.cc (expand_value_return): Allow backends to promote
            a scalar floating point return value to a wider integer mode
            by calling new convert_float_to_wider_int.
            * expr.cc (convert_float_to_wider_int): New function.
            (convert_wider_int_to_float): Likewise.
            (expand_expr_real_1) <expand_decl_rtl>: Allow backends to promote
            scalar FP PARM_DECLs to wider integer modes, by calling new
            convert_wider_int_to_float.
            * expr.h (convert_modes): Name arguments for improved
documentation.
            (convert_float_to_wider_int): Prototype new function here.
            (convert_wider_int_to_float): Likewise.
            * function.cc (assign_parm_setup_stack): Allow floating point
            values to be passed on the stack as wider integer modes by
            calling new convert_wider_int_to_float.

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

end of thread, other threads:[~2022-07-04 15:47 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-10 15:05 [Bug target/104489] New: nvptx, sm_53: internal compiler error: in gen_rtx_SUBREG, at emit-rtl.cc:1022 vries at gcc dot gnu.org
2022-02-10 15:18 ` [Bug target/104489] " vries at gcc dot gnu.org
2022-02-11 10:15 ` vries at gcc dot gnu.org
2022-02-11 10:18 ` roger at nextmovesoftware dot com
2022-02-14  9:06 ` burnus at gcc dot gnu.org
2022-02-23  7:26 ` cvs-commit at gcc dot gnu.org
2022-07-04 15:47 ` cvs-commit 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).