public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/107261] New: ICE: in classify_argument, at config/i386/i386.cc:2523 on C++ __bf16 vect argument
@ 2022-10-14 11:00 zsojka at seznam dot cz
  2022-10-14 11:10 ` [Bug c++/107261] " marxin at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: zsojka at seznam dot cz @ 2022-10-14 11:00 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 107261
           Summary: ICE: in classify_argument, at config/i386/i386.cc:2523
                    on C++ __bf16 vect argument
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: zsojka at seznam dot cz
  Target Milestone: ---
              Host: x86_64-pc-linux-gnu
            Target: x86_64-pc-linux-gnu

$ cat testcase.C
typedef __bf16 __attribute__((__vector_size__ (8))) V;

void
foo (V v)
{
}

$ x86_64-pc-linux-gnu-gcc testcase.C 
testcase.C: In function 'void foo(V)':
testcase.C:4:1: internal compiler error: in classify_argument, at
config/i386/i386.cc:2523
    4 | foo (V v)
      | ^~~
0x929c85 classify_argument
        /repo/gcc-trunk/gcc/config/i386/i386.cc:2523
0x1a71786 classify_argument
        /repo/gcc-trunk/gcc/config/i386/i386.cc:2543
0x1a71858 examine_argument
        /repo/gcc-trunk/gcc/config/i386/i386.cc:2580
0x1a71a56 function_arg_advance_64
        /repo/gcc-trunk/gcc/config/i386/i386.cc:3034
0x1a71a56 ix86_function_arg_advance
        /repo/gcc-trunk/gcc/config/i386/i386.cc:3098
0x133b594 gimplify_parameters(gimple**)
        /repo/gcc-trunk/gcc/function.cc:3920
0x13ce619 gimplify_body(tree_node*, bool)
        /repo/gcc-trunk/gcc/gimplify.cc:17584
0x13ce7ca gimplify_function_tree(tree_node*)
        /repo/gcc-trunk/gcc/gimplify.cc:17787
0x11e44f7 cgraph_node::analyze()
        /repo/gcc-trunk/gcc/cgraphunit.cc:676
0x11e7057 analyze_functions
        /repo/gcc-trunk/gcc/cgraphunit.cc:1240
0x11e7cbd symbol_table::finalize_compilation_unit()
        /repo/gcc-trunk/gcc/cgraphunit.cc:2500
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.

$ x86_64-pc-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=/repo/gcc-trunk/binary-latest-amd64/bin/x86_64-pc-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-r13-3292-20221014093701-gc2565a31c16-checking-yes-rtl-df-extra-nobootstrap-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/13.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--disable-bootstrap --with-cloog --with-ppl --with-isl
--build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu
--target=x86_64-pc-linux-gnu --with-ld=/usr/bin/x86_64-pc-linux-gnu-ld
--with-as=/usr/bin/x86_64-pc-linux-gnu-as --disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r13-3292-20221014093701-gc2565a31c16-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 13.0.0 20221014 (experimental) (GCC)

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

* [Bug c++/107261] ICE: in classify_argument, at config/i386/i386.cc:2523 on C++ __bf16 vect argument
  2022-10-14 11:00 [Bug c++/107261] New: ICE: in classify_argument, at config/i386/i386.cc:2523 on C++ __bf16 vect argument zsojka at seznam dot cz
@ 2022-10-14 11:10 ` marxin at gcc dot gnu.org
  2022-10-19 14:34 ` [Bug target/107261] ICE: in classify_argument, at config/i386/i386.cc:2523 on __bf16 vect argument or return value zsojka at seznam dot cz
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: marxin at gcc dot gnu.org @ 2022-10-14 11:10 UTC (permalink / raw)
  To: gcc-bugs

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

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2022-10-14
                 CC|                            |lingling.kong7 at gmail dot com,
                   |                            |marxin at gcc dot gnu.org
     Ever confirmed|0                           |1

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

* [Bug target/107261] ICE: in classify_argument, at config/i386/i386.cc:2523 on __bf16 vect argument or return value
  2022-10-14 11:00 [Bug c++/107261] New: ICE: in classify_argument, at config/i386/i386.cc:2523 on C++ __bf16 vect argument zsojka at seznam dot cz
  2022-10-14 11:10 ` [Bug c++/107261] " marxin at gcc dot gnu.org
@ 2022-10-19 14:34 ` zsojka at seznam dot cz
  2022-10-19 17:55 ` jakub at gcc dot gnu.org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: zsojka at seznam dot cz @ 2022-10-19 14:34 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Zdenek Sojka <zsojka at seznam dot cz> ---
Another testcase, for C code:
$ cat testcase.c 
__bf16 __attribute__((__vector_size__(8))) foo(void) {}
$ x86_64-pc-linux-gnu-gcc testcase.c 
testcase.c: In function 'foo':
testcase.c:1:1: internal compiler error: in classify_argument, at
config/i386/i386.cc:2523
    1 | __bf16 __attribute__((__vector_size__(8))) foo(void) {}
      | ^~~~~~
0x8437a7 classify_argument
        /repo/gcc-trunk/gcc/config/i386/i386.cc:2523
0x1788e56 classify_argument
        /repo/gcc-trunk/gcc/config/i386/i386.cc:2543
0x1788f28 examine_argument
        /repo/gcc-trunk/gcc/config/i386/i386.cc:2580
0x17898af ix86_return_in_memory
        /repo/gcc-trunk/gcc/config/i386/i386.cc:4265
0x1044e71 aggregate_value_p(tree_node const*, tree_node const*)
        /repo/gcc-trunk/gcc/function.cc:2119
0x1049981 allocate_struct_function(tree_node*, bool)
        /repo/gcc-trunk/gcc/function.cc:4848
0xd596a4 store_parm_decls()
        /repo/gcc-trunk/gcc/c/c-decl.cc:10434
0xdbdced c_parser_declaration_or_fndef
        /repo/gcc-trunk/gcc/c/c-parser.cc:2612
0xdc5eb3 c_parser_external_declaration
        /repo/gcc-trunk/gcc/c/c-parser.cc:1833
0xdc68d3 c_parser_translation_unit
        /repo/gcc-trunk/gcc/c/c-parser.cc:1695
0xdc68d3 c_parse_file()
        /repo/gcc-trunk/gcc/c/c-parser.cc:24213
0xe28a61 c_common_parse_file()
        /repo/gcc-trunk/gcc/c-family/c-opts.cc:1247
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] 9+ messages in thread

* [Bug target/107261] ICE: in classify_argument, at config/i386/i386.cc:2523 on __bf16 vect argument or return value
  2022-10-14 11:00 [Bug c++/107261] New: ICE: in classify_argument, at config/i386/i386.cc:2523 on C++ __bf16 vect argument zsojka at seznam dot cz
  2022-10-14 11:10 ` [Bug c++/107261] " marxin at gcc dot gnu.org
  2022-10-19 14:34 ` [Bug target/107261] ICE: in classify_argument, at config/i386/i386.cc:2523 on __bf16 vect argument or return value zsojka at seznam dot cz
@ 2022-10-19 17:55 ` jakub at gcc dot gnu.org
  2022-10-20  3:28 ` crazylht at gmail dot com
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-10-19 17:55 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

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

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
I think:
--- gcc/config/i386/i386.cc.jj  2022-10-14 09:35:56.158990825 +0200
+++ gcc/config/i386/i386.cc     2022-10-19 19:49:07.883101047 +0200
@@ -2507,6 +2507,7 @@ classify_argument (machine_mode mode, co
     case E_V2SImode:
     case E_V4HImode:
     case E_V4HFmode:
+    case E_V4BFmode:
     case E_V2HFmode:
     case E_V8QImode:
       classes[0] = X86_64_SSE_CLASS;
ought to fix this.

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

* [Bug target/107261] ICE: in classify_argument, at config/i386/i386.cc:2523 on __bf16 vect argument or return value
  2022-10-14 11:00 [Bug c++/107261] New: ICE: in classify_argument, at config/i386/i386.cc:2523 on C++ __bf16 vect argument zsojka at seznam dot cz
                   ` (2 preceding siblings ...)
  2022-10-19 17:55 ` jakub at gcc dot gnu.org
@ 2022-10-20  3:28 ` crazylht at gmail dot com
  2022-10-20  3:30 ` crazylht at gmail dot com
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: crazylht at gmail dot com @ 2022-10-20  3:28 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Hongtao.liu <crazylht at gmail dot com> ---
(In reply to Jakub Jelinek from comment #2)
> I think:
> --- gcc/config/i386/i386.cc.jj	2022-10-14 09:35:56.158990825 +0200
> +++ gcc/config/i386/i386.cc	2022-10-19 19:49:07.883101047 +0200
> @@ -2507,6 +2507,7 @@ classify_argument (machine_mode mode, co
>      case E_V2SImode:
>      case E_V4HImode:
>      case E_V4HFmode:
> +    case E_V4BFmode:
>      case E_V2HFmode:
>      case E_V8QImode:
>        classes[0] = X86_64_SSE_CLASS;
> ought to fix this.

We haven't support V4BFmode yet, why there's V4BFmode coming in.
We'll take a look.

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

* [Bug target/107261] ICE: in classify_argument, at config/i386/i386.cc:2523 on __bf16 vect argument or return value
  2022-10-14 11:00 [Bug c++/107261] New: ICE: in classify_argument, at config/i386/i386.cc:2523 on C++ __bf16 vect argument zsojka at seznam dot cz
                   ` (3 preceding siblings ...)
  2022-10-20  3:28 ` crazylht at gmail dot com
@ 2022-10-20  3:30 ` crazylht at gmail dot com
  2022-10-31  1:50 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: crazylht at gmail dot com @ 2022-10-20  3:30 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Hongtao.liu <crazylht at gmail dot com> ---
(In reply to Hongtao.liu from comment #3)
> (In reply to Jakub Jelinek from comment #2)
> > I think:
> > --- gcc/config/i386/i386.cc.jj	2022-10-14 09:35:56.158990825 +0200
> > +++ gcc/config/i386/i386.cc	2022-10-19 19:49:07.883101047 +0200
> > @@ -2507,6 +2507,7 @@ classify_argument (machine_mode mode, co
> >      case E_V2SImode:
> >      case E_V4HImode:
> >      case E_V4HFmode:
> > +    case E_V4BFmode:
> >      case E_V2HFmode:
> >      case E_V8QImode:
> >        classes[0] = X86_64_SSE_CLASS;
> > ought to fix this.
> 
> We haven't support V4BFmode yet, why there's V4BFmode coming in.
> We'll take a look.

It's ok for 32-bit vector bf, but ICE for 64-bit vector.

typedef __bf16 __attribute__((__vector_size__ (4))) V;

V
foo (V v, V a)
{
    return v + a;
}

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

* [Bug target/107261] ICE: in classify_argument, at config/i386/i386.cc:2523 on __bf16 vect argument or return value
  2022-10-14 11:00 [Bug c++/107261] New: ICE: in classify_argument, at config/i386/i386.cc:2523 on C++ __bf16 vect argument zsojka at seznam dot cz
                   ` (4 preceding siblings ...)
  2022-10-20  3:30 ` crazylht at gmail dot com
@ 2022-10-31  1:50 ` cvs-commit at gcc dot gnu.org
  2022-10-31  1:52 ` crazylht at gmail dot com
  2023-11-30  8:57 ` liuhongt at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-10-31  1:50 UTC (permalink / raw)
  To: gcc-bugs

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

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

https://gcc.gnu.org/g:6913cad2a38bc406b137b06d579b650f6fe9a2e6

commit r13-3565-g6913cad2a38bc406b137b06d579b650f6fe9a2e6
Author: liuhongt <hongtao.liu@intel.com>
Date:   Tue Oct 25 13:31:54 2022 +0800

    Enable V4BFmode and V2BFmode.

    Enable V4BFmode and V2BFmode with the same ABI as V4HFmode and
    V2HFmode. No real operation is supported for them except for movement.
    This should solve PR target/107261.

    Also I notice there's redundancy in VALID_AVX512FP16_REG_MODE, and
    remove V2BFmode remove it.

    gcc/ChangeLog:

            PR target/107261
            * config/i386/i386-modes.def (VECTOR_MODE): Support V2BFmode.
            * config/i386/i386.cc (classify_argument): Handle V4BFmode and
            V2BFmode.
            (ix86_convert_const_vector_to_integer): Ditto.
            * config/i386/i386.h (VALID_AVX512FP16_REG_MODE): Remove
            V2BFmode.
            (VALID_SSE2_REG_MODE): Add V4BFmode and V2BFmode.
            (VALID_MMX_REG_MODE): Add V4BFmode.
            * config/i386/i386.md (mode): Add V4BF and V2BF.
            (MODE_SIZE): Ditto.
            * config/i386/mmx.md (MMXMODE) Add V4BF.
            (V_32): Add V2BF.
            (V_16_32_64): Add V4BF and V2BF.
            (mmxinsnmode): Add V4BF and V2BF.
            (*mov<mode>_internal): Hanlde V4BFmode and V2BFmode.

    gcc/testsuite/ChangeLog:

            * gcc.target/i386/pr107261.c: New test.

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

* [Bug target/107261] ICE: in classify_argument, at config/i386/i386.cc:2523 on __bf16 vect argument or return value
  2022-10-14 11:00 [Bug c++/107261] New: ICE: in classify_argument, at config/i386/i386.cc:2523 on C++ __bf16 vect argument zsojka at seznam dot cz
                   ` (5 preceding siblings ...)
  2022-10-31  1:50 ` cvs-commit at gcc dot gnu.org
@ 2022-10-31  1:52 ` crazylht at gmail dot com
  2023-11-30  8:57 ` liuhongt at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: crazylht at gmail dot com @ 2022-10-31  1:52 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Hongtao.liu <crazylht at gmail dot com> ---
Fixed in GCC13.

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

* [Bug target/107261] ICE: in classify_argument, at config/i386/i386.cc:2523 on __bf16 vect argument or return value
  2022-10-14 11:00 [Bug c++/107261] New: ICE: in classify_argument, at config/i386/i386.cc:2523 on C++ __bf16 vect argument zsojka at seznam dot cz
                   ` (6 preceding siblings ...)
  2022-10-31  1:52 ` crazylht at gmail dot com
@ 2023-11-30  8:57 ` liuhongt at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: liuhongt at gcc dot gnu.org @ 2023-11-30  8:57 UTC (permalink / raw)
  To: gcc-bugs

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

liuhongt at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |liuhongt at gcc dot gnu.org
         Resolution|---                         |FIXED
             Status|NEW                         |RESOLVED

--- Comment #7 from liuhongt at gcc dot gnu.org ---
Fixed in GCC13 and above.

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

end of thread, other threads:[~2023-11-30  8:57 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-14 11:00 [Bug c++/107261] New: ICE: in classify_argument, at config/i386/i386.cc:2523 on C++ __bf16 vect argument zsojka at seznam dot cz
2022-10-14 11:10 ` [Bug c++/107261] " marxin at gcc dot gnu.org
2022-10-19 14:34 ` [Bug target/107261] ICE: in classify_argument, at config/i386/i386.cc:2523 on __bf16 vect argument or return value zsojka at seznam dot cz
2022-10-19 17:55 ` jakub at gcc dot gnu.org
2022-10-20  3:28 ` crazylht at gmail dot com
2022-10-20  3:30 ` crazylht at gmail dot com
2022-10-31  1:50 ` cvs-commit at gcc dot gnu.org
2022-10-31  1:52 ` crazylht at gmail dot com
2023-11-30  8:57 ` liuhongt 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).