* [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