[Bug tree-optimization/113993] New: ICE: in get_no_error_domain, at tree-call-cdce.cc:815 with __builtin_exp2f32x() at -O1 and above

2024-02-19 Thread zsojka at seznam dot cz via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113993

Bug ID: 113993
   Summary: ICE: in get_no_error_domain, at tree-call-cdce.cc:815
with __builtin_exp2f32x() at -O1 and above
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: tree-optimization
  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

Created attachment 57460
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57460=edit
reduced testcase

Compiler output:
$ x86_64-pc-linux-gnu-gcc -O testcase.c
during GIMPLE pass: cdce
testcase.c: In function 'foo':
testcase.c:2:1: internal compiler error: in get_no_error_domain, at
tree-call-cdce.cc:815
2 | foo (int i)
  | ^~~
0x82d40f get_no_error_domain
/repo/gcc-trunk/gcc/tree-call-cdce.cc:815
0x82d40f gen_shrink_wrap_conditions
/repo/gcc-trunk/gcc/tree-call-cdce.cc:852
0x1544693 shrink_wrap_one_built_in_call
/repo/gcc-trunk/gcc/tree-call-cdce.cc:1101
0x1544693 shrink_wrap_conditional_dead_built_in_calls
/repo/gcc-trunk/gcc/tree-call-cdce.cc:1213
0x1544693 execute
/repo/gcc-trunk/gcc/tree-call-cdce.cc:1292
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-r14-9059-20240219001746-ge42287eaed2-checking-yes-rtl-df-extra-nobootstrap-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/14.0.1/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-r14-9059-20240219001746-ge42287eaed2-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.1 20240219 (experimental) (GCC)

[Bug tree-optimization/113962] [14 Regression] ICE: in exact_div, at poly-int.h:2156 with -O -mavx512f

2024-02-19 Thread zsojka at seznam dot cz via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113962

--- Comment #3 from Zdenek Sojka  ---
(In reply to Andrew Pinski from comment #2)
> Most likely a dup of bug 113967

I am sorry for the confusion; the bugzilla stopped responding while creating
this PR for the first time, and since I there wasn't any new message in the
gcc-bugs mailing list, I thought the PR wasn't created, and I created PR113967
instead.

[Bug analyzer/113983] New: [14 Regression] ICE: tree check: expected integer_cst, have vector_cst in maybe_undo_optimize_bit_field_compare, at analyzer/region-model-manager.cc:606 with -fanalyzer

2024-02-18 Thread zsojka at seznam dot cz via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113983

Bug ID: 113983
   Summary: [14 Regression] ICE: tree check: expected integer_cst,
have vector_cst in
maybe_undo_optimize_bit_field_compare, at
analyzer/region-model-manager.cc:606 with -fanalyzer
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: analyzer
  Assignee: dmalcolm 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

Created attachment 57457
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57457=edit
reduced testcase

Compiler output:
$ x86_64-pc-linux-gnu-gcc -fanalyzer testcase.c 
during IPA pass: analyzer
testcase.c: In function 'foo':
testcase.c:8:22: internal compiler error: tree check: expected integer_cst,
have vector_cst in maybe_undo_optimize_bit_field_compare, at
analyzer/region-model-manager.cc:606
8 |   return (0, 0) * (i & v);
  |   ~~~^~~~
0x88ddd5 tree_check_failed(tree_node const*, char const*, int, char const*,
...)
/repo/gcc-trunk/gcc/tree.cc:8955

testcase.c:8:22: internal compiler error: Segmentation fault
0x151aef2 crash_signal
/repo/gcc-trunk/gcc/toplev.cc:317
0x2aec460 x86_64_fallback_frame_state
./md-unwind-support.h:63
0x2aec460 uw_frame_state_for
/repo/gcc-trunk/libgcc/unwind-dw2.c:1013
0x2aed79d _Unwind_Backtrace
/repo/gcc-trunk/libgcc/unwind.inc:303
0x2a97f89 backtrace_full
/repo/gcc-trunk/libbacktrace/backtrace.c:127
0x29ff2a6 diagnostic_context::action_after_output(diagnostic_t)
/repo/gcc-trunk/gcc/diagnostic.cc:781
0x29ff4bb diagnostic_action_after_output(diagnostic_context*, diagnostic_t)
/repo/gcc-trunk/gcc/diagnostic.h:1002
0x29ff4bb diagnostic_context::report_diagnostic(diagnostic_info*)
/repo/gcc-trunk/gcc/diagnostic.cc:1633
0x29ff838 diagnostic_impl
/repo/gcc-trunk/gcc/diagnostic.cc:1767
0x29fff06 internal_error(char const*, ...)
/repo/gcc-trunk/gcc/diagnostic.cc:2225
0x88ddd5 tree_check_failed(tree_node const*, char const*, int, char const*,
...)
/repo/gcc-trunk/gcc/tree.cc:8955
x86_64-pc-linux-gnu-gcc: internal compiler error: Segmentation fault signal
terminated program cc1
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
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-r14-9043-20240217001708-gd70f155b074-checking-yes-rtl-df-extra-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/14.0.1/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
--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-r14-9043-20240217001708-gd70f155b074-checking-yes-rtl-df-extra-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.1 20240217 (experimental) (GCC)

[Bug c++/113969] ICE: SIGSEGV in finish_enum_value_list (decl.cc:17143) (or build_enumerator (decl.cc:17438) ) on invalid code

2024-02-17 Thread zsojka at seznam dot cz via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113969

--- Comment #1 from Zdenek Sojka  ---
Created attachment 57449
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57449=edit
very similar testcase, ICEing in build_enumerator instead

$ x86_64-pc-linux-gnu-gcc testcase2.C -wrapper valgrind,-q
testcase2.C:2:40: error: expected '}' before 'd'
2 | template  enum struct b {
e
  |~   ^
testcase2.C:2:40: error: expected '>' before 'd'
testcase2.C:2:42: error: expected unqualified-id before '}' token
2 | template  enum struct b {
e
  |  ^
testcase2.C:2:42: error: expected declaration before '}' token
==13010== Invalid read of size 2
==13010==at 0xFA2DF0: build_enumerator(tree_node*, tree_node*, tree_node*,
tree_node*, unsigned int) (decl.cc:17438)
==13010==by 0x10930C7: cp_parser_enumerator_definition (parser.cc:21903)
==13010==by 0x10930C7: cp_parser_enumerator_list (parser.cc:21823)
==13010==by 0x10930C7: cp_parser_enum_specifier(cp_parser*)
(parser.cc:21754)
==13010==by 0x10772CE: cp_parser_type_specifier(cp_parser*, int,
cp_decl_specifier_seq*, bool, int*, bool*) (parser.cc:20034)
==13010==by 0x1078E2D: cp_parser_decl_specifier_seq(cp_parser*, int,
cp_decl_specifier_seq*, int*) (parser.cc:16590)
==13010==by 0x10AE38A: cp_parser_single_declaration(cp_parser*,
vec*, bool, bool, bool*)
(parser.cc:33137)
==13010==by 0x10AFA00: cp_parser_explicit_specialization(cp_parser*)
(parser.cc:19945)
==13010==by 0x10B3EC5: cp_parser_declaration(cp_parser*, tree_node*)
(parser.cc:15499)
==13010==by 0x10B461A: cp_parser_toplevel_declaration (parser.cc:15594)
==13010==by 0x10B461A: cp_parser_translation_unit (parser.cc:5279)
==13010==by 0x10B461A: c_parse_file() (parser.cc:51202)
==13010==by 0x1203D81: c_common_parse_file() (c-opts.cc:1311)
==13010==by 0x18172DD: compile_file() (toplev.cc:447)
==13010==by 0xEC6EDB: do_compile (toplev.cc:2152)
==13010==by 0xEC6EDB: toplev::main(int, char**) (toplev.cc:2308)
==13010==by 0xEC86ED: main (main.cc:39)
==13010==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==13010== 
testcase2.C:2:72: internal compiler error: Segmentation fault
2 | template  enum struct b {
e
  |   
^
0x1816fe2 crash_signal
/repo/gcc-trunk/gcc/toplev.cc:317
0xfa2df0 build_enumerator(tree_node*, tree_node*, tree_node*, tree_node*,
unsigned int)
/repo/gcc-trunk/gcc/cp/decl.cc:17438
0x10930c7 cp_parser_enumerator_definition
/repo/gcc-trunk/gcc/cp/parser.cc:21903
0x10930c7 cp_parser_enumerator_list
/repo/gcc-trunk/gcc/cp/parser.cc:21823
0x10930c7 cp_parser_enum_specifier
/repo/gcc-trunk/gcc/cp/parser.cc:21754
0x10772ce cp_parser_type_specifier
/repo/gcc-trunk/gcc/cp/parser.cc:20034
0x1078e2d cp_parser_decl_specifier_seq
/repo/gcc-trunk/gcc/cp/parser.cc:16590
0x10ae38a cp_parser_single_declaration
/repo/gcc-trunk/gcc/cp/parser.cc:33137
0x10afa00 cp_parser_explicit_specialization
/repo/gcc-trunk/gcc/cp/parser.cc:19945
0x10b3ec5 cp_parser_declaration
/repo/gcc-trunk/gcc/cp/parser.cc:15499
0x10b461a cp_parser_toplevel_declaration
/repo/gcc-trunk/gcc/cp/parser.cc:15594
0x10b461a cp_parser_translation_unit
/repo/gcc-trunk/gcc/cp/parser.cc:5279
0x10b461a c_parse_file()
/repo/gcc-trunk/gcc/cp/parser.cc:51202
0x1203d81 c_common_parse_file()
/repo/gcc-trunk/gcc/c-family/c-opts.cc:1311
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See  for instructions.

[Bug c++/113969] New: ICE: SIGSEGV in finish_enum_value_list (decl.cc:17143) on invalid code

2024-02-17 Thread zsojka at seznam dot cz via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113969

Bug ID: 113969
   Summary: ICE: SIGSEGV in finish_enum_value_list (decl.cc:17143)
on invalid code
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: ice-on-invalid-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

Created attachment 57447
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57447=edit
auto-reduced testcase

Compiler output:
$ x86_64-pc-linux-gnu-gcc testcase.C -wrapper valgrind,-q
testcase.C:2:40: error: expected '}' before 'd'
2 | template  enum struct b {
  |~   ^
testcase.C:2:40: error: expected '>' before 'd'
testcase.C:2:42: error: expected unqualified-id before '}' token
2 | template  enum struct b {
  |  ^
testcase.C:2:42: error: expected declaration before '}' token
testcase.C:2:71: error: expected identifier at end of input
2 | template  enum struct b {
  |   ^
testcase.C:2:71: error: expected '}' at end of input
2 | template  enum struct b {
  |  ~^
==8124== Invalid read of size 2
==8124==at 0xF95EFF: finish_enum_value_list(tree_node*) (decl.cc:17143)
==8124==by 0x1092B26: cp_parser_enum_specifier(cp_parser*)
(parser.cc:21792)
==8124==by 0x10772CE: cp_parser_type_specifier(cp_parser*, int,
cp_decl_specifier_seq*, bool, int*, bool*) (parser.cc:20034)
==8124==by 0x1078E2D: cp_parser_decl_specifier_seq(cp_parser*, int,
cp_decl_specifier_seq*, int*) (parser.cc:16590)
==8124==by 0x10AE38A: cp_parser_single_declaration(cp_parser*,
vec*, bool, bool, bool*)
(parser.cc:33137)
==8124==by 0x10AFA00: cp_parser_explicit_specialization(cp_parser*)
(parser.cc:19945)
==8124==by 0x10B3EC5: cp_parser_declaration(cp_parser*, tree_node*)
(parser.cc:15499)
==8124==by 0x10B461A: cp_parser_toplevel_declaration (parser.cc:15594)
==8124==by 0x10B461A: cp_parser_translation_unit (parser.cc:5279)
==8124==by 0x10B461A: c_parse_file() (parser.cc:51202)
==8124==by 0x1203D81: c_common_parse_file() (c-opts.cc:1311)
==8124==by 0x18172DD: compile_file() (toplev.cc:447)
==8124==by 0xEC6EDB: do_compile (toplev.cc:2152)
==8124==by 0xEC6EDB: toplev::main(int, char**) (toplev.cc:2308)
==8124==by 0xEC86ED: main (main.cc:39)
==8124==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==8124== 
testcase.C:2:71: internal compiler error: Segmentation fault
^C

$ 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-r14-9043-20240217001708-gd70f155b074-checking-yes-rtl-df-extra-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/14.0.1/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
--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-r14-9043-20240217001708-gd70f155b074-checking-yes-rtl-df-extra-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.1 20240217 (experimental) (GCC)

[Bug c++/113968] New: ICE: in create_tmp_var, at gimple-expr.cc:488 with -fcontracts and invalid member in contract

2024-02-17 Thread zsojka at seznam dot cz via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113968

Bug ID: 113968
   Summary: ICE: in create_tmp_var, at gimple-expr.cc:488 with
-fcontracts and invalid member in contract
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: error-recovery, ice-on-invalid-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

Created attachment 57446
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57446=edit
reduced testcase

Compiler output:
$ x86_64-pc-linux-gnu-gcc -fcontracts testcase.C 
testcase.C:4:20: error: 'struct A' has no member named 'm'
4 | void f(A a)[[pre:a.m]] {}
  |^
testcase.C: In function 'void f(A)':
testcase.C:4:22: internal compiler error: in create_tmp_var, at
gimple-expr.cc:488
4 | void f(A a)[[pre:a.m]] {}
  |  ^
0x85aa24 create_tmp_var(tree_node*, char const*)
/repo/gcc-trunk/gcc/gimple-expr.cc:488
0x85aa24 create_tmp_var(tree_node*, char const*)
/repo/gcc-trunk/gcc/gimple-expr.cc:478
0x14b275a create_tmp_from_val
/repo/gcc-trunk/gcc/gimplify.cc:568
0x14b275a lookup_tmp_var
/repo/gcc-trunk/gcc/gimplify.cc:590
0x14b275a internal_get_tmp_var
/repo/gcc-trunk/gcc/gimplify.cc:645
0x14ad29f get_formal_tmp_var(tree_node*, gimple**)
/repo/gcc-trunk/gcc/gimplify.cc:673
0x14ad29f gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
/repo/gcc-trunk/gcc/gimplify.cc:18804
0x14c0011 gimplify_expr
/repo/gcc-trunk/gcc/gimplify.cc:18849
0x14c0011 gimplify_arg(tree_node**, gimple**, unsigned int, bool)
/repo/gcc-trunk/gcc/gimplify.cc:3751
0x14c06b3 gimplify_call_expr
/repo/gcc-trunk/gcc/gimplify.cc:4036
0x14adc56 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
/repo/gcc-trunk/gcc/gimplify.cc:17749
0x14c5b43 gimplify_cleanup_point_expr
/repo/gcc-trunk/gcc/gimplify.cc:7480
0x14adc37 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
/repo/gcc-trunk/gcc/gimplify.cc:18173
0x14c5195 gimplify_stmt(tree_node**, gimple**)
/repo/gcc-trunk/gcc/gimplify.cc:7480
0x14c5195 gimplify_body(tree_node*, bool)
/repo/gcc-trunk/gcc/gimplify.cc:19047
0x14c55dc gimplify_function_tree(tree_node*)
/repo/gcc-trunk/gcc/gimplify.cc:19246
0x12d2657 cgraph_node::analyze()
/repo/gcc-trunk/gcc/cgraphunit.cc:685
0x12d5277 analyze_functions
/repo/gcc-trunk/gcc/cgraphunit.cc:1249
0x12d61fd symbol_table::finalize_compilation_unit()
/repo/gcc-trunk/gcc/cgraphunit.cc:2556
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-r14-9043-20240217001708-gd70f155b074-checking-yes-rtl-df-extra-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/14.0.1/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
--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-r14-9043-20240217001708-gd70f155b074-checking-yes-rtl-df-extra-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.1 20240217 (experimental) (GCC)

[Bug tree-optimization/113967] New: [14 Regression] ICE: in exact_div, at poly-int.h:2156 with -O -mavx512f

2024-02-17 Thread zsojka at seznam dot cz via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113967

Bug ID: 113967
   Summary: [14 Regression] ICE: in exact_div, at poly-int.h:2156
with -O -mavx512f
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: tree-optimization
  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

Created attachment 57445
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57445=edit
reduced testcase

Compiler output:
$ x86_64-pc-linux-gnu-gcc -O -mavx512f testcase.c
during GIMPLE pass: forwprop
testcase.c: In function 'bar3':
testcase.c:25:1: internal compiler error: in exact_div, at poly-int.h:2156
   25 | }
  | ^
0x8f2762 poly_int<1u, poly_result::is_poly>::type,
poly_coeff_pair_traits::is_poly>::type>::result_kind>::type>
exact_div<1u, unsigned long, unsigned long>(poly_int<1u, unsigned long> const&,
unsigned long)
/repo/gcc-trunk/gcc/poly-int.h:2156
0x8f2762 poly_int<1u, poly_result::is_poly>::type,
poly_coeff_pair_traits::is_poly>::type>::result_kind>::type>
exact_div<1u, unsigned long, unsigned long>(poly_int<1u, unsigned long> const&,
unsigned long)
/repo/gcc-trunk/gcc/poly-int.h:2150
0x8f2762 gimple_simplify_BIT_INSERT_EXPR(gimple_match_op*, gimple**, tree_node*
(*)(tree_node*), code_helper, tree_node*, tree_node*, tree_node*, tree_node*)
/repo/build-gcc-trunk-amd64/gcc/gimple-match-5.cc:16981
0x1cd5853 gimple_resimplify3
/repo/gcc-trunk/gcc/gimple-match-exports.cc:1107
0x1cd6a12 gimple_simplify(gimple*, gimple_match_op*, gimple**, tree_node*
(*)(tree_node*), tree_node* (*)(tree_node*))
/repo/gcc-trunk/gcc/gimple-match-exports.cc:898
0x116c817 fold_stmt_1
/repo/gcc-trunk/gcc/gimple-fold.cc:6359
0x166c5d5 execute
/repo/gcc-trunk/gcc/tree-ssa-forwprop.cc:3950
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-r14-9043-20240217001708-gd70f155b074-checking-yes-rtl-df-extra-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/14.0.1/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
--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-r14-9043-20240217001708-gd70f155b074-checking-yes-rtl-df-extra-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.1 20240217 (experimental) (GCC)

[Bug target/113876] New: ICE: in ix86_expand_epilogue, at config/i386/i386.cc:10101 with -O -mpreferred-stack-boundary=3 -finstrument-functions -mapxf -mcmodel=large and _BitInt()

2024-02-11 Thread zsojka at seznam dot cz via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113876

Bug ID: 113876
   Summary: ICE: in ix86_expand_epilogue, at
config/i386/i386.cc:10101 with -O
-mpreferred-stack-boundary=3 -finstrument-functions
-mapxf -mcmodel=large and _BitInt()
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: target
  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

Created attachment 57386
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57386=edit
reduced testcase

Compiler output:
$ x86_64-pc-linux-gnu-gcc -O -mpreferred-stack-boundary=3
-finstrument-functions -mapxf -mcmodel=large testcase.c 
during RTL pass: pro_and_epilogue
testcase.c: In function 'bar':
testcase.c:1:21: internal compiler error: in ix86_expand_epilogue, at
config/i386/i386.cc:10101
1 | _BitInt(129) bar() {}
  | ^
0x8b8e63 ix86_expand_epilogue(int)
/repo/gcc-trunk/gcc/config/i386/i386.cc:10101
0x1fca31f gen_epilogue()
/repo/gcc-trunk/gcc/config/i386/i386.md:19238
0x18eb205 target_gen_epilogue
/repo/gcc-trunk/gcc/config/i386/i386.md:18734
0x113ac26 make_epilogue_seq
/repo/gcc-trunk/gcc/function.cc:5970
0x113acfb thread_prologue_and_epilogue_insns()
/repo/gcc-trunk/gcc/function.cc:6052
0x113b6a2 rest_of_handle_thread_prologue_and_epilogue
/repo/gcc-trunk/gcc/function.cc:6565
0x113b6a2 execute
/repo/gcc-trunk/gcc/function.cc:6651
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-r14-8910-20240210112800-g39920447f87-checking-yes-rtl-df-extra-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/14.0.1/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
--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-r14-8910-20240210112800-g39920447f87-checking-yes-rtl-df-extra-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.1 20240210 (experimental) (GCC)

[Bug tree-optimization/113849] New: wrong code with _BitInt() arithmetics at -O1

2024-02-09 Thread zsojka at seznam dot cz via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113849

Bug ID: 113849
   Summary: wrong code with _BitInt() arithmetics at -O1
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: wrong-code
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
CC: jakub at gcc dot gnu.org
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu

Created attachment 57370
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57370=edit
reduced testcase

This testcase was originally attached to PR113774, but this is still failed
after the fix.

Output:
$ x86_64-pc-linux-gnu-gcc -O1 testcase.c
$ ./a.out
Aborted

$ 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-r14-8897-20240209102321-g0a329ecf113-checking-yes-rtl-df-extra-nobootstrap-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/14.0.1/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-r14-8897-20240209102321-g0a329ecf113-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.1 20240209 (experimental) (GCC)

[Bug target/113829] New: ICE: tree check: expected class 'type', have 'exceptional' (error_mark) in overloaded_hash, at config/riscv/riscv-vector-builtins.cc:4341 with invalid __riscv_vfredosum_tu()

2024-02-08 Thread zsojka at seznam dot cz via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113829

Bug ID: 113829
   Summary: ICE: tree check: expected class 'type', have
'exceptional' (error_mark) in overloaded_hash, at
config/riscv/riscv-vector-builtins.cc:4341 with
invalid __riscv_vfredosum_tu()
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: error-recovery, ice-on-invalid-code
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: riscv64-unknown-linux-gnu

Created attachment 57357
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57357=edit
reduced testcase

Similar to PR113766

Compiler output:
$ riscv64-unknown-linux-gnu-gcc -march=rv64iv testcase.c 
testcase.c: In function 'foo':
testcase.c:5:24: error: 'X' undeclared (first use in this function)
5 |   __riscv_vfredosum_tu(X);
  |^
testcase.c:5:24: note: each undeclared identifier is reported only once for
each function it appears in
testcase.c:5:3: internal compiler error: tree check: expected class 'type',
have 'exceptional' (error_mark) in overloaded_hash, at
config/riscv/riscv-vector-builtins.cc:4341
5 |   __riscv_vfredosum_tu(X);
  |   ^~~~
0xb63c47 tree_class_check_failed(tree_node const*, tree_code_class, char
const*, int, char const*)
/repo/gcc-trunk/gcc/tree.cc:9002
0xb9c7fc tree_class_check(tree_node*, tree_code_class, char const*, int, char
const*)
/repo/gcc-trunk/gcc/tree.h:3767
0xb9c7fc riscv_vector::registered_function::overloaded_hash() const
/repo/gcc-trunk/gcc/config/riscv/riscv-vector-builtins.cc:4341
0x1bcdf2f riscv_vector::resolve_overloaded_builtin(unsigned int, unsigned int,
tree_node*, vec*)
/repo/gcc-trunk/gcc/config/riscv/riscv-vector-builtins.cc:4635
0x1ba0bea riscv_resolve_overloaded_builtin
/repo/gcc-trunk/gcc/config/riscv/riscv-c.cc:253
0x103118f c_build_function_call_vec(unsigned int, vec const&, tree_node*, vec*, vec*)
/repo/gcc-trunk/gcc/c/c-typeck.cc:3438
0x1068d90 c_parser_postfix_expression_after_primary
/repo/gcc-trunk/gcc/c/c-parser.cc:12622
0x104eda7 c_parser_postfix_expression
/repo/gcc-trunk/gcc/c/c-parser.cc:12174
0x105368a c_parser_unary_expression
/repo/gcc-trunk/gcc/c/c-parser.cc:9855
0x10551df c_parser_cast_expression
/repo/gcc-trunk/gcc/c/c-parser.cc:9696
0x10554cf c_parser_binary_expression
/repo/gcc-trunk/gcc/c/c-parser.cc:9464
0x1056963 c_parser_conditional_expression
/repo/gcc-trunk/gcc/c/c-parser.cc:9159
0x1057174 c_parser_expr_no_commas
/repo/gcc-trunk/gcc/c/c-parser.cc:9072
0x10575d1 c_parser_expression
/repo/gcc-trunk/gcc/c/c-parser.cc:12762
0x1057ab7 c_parser_expression_conv
/repo/gcc-trunk/gcc/c/c-parser.cc:12802
0x1079a4f c_parser_statement_after_labels
/repo/gcc-trunk/gcc/c/c-parser.cc:7761
0x104eaa6 c_parser_compound_statement_nostart
/repo/gcc-trunk/gcc/c/c-parser.cc:7248
0x10761a4 c_parser_compound_statement
/repo/gcc-trunk/gcc/c/c-parser.cc:6533
0x10784b8 c_parser_declaration_or_fndef
/repo/gcc-trunk/gcc/c/c-parser.cc:3017
0x108210b c_parser_external_declaration
/repo/gcc-trunk/gcc/c/c-parser.cc:2046
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.

$ riscv64-unknown-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=/repo/gcc-trunk/binary-latest-riscv64/bin/riscv64-unknown-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-r14-8874-20240208013446-gbfd72bb44ec-checking-yes-rtl-df-extra-riscv64/bin/../libexec/gcc/riscv64-unknown-linux-gnu/14.0.1/lto-wrapper
Target: riscv64-unknown-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--with-cloog --with-ppl --with-isl --with-isa-spec=2.2
--with-sysroot=/usr/riscv64-unknown-linux-gnu --build=x86_64-pc-linux-gnu
--host=x86_64-pc-linux-gnu --target=riscv64-unknown-linux-gnu
--with-ld=/usr/bin/riscv64-unknown-linux-gnu-ld
--with-as=/usr/bin/riscv64-unknown-linux-gnu-as --disable-multilib
--disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r14-8874-20240208013446-gbfd72bb44ec-checking-yes-rtl-df-extra-riscv64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.1 20240208 (experimental) (GCC)

[Bug target/113828] New: ICE: in riscv_expand_mult_with_const_int, at config/riscv/riscv.cc:2587 with -march=rv64ifv and vfloat32m1_t/vfloat32m4_t function args

2024-02-08 Thread zsojka at seznam dot cz via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113828

Bug ID: 113828
   Summary: ICE: in riscv_expand_mult_with_const_int, at
config/riscv/riscv.cc:2587 with -march=rv64ifv and
vfloat32m1_t/vfloat32m4_t function args
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: riscv64-unknown-linux-gnu

Created attachment 57356
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57356=edit
reduced testcase

Compiler output:
$ riscv64-unknown-linux-gnu-gcc -march=rv64ifv testcase.c
during RTL pass: expand
testcase.c: In function 'foo':
testcase.c:5:1: internal compiler error: in riscv_expand_mult_with_const_int,
at config/riscv/riscv.cc:2587
5 | foo(vfloat32m1_t a, vfloat32m4_t b)
  | ^~~
0xb89743 riscv_expand_mult_with_const_int
/repo/gcc-trunk/gcc/config/riscv/riscv.cc:2587
0xb89743 riscv_legitimize_poly_move(machine_mode, rtx_def*, rtx_def*, rtx_def*)
/repo/gcc-trunk/gcc/config/riscv/riscv.cc:2655
0x1ae545e riscv_legitimize_move(machine_mode, rtx_def*, rtx_def*)
/repo/gcc-trunk/gcc/config/riscv/riscv.cc:2759
0x21f74e0 gen_movdi(rtx_def*, rtx_def*)
/repo/gcc-trunk/gcc/config/riscv/riscv.md:2174
0x12cd260 rtx_insn* insn_gen_fn::operator()(rtx_def*,
rtx_def*) const
/repo/gcc-trunk/gcc/recog.h:441
0x12cd260 emit_move_ccmode
/repo/gcc-trunk/gcc/expr.cc:4425
0x12cd260 emit_move_insn_1(rtx_def*, rtx_def*)
/repo/gcc-trunk/gcc/expr.cc:4570
0x12cd66d emit_move_insn(rtx_def*, rtx_def*)
/repo/gcc-trunk/gcc/expr.cc:4721
0x12a19d0 copy_to_mode_reg(machine_mode, rtx_def*)
/repo/gcc-trunk/gcc/explow.cc:659
0x159c3d2 maybe_legitimize_operand
/repo/gcc-trunk/gcc/optabs.cc:8058
0x159c3d2 maybe_legitimize_operands(insn_code, unsigned int, unsigned int,
expand_operand*)
/repo/gcc-trunk/gcc/optabs.cc:8201
0x1598609 maybe_gen_insn(insn_code, unsigned int, expand_operand*)
/repo/gcc-trunk/gcc/optabs.cc:8220
0x15a15e7 expand_binop_directly
/repo/gcc-trunk/gcc/optabs.cc:1457
0x159f2f1 expand_binop(machine_mode, optab_tag, rtx_def*, rtx_def*, rtx_def*,
int, optab_methods)
/repo/gcc-trunk/gcc/optabs.cc:1544
0x12d32e6 force_operand(rtx_def*, rtx_def*)
/repo/gcc-trunk/gcc/expr.cc:8661
0x12a1909 memory_address_addr_space(machine_mode, rtx_def*, unsigned char)
/repo/gcc-trunk/gcc/explow.cc:509
0x128330a change_address_1
/repo/gcc-trunk/gcc/emit-rtl.cc:2301
0x133ef98 assign_parm_setup_stack
/repo/gcc-trunk/gcc/function.cc:3534
0x1343d94 assign_parms
/repo/gcc-trunk/gcc/function.cc:3729
0x13460ff expand_function_start(tree_node*)
/repo/gcc-trunk/gcc/function.cc:5152
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.

$ riscv64-unknown-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=/repo/gcc-trunk/binary-latest-riscv64/bin/riscv64-unknown-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-r14-8874-20240208013446-gbfd72bb44ec-checking-yes-rtl-df-extra-riscv64/bin/../libexec/gcc/riscv64-unknown-linux-gnu/14.0.1/lto-wrapper
Target: riscv64-unknown-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--with-cloog --with-ppl --with-isl --with-isa-spec=2.2
--with-sysroot=/usr/riscv64-unknown-linux-gnu --build=x86_64-pc-linux-gnu
--host=x86_64-pc-linux-gnu --target=riscv64-unknown-linux-gnu
--with-ld=/usr/bin/riscv64-unknown-linux-gnu-ld
--with-as=/usr/bin/riscv64-unknown-linux-gnu-as --disable-multilib
--disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r14-8874-20240208013446-gbfd72bb44ec-checking-yes-rtl-df-extra-riscv64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.1 20240208 (experimental) (GCC)

[Bug target/113819] New: ICE: RTL check: expected elt 3 type 'e' or 'u', have '0' (rtx code_label) in PATTERN, at rtl.h:1511 with -mstringop-strategy=loop and asm goto with impossible constraint and _

2024-02-07 Thread zsojka at seznam dot cz via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113819

Bug ID: 113819
   Summary: ICE: RTL check: expected elt 3 type 'e' or 'u', have
'0' (rtx code_label) in PATTERN, at rtl.h:1511 with
-mstringop-strategy=loop and asm goto with impossible
constraint and _BitInt()
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: target
  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

Created attachment 57353
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57353=edit
reduced testcase (from gcc.dg/torture/pr100398.c)

This might need RTL checking enabled.

Compiler output:
$ x86_64-pc-linux-gnu-gcc -mstringop-strategy=loop testcase.c
during RTL pass: expand
testcase.c: In function 'test5_limit':
testcase.c:4:3: internal compiler error: RTL check: expected elt 3 type 'e' or
'u', have '0' (rtx code_label) in PATTERN, at rtl.h:1511
4 |   __asm__ goto("" : "=r"(addr) : : : t_err);
  |   ^~~
0x8072bd rtl_check_failed_type2(rtx_def const*, int, int, int, char const*,
int, char const*)
/repo/gcc-trunk/gcc/rtl.cc:761
0x72a1a4 PATTERN(rtx_def*)
/repo/gcc-trunk/gcc/rtl.h:1511
0x72cd2d PATTERN(rtx_def*)
/repo/gcc-trunk/gcc/rtl.h:1479
0x72cd2d expand_asm_stmt
/repo/gcc-trunk/gcc/cfgexpand.cc:3681
0xf845a9 expand_gimple_stmt_1
/repo/gcc-trunk/gcc/cfgexpand.cc:3923
0xf845a9 expand_gimple_stmt
/repo/gcc-trunk/gcc/cfgexpand.cc:4071
0xf8b3be expand_gimple_basic_block
/repo/gcc-trunk/gcc/cfgexpand.cc:6127
0xf8d097 execute
/repo/gcc-trunk/gcc/cfgexpand.cc:6866
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-r14-8869-20240207154951-g8636c538b68-checking-yes-rtl-df-extra-nobootstrap-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/14.0.1/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-r14-8869-20240207154951-g8636c538b68-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.1 20240207 (experimental) (GCC)

[Bug tree-optimization/113818] New: ICE: verify_gimple failed: missing 'PHI' def with -Os -fnon-call-exceptions -finstrument-functions-once and _BitInt()

2024-02-07 Thread zsojka at seznam dot cz via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113818

Bug ID: 113818
   Summary: ICE: verify_gimple failed: missing 'PHI' def with -Os
-fnon-call-exceptions -finstrument-functions-once and
_BitInt()
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: tree-optimization
  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

Created attachment 57352
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57352=edit
reduced testcase

Compiler output:
$ x86_64-pc-linux-gnu-gcc -Os -fnon-call-exceptions -finstrument-functions-once
testcase.c 
testcase.c: In function 'foo':
testcase.c:9:1: error: missing 'PHI' def
9 | foo (void)
  | ^~~
testcase.c:9:1: error: missing 'PHI' def
testcase.c:9:1: error: missing 'PHI' def
finally_tmp.7_7 = PHI <0(5), 2(10), 1(9), (8), (6), (7)>
during GIMPLE pass: bitintlower
testcase.c:9:1: internal compiler error: verify_gimple failed
0x155b7cd verify_gimple_in_cfg(function*, bool, bool)
/repo/gcc-trunk/gcc/tree-cfg.cc:5666
0x13cac94 execute_function_todo
/repo/gcc-trunk/gcc/passes.cc:2088
0x13cb1ee execute_todo
/repo/gcc-trunk/gcc/passes.cc:2142
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-r14-8869-20240207154951-g8636c538b68-checking-yes-rtl-df-extra-nobootstrap-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/14.0.1/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-r14-8869-20240207154951-g8636c538b68-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.1 20240207 (experimental) (GCC)

[Bug tree-optimization/113774] wrong code with _BitInt() arithmetics at -O2

2024-02-06 Thread zsojka at seznam dot cz via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113774

--- Comment #1 from Zdenek Sojka  ---
Created attachment 57341
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57341=edit
another testcase, failing at -O1

I didn't check if the PR113753 patch fixes this.

Output:
$ x86_64-pc-linux-gnu-gcc -O testcase.c
$ ./a.out 
Aborted

[Bug tree-optimization/113783] New: ICE: in lower_stmt, at gimple-lower-bitint.cc:5455 with -O -mavx512f and _BitInt() in memcpy()

2024-02-06 Thread zsojka at seznam dot cz via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113783

Bug ID: 113783
   Summary: ICE: in lower_stmt, at gimple-lower-bitint.cc:5455
with -O -mavx512f and _BitInt() in memcpy()
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
CC: jakub at gcc dot gnu.org
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu

Created attachment 57340
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57340=edit
reduced testcase

Compiler output:
$ x86_64-pc-linux-gnu-gcc -O -mavx512f testcase.c
during GIMPLE pass: bitintlower
testcase.c: In function 'foo':
testcase.c:2:1: internal compiler error: in lower_stmt, at
gimple-lower-bitint.cc:5455
2 | foo(void *p, _BitInt(246) x)
  | ^~~
0xd8cedf lower_stmt
/repo/gcc-trunk/gcc/gimple-lower-bitint.cc:5455
0x2721439 gimple_lower_bitint
/repo/gcc-trunk/gcc/gimple-lower-bitint.cc:6582
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-r14-8817-20240205212943-gc5d34912ad5-checking-yes-rtl-df-extra-nobootstrap-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/14.0.1/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-r14-8817-20240205212943-gc5d34912ad5-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.1 20240206 (experimental) (GCC)

[Bug tree-optimization/113778] New: ICE: RTL check: expected elt 3 type 'e' or 'u', have '0' (rtx code_label) in PATTERN, at rtl.h:1506 with -march=armv9-a+sme -fhardened

2024-02-05 Thread zsojka at seznam dot cz via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113778

Bug ID: 113778
   Summary: ICE: RTL check: expected elt 3 type 'e' or 'u', have
'0' (rtx code_label) in PATTERN, at rtl.h:1506 with
-march=armv9-a+sme -fhardened
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: aarch64-unknown-linux-gnu

Created attachment 57333
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57333=edit
reduced testcase (from gcc.target/aarch64/sme/sibcall_6.c)

This might need RTL checking enabled.

Compiler output:
$ aarch64-unknown-linux-gnu-gcc -march=armv9-a+sme -fhardened sibcall_6.i
during RTL pass: mode_sw
sibcall_6.i: In function 'shared_to_normal':
sibcall_6.i:2:65: internal compiler error: RTL check: expected elt 3 type 'e'
or 'u', have '0' (rtx code_label) in PATTERN, at rtl.h:1506
2 | void shared_to_normal() [[arm::inout("za")]] { normal_callee(); }
  | ^
0x86155c rtl_check_failed_type2(rtx_def const*, int, int, int, char const*,
int, char const*)
/repo/gcc-trunk/gcc/rtl.cc:761
0x86229d PATTERN(rtx_def const*)
/repo/gcc-trunk/gcc/rtl.h:1506
0x864803 PATTERN(rtx_def const*)
/repo/gcc-trunk/gcc/rtl.h:1506
0x864803 rtx_properties::try_to_add_insn(rtx_insn const*, bool)
/repo/gcc-trunk/gcc/rtlanal.cc:2344
0x1721ce6 growing_rtx_properties::add_insn(rtx_insn
const*, bool)::{lambda()#1}::operator()() const
/repo/gcc-trunk/gcc/rtlanal.h:288
0x1721ce6 void
growing_rtx_properties::repeat::add_insn(rtx_insn
const*,
bool)::{lambda()#1}>(growing_rtx_properties::add_insn(rtx_insn
const*, bool)::{lambda()#1})
/repo/gcc-trunk/gcc/rtlanal.h:246
0x1721ce6 growing_rtx_properties::add_insn(rtx_insn
const*, bool)
/repo/gcc-trunk/gcc/rtlanal.h:288
0x1721ce6 aarch64_mode_emit
/repo/gcc-trunk/gcc/config/aarch64/aarch64.cc:29450
0x230de87 optimize_mode_switching
/repo/gcc-trunk/gcc/mode-switching.cc:1210
0x230de87 execute
/repo/gcc-trunk/gcc/mode-switching.cc:1309
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.

$ aarch64-unknown-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=/repo/gcc-trunk/binary-latest-aarch64/bin/aarch64-unknown-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-r14-8795-20240204180638-g91e09b3a7e9-checking-yes-rtl-df-extra-aarch64/bin/../libexec/gcc/aarch64-unknown-linux-gnu/14.0.1/lto-wrapper
Target: aarch64-unknown-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--with-cloog --with-ppl --with-isl
--with-sysroot=/usr/aarch64-unknown-linux-gnu --build=x86_64-pc-linux-gnu
--host=x86_64-pc-linux-gnu --target=aarch64-unknown-linux-gnu
--with-ld=/usr/bin/aarch64-unknown-linux-gnu-ld
--with-as=/usr/bin/aarch64-unknown-linux-gnu-as --disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r14-8795-20240204180638-g91e09b3a7e9-checking-yes-rtl-df-extra-aarch64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.1 20240205 (experimental) (GCC)

[Bug debug/113777] New: ICE: in add_child_die_after, at dwarf2out.cc:5785 with -g -fsso-struct=big-endian and __attribute__((__hardbool__))

2024-02-05 Thread zsojka at seznam dot cz via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113777

Bug ID: 113777
   Summary: ICE: in add_child_die_after, at dwarf2out.cc:5785 with
-g -fsso-struct=big-endian and
__attribute__((__hardbool__))
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: debug
  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

Created attachment 57332
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57332=edit
reduced testcase

Compiler output:
$ x86_64-pc-linux-gnu-gcc -g -fsso-struct=big-endian testcase.c 
testcase.c:5:1: internal compiler error: in add_child_die_after, at
dwarf2out.cc:5785
5 | };
  | ^
0x746e52 add_child_die_after
/repo/gcc-trunk/gcc/dwarf2out.cc:5785
0x746e52 add_child_die_after
/repo/gcc-trunk/gcc/dwarf2out.cc:5782
0x106c42d gen_enumeration_type_die
/repo/gcc-trunk/gcc/dwarf2out.cc:22868
0x105399a gen_tagged_type_die
/repo/gcc-trunk/gcc/dwarf2out.cc:26201
0x105399a gen_type_die_with_usage
/repo/gcc-trunk/gcc/dwarf2out.cc:26441
0x1056334 gen_type_die
/repo/gcc-trunk/gcc/dwarf2out.cc:26497
0x1056334 modified_type_die
/repo/gcc-trunk/gcc/dwarf2out.cc:13985
0x10573b6 add_type_attribute
/repo/gcc-trunk/gcc/dwarf2out.cc:22388
0x1053d35 gen_array_type_die
/repo/gcc-trunk/gcc/dwarf2out.cc:22655
0x1053d35 gen_type_die_with_usage
/repo/gcc-trunk/gcc/dwarf2out.cc:26434
0x10505ed gen_type_die
/repo/gcc-trunk/gcc/dwarf2out.cc:26497
0x10505ed gen_decl_die
/repo/gcc-trunk/gcc/dwarf2out.cc:27213
0x1052b96 gen_member_die
/repo/gcc-trunk/gcc/dwarf2out.cc:25949
0x1052b96 gen_struct_or_union_type_die
/repo/gcc-trunk/gcc/dwarf2out.cc:26045
0x1052b96 gen_tagged_type_die
/repo/gcc-trunk/gcc/dwarf2out.cc:26247
0x105399a gen_tagged_type_die
/repo/gcc-trunk/gcc/dwarf2out.cc:26201
0x105399a gen_type_die_with_usage
/repo/gcc-trunk/gcc/dwarf2out.cc:26441
0x10506e5 gen_type_die
/repo/gcc-trunk/gcc/dwarf2out.cc:26497
0x10506e5 gen_decl_die
/repo/gcc-trunk/gcc/dwarf2out.cc:27137
0x10516bb dwarf2out_decl
/repo/gcc-trunk/gcc/dwarf2out.cc:27695
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-r14-8810-20240205112830-gf1412546ac8-checking-yes-rtl-df-extra-nobootstrap-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/14.0.1/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-r14-8810-20240205112830-gf1412546ac8-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.1 20240205 (experimental) (GCC)

[Bug tree-optimization/113774] New: wrong code with _BitInt() arithmetics at -O2

2024-02-05 Thread zsojka at seznam dot cz via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113774

Bug ID: 113774
   Summary: wrong code with _BitInt() arithmetics at -O2
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: wrong-code
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
CC: jakub at gcc dot gnu.org
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu

Created attachment 57328
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57328=edit
reduced testcase

This fails even with the PR113753 patch applied.

Output:
$ x86_64-pc-linux-gnu-gcc -O2 testcase.c
$ ./a.out 
Aborted

$ 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-r14-8795-20240204180638-g91e09b3a7e9-checking-yes-rtl-df-extra-nobootstrap-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/14.0.1/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-r14-8795-20240204180638-g91e09b3a7e9-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.1 20240205 (experimental) (GCC)

[Bug target/113766] New: ICE: in generate_insn, at config/riscv/riscv-vector-builtins.cc:4186 with (invalid?) __riscv_vfredosum_tu()

2024-02-05 Thread zsojka at seznam dot cz via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113766

Bug ID: 113766
   Summary: ICE: in generate_insn, at
config/riscv/riscv-vector-builtins.cc:4186 with
(invalid?) __riscv_vfredosum_tu()
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: riscv64-unknown-linux-gnu

Created attachment 57323
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57323=edit
reduced testcase

Compiler output:
$ riscv64-unknown-linux-gnu-gcc -march=rv64gv testcase.c 
during RTL pass: expand
testcase.c: In function 'foo':
testcase.c:6:3: internal compiler error: in generate_insn, at
config/riscv/riscv-vector-builtins.cc:4186
6 |   __riscv_vfredosum_tu();
  |   ^~
0xb9bd49 riscv_vector::function_expander::generate_insn(insn_code)
/repo/gcc-trunk/gcc/config/riscv/riscv-vector-builtins.cc:4186
0xb9bd49 riscv_vector::function_expander::generate_insn(insn_code)
/repo/gcc-trunk/gcc/config/riscv/riscv-vector-builtins.cc:4184
0x1bcd50d riscv_vector::function_expander::expand()
/repo/gcc-trunk/gcc/config/riscv/riscv-vector-builtins.h:582
0x1bcd50d riscv_vector::expand_builtin(unsigned int, tree_node*, rtx_def*)
/repo/gcc-trunk/gcc/config/riscv/riscv-vector-builtins.cc:4589
0x12ca5e3 expand_expr_real_1(tree_node*, rtx_def*, machine_mode,
expand_modifier, rtx_def**, bool)
/repo/gcc-trunk/gcc/expr.cc:12350
0x1187df8 expand_expr(tree_node*, rtx_def*, machine_mode, expand_modifier)
/repo/gcc-trunk/gcc/expr.h:316
0x1187df8 expand_call_stmt
/repo/gcc-trunk/gcc/cfgexpand.cc:2864
0x1187df8 expand_gimple_stmt_1
/repo/gcc-trunk/gcc/cfgexpand.cc:3926
0x1187df8 expand_gimple_stmt
/repo/gcc-trunk/gcc/cfgexpand.cc:4071
0x118e45e expand_gimple_basic_block
/repo/gcc-trunk/gcc/cfgexpand.cc:6127
0x1190067 execute
/repo/gcc-trunk/gcc/cfgexpand.cc:6866
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.


$ riscv64-unknown-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=/repo/gcc-trunk/binary-latest-riscv64/bin/riscv64-unknown-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-r14-8795-20240204180638-g91e09b3a7e9-checking-yes-rtl-df-extra-riscv64/bin/../libexec/gcc/riscv64-unknown-linux-gnu/14.0.1/lto-wrapper
Target: riscv64-unknown-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--with-cloog --with-ppl --with-isl --with-isa-spec=2.2
--with-sysroot=/usr/riscv64-unknown-linux-gnu --build=x86_64-pc-linux-gnu
--host=x86_64-pc-linux-gnu --target=riscv64-unknown-linux-gnu
--with-ld=/usr/bin/riscv64-unknown-linux-gnu-ld
--with-as=/usr/bin/riscv64-unknown-linux-gnu-as --disable-multilib
--disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r14-8795-20240204180638-g91e09b3a7e9-checking-yes-rtl-df-extra-riscv64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.1 20240205 (experimental) (GCC)

[Bug tree-optimization/113753] New: wrong code with _BitInt(129) multiplication and division at -O2

2024-02-03 Thread zsojka at seznam dot cz via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113753

Bug ID: 113753
   Summary: wrong code with _BitInt(129) multiplication and
division at -O2
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: wrong-code
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
CC: jakub at gcc dot gnu.org
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu

Created attachment 57316
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57316=edit
reduced testcase

Output:
$ x86_64-pc-linux-gnu-gcc -O2 testcase.c
$ ./a.out 
Aborted

The result of "u * m" does not fit into unsigned _BitInt(129), but at -O2, 'm'
is returned.

$ 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-r14-8779-20240203093135-gd436e8e70da-checking-yes-rtl-df-extra-nobootstrap-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/14.0.1/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-r14-8779-20240203093135-gd436e8e70da-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.1 20240203 (experimental) (GCC)

[Bug tree-optimization/113747] New: ICE: SIGSEGV in non_type_check (tree.h:3822) with -fopenacc --param=openacc-kernels=decompose on invalid code

2024-02-03 Thread zsojka at seznam dot cz via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113747

Bug ID: 113747
   Summary: ICE: SIGSEGV in non_type_check (tree.h:3822) with
-fopenacc --param=openacc-kernels=decompose on invalid
code
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: ice-on-invalid-code
  Severity: normal
  Priority: P3
 Component: tree-optimization
  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

Created attachment 57314
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57314=edit
reduced testcase

Compiler output:
$ x86_64-pc-linux-gnu-gcc -fopenacc --param=openacc-kernels=decompose
testcase.C -wrapper valgrind,-q
testcase.C: In function 'void foo()':
testcase.C:6:5: error: 'a' was not declared in this scope
6 | a[i] = i;
  | ^
==6033== Invalid read of size 2
==6033==at 0x1661F2C: non_type_check (tree.h:3822)
==6033==by 0x1661F2C: fixup_remapped_decl(tree_node*, omp_context*, bool)
(omp-low.cc:907)
==6033==by 0x1668AAC: scan_sharing_clauses(tree_node*, omp_context*)
(omp-low.cc:1919)
==6033==by 0x166A107: scan_omp_target(gomp_target*, omp_context*)
(omp-low.cc:3120)
==6033==by 0x166AFF1: scan_omp_1_stmt(gimple_stmt_iterator*, bool*,
walk_stmt_info*) (omp-low.cc:4230)
==6033==by 0x149A9CA: walk_gimple_stmt(gimple_stmt_iterator*, tree_node*
(*)(gimple_stmt_iterator*, bool*, walk_stmt_info*), tree_node* (*)(tree_node**,
int*, void*), walk_stmt_info*) (gimple-walk.cc:618)
==6033==by 0x149ABAD: walk_gimple_seq_mod(gimple**, tree_node*
(*)(gimple_stmt_iterator*, bool*, walk_stmt_info*), tree_node* (*)(tree_node**,
int*, void*), walk_stmt_info*) (gimple-walk.cc:51)
==6033==by 0x149AA81: walk_gimple_stmt(gimple_stmt_iterator*, tree_node*
(*)(gimple_stmt_iterator*, bool*, walk_stmt_info*), tree_node* (*)(tree_node**,
int*, void*), walk_stmt_info*) (gimple-walk.cc:735)
==6033==by 0x149ABAD: walk_gimple_seq_mod(gimple**, tree_node*
(*)(gimple_stmt_iterator*, bool*, walk_stmt_info*), tree_node* (*)(tree_node**,
int*, void*), walk_stmt_info*) (gimple-walk.cc:51)
==6033==by 0x149AAC1: walk_gimple_stmt(gimple_stmt_iterator*, tree_node*
(*)(gimple_stmt_iterator*, bool*, walk_stmt_info*), tree_node* (*)(tree_node**,
int*, void*), walk_stmt_info*) (gimple-walk.cc:681)
==6033==by 0x149ABAD: walk_gimple_seq_mod(gimple**, tree_node*
(*)(gimple_stmt_iterator*, bool*, walk_stmt_info*), tree_node* (*)(tree_node**,
int*, void*), walk_stmt_info*) (gimple-walk.cc:51)
==6033==by 0x166A145: scan_omp (omp-low.cc:4284)
==6033==by 0x166A145: scan_omp_target(gomp_target*, omp_context*)
(omp-low.cc:3121)
==6033==by 0x166AEE0: scan_omp_1_stmt(gimple_stmt_iterator*, bool*,
walk_stmt_info*) (omp-low.cc:4234)
==6033==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==6033== 
during GIMPLE pass: omplower
testcase.C:4:9: internal compiler error: Segmentation fault
4 | #pragma acc kernels
  | ^~~
0x1816b62 crash_signal
/repo/gcc-trunk/gcc/toplev.cc:317
$ 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-r14-8771-20240203001826-g4b7d4d8a4af-checking-yes-rtl-df-extra-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/14.0.1/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
--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-r14-8771-20240203001826-g4b7d4d8a4af-checking-yes-rtl-df-extra-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.1 20240203 (experimental) (GCC)

[Bug c++/113746] New: [14 Regression] ICE: tree check: expected enumeral_type, have error_mark in tsubst_expr, at cp/pt.cc:21458 with missing typename

2024-02-03 Thread zsojka at seznam dot cz via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113746

Bug ID: 113746
   Summary: [14 Regression] ICE: tree check: expected
enumeral_type, have error_mark in tsubst_expr, at
cp/pt.cc:21458 with missing typename
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: ice-on-invalid-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

Created attachment 57313
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57313=edit
reduced testcase

Compiler output:
$ x86_64-pc-linux-gnu-gcc testcase.C -wrapper valgrind,-q
testcase.C:1:12: error: 'typename_T' has not been declared
1 | template < typename_T > struct S {
  |^~
testcase.C:2:24: internal compiler error: tree check: expected enumeral_type,
have error_mark in tsubst_expr, at cp/pt.cc:21458
2 |   enum { e0 = 0, e00 = e0 };
  |^~
0x96eab7 tree_check_failed(tree_node const*, char const*, int, char const*,
...)
/repo/gcc-trunk/gcc/tree.cc:8952
==27631== Invalid read of size 1
==27631==at 0x2DF67C0: x86_64_fallback_frame_state (md-unwind-support.h:63)
==27631==by 0x2DF67C0: uw_frame_state_for (unwind-dw2.c:1013)
==27631==by 0x2DF7AFD: _Unwind_Backtrace (unwind.inc:303)
==27631==by 0x2DA0F49: backtrace_full (backtrace.c:127)
==27631==by 0x2D03556:
diagnostic_context::action_after_output(diagnostic_t) (diagnostic.cc:781)
==27631==by 0x2D0376B: diagnostic_action_after_output (diagnostic.h:1002)
==27631==by 0x2D0376B:
diagnostic_context::report_diagnostic(diagnostic_info*) (diagnostic.cc:1633)
==27631==by 0x2D03AE8: diagnostic_impl(rich_location*, diagnostic_metadata
const*, int, char const*, __va_list_tag (*) [1], diagnostic_t)
(diagnostic.cc:1767)
==27631==by 0x2D041B6: internal_error(char const*, ...)
(diagnostic.cc:2225)
==27631==by 0x96EAB7: tree_check_failed(tree_node const*, char const*, int,
char const*, ...) (tree.cc:8952)
==27631==  Address 0x1 is not stack'd, malloc'd or (recently) free'd
==27631== 

testcase.C:2:24: internal compiler error: Segmentation fault
0x1816b62 crash_signal
/repo/gcc-trunk/gcc/toplev.cc:317
0x2df67c0 x86_64_fallback_frame_state
./md-unwind-support.h:63
0x2df67c0 uw_frame_state_for
/repo/gcc-trunk/libgcc/unwind-dw2.c:1013
0x2df7afd _Unwind_Backtrace
/repo/gcc-trunk/libgcc/unwind.inc:303
0x2da0f49 backtrace_full
/repo/gcc-trunk/libbacktrace/backtrace.c:127
0x2d03556 diagnostic_context::action_after_output(diagnostic_t)
/repo/gcc-trunk/gcc/diagnostic.cc:781
0x2d0376b diagnostic_action_after_output(diagnostic_context*, diagnostic_t)
/repo/gcc-trunk/gcc/diagnostic.h:1002
0x2d0376b diagnostic_context::report_diagnostic(diagnostic_info*)
/repo/gcc-trunk/gcc/diagnostic.cc:1633
0x2d03ae8 diagnostic_impl
/repo/gcc-trunk/gcc/diagnostic.cc:1767
0x2d041b6 internal_error(char const*, ...)
/repo/gcc-trunk/gcc/diagnostic.cc:2225
0x96eab7 tree_check_failed(tree_node const*, char const*, int, char const*,
...)
/repo/gcc-trunk/gcc/tree.cc:8952

$ 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-r14-8771-20240203001826-g4b7d4d8a4af-checking-yes-rtl-df-extra-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/14.0.1/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
--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-r14-8771-20240203001826-g4b7d4d8a4af-checking-yes-rtl-df-extra-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.1 20240203 (experimental) (GCC)

[Bug target/113742] New: ICE: RTL check: expected elt 1 type 'i' or 'n', have 'e' (rtx set) in riscv_macro_fusion_pair_p, at config/riscv/riscv.cc:8416 with -O2 -finstrument-functions -mtune=sifive-p6

2024-02-03 Thread zsojka at seznam dot cz via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113742

Bug ID: 113742
   Summary: ICE: RTL check: expected elt 1 type 'i' or 'n', have
'e' (rtx set) in riscv_macro_fusion_pair_p, at
config/riscv/riscv.cc:8416 with -O2
-finstrument-functions -mtune=sifive-p600-series
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: riscv64-unknown-linux-gnu

Created attachment 57309
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57309=edit
reduced testcase

This might need RTL checking enabled.

Compiler output:
$ riscv64-unknown-linux-gnu-gcc -O2 -finstrument-functions
-mtune=sifive-p600-series testcase.c 
during RTL pass: sched2
testcase.c: In function 'foo':
testcase.c:1:17: internal compiler error: RTL check: expected elt 1 type 'i' or
'n', have 'e' (rtx set) in riscv_macro_fusion_pair_p, at
config/riscv/riscv.cc:8416
1 | void foo(void) {}
  | ^
0xad8030 rtl_check_failed_type2(rtx_def const*, int, int, int, char const*,
int, char const*)
/repo/gcc-trunk/gcc/rtl.cc:761
0xb8d03e riscv_macro_fusion_pair_p
/repo/gcc-trunk/gcc/config/riscv/riscv.cc:8416
0x2b933a4 sched_macro_fuse_insns
/repo/gcc-trunk/gcc/sched-deps.cc:2859
0x2b933a4 sched_analyze_insn
/repo/gcc-trunk/gcc/sched-deps.cc:2898
0x2b94099 deps_analyze_insn(deps_desc*, rtx_insn*)
/repo/gcc-trunk/gcc/sched-deps.cc:3690
0x2b9718a sched_analyze(deps_desc*, rtx_insn*, rtx_insn*)
/repo/gcc-trunk/gcc/sched-deps.cc:3843
0x16af378 compute_block_dependences
/repo/gcc-trunk/gcc/sched-rgn.cc:2738
0x16af378 sched_rgn_compute_dependencies(int)
/repo/gcc-trunk/gcc/sched-rgn.cc:3367
0x16b1c18 schedule_region
/repo/gcc-trunk/gcc/sched-rgn.cc:3139
0x16b1c18 schedule_insns()
/repo/gcc-trunk/gcc/sched-rgn.cc:3525
0x16b22bd schedule_insns()
/repo/gcc-trunk/gcc/sched-rgn.cc:3511
0x16b22bd rest_of_handle_sched2
/repo/gcc-trunk/gcc/sched-rgn.cc:3749
0x16b22bd execute
/repo/gcc-trunk/gcc/sched-rgn.cc:3888
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.

$ riscv64-unknown-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=/repo/gcc-trunk/binary-latest-riscv64/bin/riscv64-unknown-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-r14-8771-20240203001826-g4b7d4d8a4af-checking-yes-rtl-df-extra-riscv64/bin/../libexec/gcc/riscv64-unknown-linux-gnu/14.0.1/lto-wrapper
Target: riscv64-unknown-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--with-cloog --with-ppl --with-isl --with-isa-spec=2.2
--with-sysroot=/usr/riscv64-unknown-linux-gnu --build=x86_64-pc-linux-gnu
--host=x86_64-pc-linux-gnu --target=riscv64-unknown-linux-gnu
--with-ld=/usr/bin/riscv64-unknown-linux-gnu-ld
--with-as=/usr/bin/riscv64-unknown-linux-gnu-as --disable-multilib
--disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r14-8771-20240203001826-g4b7d4d8a4af-checking-yes-rtl-df-extra-riscv64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.1 20240203 (experimental) (GCC)

[Bug c/113740] New: ICE: in build_bitint_type, at tree.cc:7178 with _BitInt() as bitfeld

2024-02-03 Thread zsojka at seznam dot cz via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113740

Bug ID: 113740
   Summary: ICE: in build_bitint_type, at tree.cc:7178 with
_BitInt() as bitfeld
   Product: gcc
   Version: 14.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
CC: jakub at gcc dot gnu.org
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu

Created attachment 57307
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57307=edit
reduced testcase

Compiler output:
$ x86_64-pc-linux-gnu-gcc testcase.c 
testcase.c:3:1: internal compiler error: in build_bitint_type, at tree.cc:7178
3 | };
  | ^
0x89961c build_bitint_type(unsigned long, int)
/repo/gcc-trunk/gcc/tree.cc:7178
0xe0e96b finish_struct(unsigned int, tree_node*, tree_node*, tree_node*,
c_struct_parse_info*, tree_node**)
/repo/gcc-trunk/gcc/c/c-decl.cc:9560
0xe69d7d c_parser_struct_or_union_specifier
/repo/gcc-trunk/gcc/c/c-parser.cc:4090
0xe69d7d c_parser_declspecs(c_parser*, c_declspecs*, bool, bool, bool, bool,
bool, bool, bool, c_lookahead_kind)
/repo/gcc-trunk/gcc/c/c-parser.cc:3494
0xe792ec c_parser_declaration_or_fndef
/repo/gcc-trunk/gcc/c/c-parser.cc:2306
0xe854bb c_parser_external_declaration
/repo/gcc-trunk/gcc/c/c-parser.cc:2046
0xe85ea5 c_parser_translation_unit
/repo/gcc-trunk/gcc/c/c-parser.cc:1900
0xe85ea5 c_parse_file()
/repo/gcc-trunk/gcc/c/c-parser.cc:26815
0xefd681 c_common_parse_file()
/repo/gcc-trunk/gcc/c-family/c-opts.cc:1306
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-r14-8771-20240203001826-g4b7d4d8a4af-checking-yes-rtl-df-extra-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/14.0.1/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
--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-r14-8771-20240203001826-g4b7d4d8a4af-checking-yes-rtl-df-extra-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.1 20240203 (experimental) (GCC)

[Bug target/113739] New: ICE: in riscv_hard_regno_nregs, at config/riscv/riscv.cc:8072 with __attribute__((__target__("arch=rv64gcv")))

2024-02-03 Thread zsojka at seznam dot cz via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113739

Bug ID: 113739
   Summary: ICE: in riscv_hard_regno_nregs, at
config/riscv/riscv.cc:8072 with
__attribute__((__target__("arch=rv64gcv")))
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: riscv64-unknown-linux-gnu

Created attachment 57306
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57306=edit
reduced testcase (from gcc.target/riscv/target-attr-01.c)

Compiler output:
$ riscv64-unknown-linux-gnu-gcc testcase.c 
testcase.c: In function 'foo':
testcase.c:4:1: internal compiler error: in riscv_hard_regno_nregs, at
config/riscv/riscv.cc:8072
4 | {
  | ^
0xb8742e riscv_hard_regno_nregs
/repo/gcc-trunk/gcc/config/riscv/riscv.cc:8072
0x166c5fa init_reg_modes_target()
/repo/gcc-trunk/gcc/reginfo.cc:471
0x128b5f3 init_emit_regs()
/repo/gcc-trunk/gcc/emit-rtl.cc:6237
0x171df76 target_reinit()
/repo/gcc-trunk/gcc/toplev.cc:1934
0x2b9c43a save_target_globals()
/repo/gcc-trunk/gcc/target-globals.cc:92
0x1aeb99d riscv_save_restore_target_globals(tree_node*)
/repo/gcc-trunk/gcc/config/riscv/riscv.cc:9081
0x1aeb99d riscv_save_restore_target_globals(tree_node*)
/repo/gcc-trunk/gcc/config/riscv/riscv.cc:9074
0x133c4f4 invoke_set_current_function_hook
/repo/gcc-trunk/gcc/function.cc:4689
0x1345917 invoke_set_current_function_hook
/repo/gcc-trunk/gcc/function.cc:4863
0x1345917 allocate_struct_function(tree_node*, bool)
/repo/gcc-trunk/gcc/function.cc:4812
0x100f6ed store_parm_decls()
/repo/gcc-trunk/gcc/c/c-decl.cc:11084
0x10780f2 c_parser_declaration_or_fndef
/repo/gcc-trunk/gcc/c/c-parser.cc:2975
0x1081f2b c_parser_external_declaration
/repo/gcc-trunk/gcc/c/c-parser.cc:2046
0x1082913 c_parser_translation_unit
/repo/gcc-trunk/gcc/c/c-parser.cc:1900
0x1082913 c_parse_file()
/repo/gcc-trunk/gcc/c/c-parser.cc:26815
0x10f83b1 c_common_parse_file()
/repo/gcc-trunk/gcc/c-family/c-opts.cc:1306
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.

$ riscv64-unknown-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=/repo/gcc-trunk/binary-latest-riscv64/bin/riscv64-unknown-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-r14-8771-20240203001826-g4b7d4d8a4af-checking-yes-rtl-df-extra-riscv64/bin/../libexec/gcc/riscv64-unknown-linux-gnu/14.0.1/lto-wrapper
Target: riscv64-unknown-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--with-cloog --with-ppl --with-isl --with-isa-spec=2.2
--with-sysroot=/usr/riscv64-unknown-linux-gnu --build=x86_64-pc-linux-gnu
--host=x86_64-pc-linux-gnu --target=riscv64-unknown-linux-gnu
--with-ld=/usr/bin/riscv64-unknown-linux-gnu-ld
--with-as=/usr/bin/riscv64-unknown-linux-gnu-as --disable-multilib
--disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r14-8771-20240203001826-g4b7d4d8a4af-checking-yes-rtl-df-extra-riscv64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.1 20240203 (experimental) (GCC)

[Bug target/113738] New: [14 Regression] ICE: in df_reg_chain_verify_unmarked, at df-scan.cc:4001 with -O2 -march=rv64gcv

2024-02-03 Thread zsojka at seznam dot cz via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113738

Bug ID: 113738
   Summary: [14 Regression] ICE: in df_reg_chain_verify_unmarked,
at df-scan.cc:4001 with -O2 -march=rv64gcv
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: riscv64-unknown-linux-gnu

Created attachment 57305
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57305=edit
reduced testcase (from gcc.dg/torture/pr45764.c)

Compiler output:
$ riscv64-unknown-linux-gnu-gcc -O2 -march=rv64gcv testcase.c 
during RTL pass: rtl_dce
testcase.c: In function 'foo':
testcase.c:7:1: internal compiler error: in df_reg_chain_verify_unmarked, at
df-scan.cc:4001
7 | }
  | ^
0xa138ee df_reg_chain_verify_unmarked
/repo/gcc-trunk/gcc/df-scan.cc:4001
0xa15111 df_reg_chain_verify_unmarked
/repo/gcc-trunk/gcc/df-scan.cc:4218
0xa15111 df_scan_verify()
/repo/gcc-trunk/gcc/df-scan.cc:4264
0x11f06d1 df_verify()
/repo/gcc-trunk/gcc/df-core.cc:1834
0x11f06d1 df_analyze_1
/repo/gcc-trunk/gcc/df-core.cc:1221
0x29de3d5 init_dce
/repo/gcc-trunk/gcc/dce.cc:763
0x29e103d rest_of_handle_fast_dce
/repo/gcc-trunk/gcc/dce.cc:1193
0x29e103d execute
/repo/gcc-trunk/gcc/dce.cc:1290
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.

$ riscv64-unknown-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=/repo/gcc-trunk/binary-latest-riscv64/bin/riscv64-unknown-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-r14-8771-20240203001826-g4b7d4d8a4af-checking-yes-rtl-df-extra-riscv64/bin/../libexec/gcc/riscv64-unknown-linux-gnu/14.0.1/lto-wrapper
Target: riscv64-unknown-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--with-cloog --with-ppl --with-isl --with-isa-spec=2.2
--with-sysroot=/usr/riscv64-unknown-linux-gnu --build=x86_64-pc-linux-gnu
--host=x86_64-pc-linux-gnu --target=riscv64-unknown-linux-gnu
--with-ld=/usr/bin/riscv64-unknown-linux-gnu-ld
--with-as=/usr/bin/riscv64-unknown-linux-gnu-as --disable-multilib
--disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r14-8771-20240203001826-g4b7d4d8a4af-checking-yes-rtl-df-extra-riscv64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.1 20240203 (experimental) (GCC)

[Bug tree-optimization/113737] New: ICE: in lower_stmt, at gimple-lower-bitint.cc:5455 with _BitInt() used in switch at -O2

2024-02-03 Thread zsojka at seznam dot cz via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113737

Bug ID: 113737
   Summary: ICE: in lower_stmt, at gimple-lower-bitint.cc:5455
with _BitInt() used in switch at -O2
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
CC: jakub at gcc dot gnu.org
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu

Created attachment 57304
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57304=edit
reduced testcase (from gcc.dg/pr80823.c)

Compiler output:
$ x86_64-pc-linux-gnu-gcc -O2 testcase.c 
during GIMPLE pass: bitintlower
testcase.c: In function 'fn2':
testcase.c:16:1: internal compiler error: in lower_stmt, at
gimple-lower-bitint.cc:5455
   16 | fn2(int i)
  | ^~~
0xd898b9 lower_stmt
/repo/gcc-trunk/gcc/gimple-lower-bitint.cc:5455
0x274dc73 gimple_lower_bitint
/repo/gcc-trunk/gcc/gimple-lower-bitint.cc:6575
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-r14-8771-20240203001826-g4b7d4d8a4af-checking-yes-rtl-df-extra-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/14.0.1/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
--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-r14-8771-20240203001826-g4b7d4d8a4af-checking-yes-rtl-df-extra-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.1 20240203 (experimental) (GCC)

[Bug tree-optimization/113736] New: ICE: verify_gimple failed: incompatible types in 'PHI' argument 0 with _BitInt() struct copy to __seg_fs/gs

2024-02-03 Thread zsojka at seznam dot cz via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113736

Bug ID: 113736
   Summary: ICE: verify_gimple failed: incompatible types in 'PHI'
argument 0 with _BitInt() struct copy to __seg_fs/gs
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: tree-optimization
  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

Created attachment 57303
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57303=edit
reduced testcase (from gcc.target/i386/pr90856.c)

Compiler output:
$ x86_64-pc-linux-gnu-gcc -O2 testcase.c 
testcase.c: In function 'clearS2_n':
testcase.c:12:1: error: incompatible types in 'PHI' argument 0
   12 | clearS2_n (__seg_gs S2 *p)
  | ^
vector(2) unsigned long * {ref-all}

 struct S2 *

vectp_p.4_14 = PHI 
during GIMPLE pass: vect
testcase.c:12:1: internal compiler error: verify_gimple failed
0x1567165 verify_gimple_in_cfg(function*, bool, bool)
/repo/gcc-trunk/gcc/tree-cfg.cc:5666
0x13cf7e4 execute_function_todo
/repo/gcc-trunk/gcc/passes.cc:2088
0x13cfd3e execute_todo
/repo/gcc-trunk/gcc/passes.cc:2142
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-r14-8771-20240203001826-g4b7d4d8a4af-checking-yes-rtl-df-extra-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/14.0.1/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
--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-r14-8771-20240203001826-g4b7d4d8a4af-checking-yes-rtl-df-extra-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.1 20240203 (experimental) (GCC)

[Bug tree-optimization/113735] New: ICE: in operator[], at vec.h:910 with _BitInt() at -O and above

2024-02-03 Thread zsojka at seznam dot cz via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113735

Bug ID: 113735
   Summary: ICE: in operator[], at vec.h:910 with _BitInt() at -O
and above
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
CC: jakub at gcc dot gnu.org
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu

Created attachment 57302
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57302=edit
reduced testcase

Compiler output:
$ x86_64-pc-linux-gnu-gcc -O testcase.c
during GIMPLE pass: bitintlower
testcase.c: In function 'foo':
testcase.c:4:1: internal compiler error: in operator[], at vec.h:910
4 | foo (_BitInt(6110) j)
  | ^~~
0x8a2ed8 vec::operator[](unsigned int)
/repo/gcc-trunk/gcc/vec.h:910
0x8a30be vec::operator[](unsigned int)
/repo/gcc-trunk/gcc/value-relation.cc:736
0x8a30be vec::operator[](unsigned int)
/repo/gcc-trunk/gcc/vec.h:1599
0x8a30be equiv_oracle::add_equiv_to_block(basic_block_def*, bitmap_head*)
/repo/gcc-trunk/gcc/value-relation.cc:721
0x1868312 equiv_oracle::register_relation(basic_block_def*, relation_kind_t,
tree_node*, tree_node*)
/repo/gcc-trunk/gcc/value-relation.cc:675
0x2741a67 fold_using_range::range_of_phi(vrange&, gphi*, fur_source&)
/repo/gcc-trunk/gcc/gimple-range-fold.cc:932
0x27458f0 fold_using_range::fold_stmt(vrange&, gimple*, fur_source&,
tree_node*)
/repo/gcc-trunk/gcc/gimple-range-fold.cc:604
0x272c929 gimple_ranger::fold_range_internal(vrange&, gimple*, tree_node*)
/repo/gcc-trunk/gcc/gimple-range.cc:265
0x272c929 gimple_ranger::prefill_stmt_dependencies(tree_node*)
/repo/gcc-trunk/gcc/gimple-range.cc:404
0x272d9ca gimple_ranger::range_of_stmt(vrange&, gimple*, tree_node*)
/repo/gcc-trunk/gcc/gimple-range.cc:322
0x27315aa gimple_ranger::range_of_expr(vrange&, tree_node*, gimple*)
/repo/gcc-trunk/gcc/gimple-range.cc:134
0x27077e2 range_to_prec
/repo/gcc-trunk/gcc/gimple-lower-bitint.cc:2008
0x270c7e0 handle_operand_addr
/repo/gcc-trunk/gcc/gimple-lower-bitint.cc:2211
0x270cbe7 lower_muldiv_stmt
/repo/gcc-trunk/gcc/gimple-lower-bitint.cc:3403
0x2720eb9 gimple_lower_bitint
/repo/gcc-trunk/gcc/gimple-lower-bitint.cc:6575
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-r14-8771-20240203001826-g4b7d4d8a4af-checking-yes-rtl-df-extra-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/14.0.1/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
--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-r14-8771-20240203001826-g4b7d4d8a4af-checking-yes-rtl-df-extra-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.1 20240203 (experimental) (GCC)

[Bug tree-optimization/113699] New: during GIMPLE pass: bitintlower ICE: SIGSEGV in var_to_partition (tree-ssa-live.h:163) with _BitInt() used in __asm__

2024-01-31 Thread zsojka at seznam dot cz via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113699

Bug ID: 113699
   Summary: during GIMPLE pass: bitintlower ICE: SIGSEGV in
var_to_partition (tree-ssa-live.h:163) with _BitInt()
used in __asm__
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
CC: jakub at gcc dot gnu.org
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu

Created attachment 57276
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57276=edit
reduced testcase (from gcc.target/i386/pr41985.c)

Compiler output:
$ x86_64-pc-linux-gnu-gcc testcase.c -wrapper valgrind,-q
==30321== Invalid read of size 8
==30321==at 0x271DC7F: var_to_partition (tree-ssa-live.h:163)
==30321==by 0x271DC7F: lower_asm (gimple-lower-bitint.cc:5203)
==30321==by 0x271DC7F: (anonymous
namespace)::bitint_large_huge::lower_stmt(gimple*)
(gimple-lower-bitint.cc:5240)
==30321==by 0x2720009: gimple_lower_bitint() (gimple-lower-bitint.cc:6564)
==30321==by 0x13CDCBA: execute_one_pass(opt_pass*) (passes.cc:2646)
==30321==by 0x13CE5AF: execute_pass_list_1(opt_pass*) (passes.cc:2755)
==30321==by 0x13CE5E8: execute_pass_list(function*, opt_pass*)
(passes.cc:2766)
==30321==by 0xFCDC05: expand (cgraphunit.cc:1843)
==30321==by 0xFCDC05: cgraph_node::expand() (cgraphunit.cc:1796)
==30321==by 0xFCEB19: output_in_order (cgraphunit.cc:2193)
==30321==by 0xFCEB19: symbol_table::compile() [clone .part.0]
(cgraphunit.cc:2397)
==30321==by 0xFD1AC7: compile (cgraphunit.cc:2313)
==30321==by 0xFD1AC7: symbol_table::finalize_compilation_unit()
(cgraphunit.cc:2585)
==30321==by 0x150FF61: compile_file() (toplev.cc:474)
==30321==by 0xDE840B: do_compile (toplev.cc:2152)
==30321==by 0xDE840B: toplev::main(int, char**) (toplev.cc:2308)
==30321==by 0xDE9BEA: main (main.cc:39)
==30321==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==30321== 
during GIMPLE pass: bitintlower0
testcase.c: In function 'foo':
testcase.c:2:1: internal compiler error: Segmentation fault
2 | foo (void)
  | ^~~
0x150fa7f crash_signal
/repo/gcc-trunk/gcc/toplev.cc:317
0x271dc7f var_to_partition(_var_map*, tree_node*)
/repo/gcc-trunk/gcc/tree-ssa-live.h:163
0x271dc7f lower_asm
/repo/gcc-trunk/gcc/gimple-lower-bitint.cc:5203
0x271dc7f lower_stmt
/repo/gcc-trunk/gcc/gimple-lower-bitint.cc:5240
0x2720009 gimple_lower_bitint
/repo/gcc-trunk/gcc/gimple-lower-bitint.cc:6564
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
COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-r14-8665-20240131161256-g3fed1609f61-checking-yes-rtl-df-extra-nobootstrap-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/14.0.1/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-r14-8665-20240131161256-g3fed1609f61-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.1 20240131 (experimental) (GCC)

[Bug tree-optimization/113693] New: ICE: in check_loop_closed_ssa_def, at tree-ssa-loop-manip.cc:647 with _BitInt() at -O2 -fdbg-cnt=vect_loop:1

2024-01-31 Thread zsojka at seznam dot cz via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113693

Bug ID: 113693
   Summary: ICE: in check_loop_closed_ssa_def, at
tree-ssa-loop-manip.cc:647 with _BitInt() at -O2
-fdbg-cnt=vect_loop:1
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: tree-optimization
  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

Created attachment 57274
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57274=edit
reduced testcase (from gcc.dg/pr68766.c)

Compiler output:
$ x86_64-pc-linux-gnu-gcc -O2 -fdbg-cnt=vect_loop:1 testcase.c 
***dbgcnt: lower limit 1 reached for vect_loop.***
***dbgcnt: upper limit 1 reached for vect_loop.***
during GIMPLE pass: vect
testcase.c: In function 'fn1':
testcase.c:4:1: internal compiler error: in check_loop_closed_ssa_def, at
tree-ssa-loop-manip.cc:647
4 | fn1(void)
  | ^~~
0x865e0d check_loop_closed_ssa_def
/repo/gcc-trunk/gcc/tree-ssa-loop-manip.cc:647
0x1695c07 check_loop_closed_ssa_bb
/repo/gcc-trunk/gcc/tree-ssa-loop-manip.cc:672
0x1695fa6 verify_loop_closed_ssa(bool, loop*)
/repo/gcc-trunk/gcc/tree-ssa-loop-manip.cc:697
0x1695fa6 verify_loop_closed_ssa(bool, loop*)
/repo/gcc-trunk/gcc/tree-ssa-loop-manip.cc:681
0x13ca929 execute_function_todo
/repo/gcc-trunk/gcc/passes.cc:2106
0x13cad2e execute_todo
/repo/gcc-trunk/gcc/passes.cc:2142
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-r14-8665-20240131161256-g3fed1609f61-checking-yes-rtl-df-extra-nobootstrap-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/14.0.1/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-r14-8665-20240131161256-g3fed1609f61-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.1 20240131 (experimental) (GCC)

[Bug tree-optimization/113692] New: ICE: in lower_stmt, at gimple-lower-bitint.cc:5444 at -O with _BitInt() in a condition

2024-01-31 Thread zsojka at seznam dot cz via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113692

Bug ID: 113692
   Summary: ICE: in lower_stmt, at gimple-lower-bitint.cc:5444 at
-O with _BitInt() in a condition
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: tree-optimization
  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

Created attachment 57273
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57273=edit
reduced testcase

Compiler output:
$ x86_64-pc-linux-gnu-gcc testcase.c -O
during GIMPLE pass: bitintlower
testcase.c: In function 'foo':
testcase.c:4:1: internal compiler error: in lower_stmt, at
gimple-lower-bitint.cc:5444
4 | foo(void)
  | ^~~
0xd8cab5 lower_stmt
/repo/gcc-trunk/gcc/gimple-lower-bitint.cc:5444
0x2720009 gimple_lower_bitint
/repo/gcc-trunk/gcc/gimple-lower-bitint.cc:6564
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-r14-8665-20240131161256-g3fed1609f61-checking-yes-rtl-df-extra-nobootstrap-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/14.0.1/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-r14-8665-20240131161256-g3fed1609f61-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.1 20240131 (experimental) (GCC)

[Bug tree-optimization/113691] New: ICE: in lower_stmt, at gimple-lower-bitint.cc:5444 with function declaration with no parameter specification

2024-01-31 Thread zsojka at seznam dot cz via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113691

Bug ID: 113691
   Summary: ICE: in lower_stmt, at gimple-lower-bitint.cc:5444
with function declaration with no parameter
specification
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
  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

Created attachment 57272
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57272=edit
reduced testcase

I don't know if the code is valid or not, but GCC does not reject the code
unless -pedantic-errors or -std=c23 is passed.

Compiler output:
$ x86_64-pc-linux-gnu-gcc -O testcase.c
during GIMPLE pass: bitintlower
testcase.c: In function 'bar':
testcase.c:3:6: internal compiler error: in lower_stmt, at
gimple-lower-bitint.cc:5444
3 | void bar() { foo(bar_i); }
  |  ^~~
0xd8cab5 lower_stmt
/repo/gcc-trunk/gcc/gimple-lower-bitint.cc:5444
0x2720009 gimple_lower_bitint
/repo/gcc-trunk/gcc/gimple-lower-bitint.cc:6564
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-r14-8665-20240131161256-g3fed1609f61-checking-yes-rtl-df-extra-nobootstrap-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/14.0.1/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-r14-8665-20240131161256-g3fed1609f61-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.1 20240131 (experimental) (GCC)

[Bug rtl-optimization/113690] New: [13/14 Regression] ICE: in as_a, at machmode.h:381 with -O2 -fno-dce -fno-forward-propagate -fno-split-wide-types -funroll-loops

2024-01-31 Thread zsojka at seznam dot cz via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113690

Bug ID: 113690
   Summary: [13/14 Regression] ICE: in as_a, at machmode.h:381
with -O2 -fno-dce -fno-forward-propagate
-fno-split-wide-types -funroll-loops
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: rtl-optimization
  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

Created attachment 57271
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57271=edit
reduced testcase

Compiler output:
$ x86_64-pc-linux-gnu-gcc -O2 -fno-dce -fno-forward-propagate
-fno-split-wide-types -funroll-loops testcase.c
during RTL pass: cse2
testcase.c: In function 'foo':
testcase.c:10:1: internal compiler error: in as_a, at machmode.h:381
   10 | }
  | ^
0x814e46 scalar_int_mode as_a(machine_mode)
/repo/gcc-trunk/gcc/machmode.h:381
0x8196e0 scalar_mode as_a(machine_mode)
/repo/gcc-trunk/gcc/simplify-rtx.cc:3179
0x8196e0 wi::int_traits
>::get_precision(std::pair const&)
/repo/gcc-trunk/gcc/rtl.h:2283
0x8196e0 unsigned int wi::get_precision
>(std::pair const&)
/repo/gcc-trunk/gcc/wide-int.h:2168
0x8196e0 wide_int_ref_storage::wide_int_ref_storage
>(std::pair const&)
/repo/gcc-trunk/gcc/wide-int.h:1089
0x8196e0 generic_wide_int
>::generic_wide_int >(std::pair const&)
/repo/gcc-trunk/gcc/wide-int.h:847
0x8196e0 simplify_context::simplify_binary_operation_1(rtx_code, machine_mode,
rtx_def*, rtx_def*, rtx_def*, rtx_def*)
/repo/gcc-trunk/gcc/simplify-rtx.cc:3338
0x14dd0ad simplify_context::simplify_binary_operation(rtx_code, machine_mode,
rtx_def*, rtx_def*)
/repo/gcc-trunk/gcc/simplify-rtx.cc:2667
0x26c4a74 simplify_binary_operation(rtx_code, machine_mode, rtx_def*, rtx_def*)
/repo/gcc-trunk/gcc/rtl.h:3493
0x26c4a74 fold_rtx
/repo/gcc-trunk/gcc/cse.cc:3719
0x26c5ff2 canonicalize_insn
/repo/gcc-trunk/gcc/cse.cc:4461
0x26c6511 cse_insn
/repo/gcc-trunk/gcc/cse.cc:4544
0x26cc0e3 cse_extended_basic_block
/repo/gcc-trunk/gcc/cse.cc:6574
0x26cc0e3 cse_main
/repo/gcc-trunk/gcc/cse.cc:6719
0x26ccb00 rest_of_handle_cse2
/repo/gcc-trunk/gcc/cse.cc:7617
0x26ccb00 execute
/repo/gcc-trunk/gcc/cse.cc:7672
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-r14-8665-20240131161256-g3fed1609f61-checking-yes-rtl-df-extra-nobootstrap-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/14.0.1/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-r14-8665-20240131161256-g3fed1609f61-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.1 20240131 (experimental) (GCC)

[Bug target/113689] New: wrong code with unused _BitInt() division with -O2 -fprofile -mcmodel=large -mavx

2024-01-31 Thread zsojka at seznam dot cz via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113689

Bug ID: 113689
   Summary: wrong code with unused _BitInt() division with -O2
-fprofile -mcmodel=large -mavx
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: wrong-code
  Severity: normal
  Priority: P3
 Component: target
  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

Created attachment 57270
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57270=edit
reduced testcase

Output:
$ x86_64-pc-linux-gnu-gcc -O2 -fprofile -mcmodel=large -mavx testcase.c
$ ./a.out 
Aborted

"b" (and then "x") seems to be garbage.




$ 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-r14-8665-20240131161256-g3fed1609f61-checking-yes-rtl-df-extra-nobootstrap-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/14.0.1/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-r14-8665-20240131161256-g3fed1609f61-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.1 20240131 (experimental) (GCC)

[Bug tree-optimization/113673] New: [12/13/14 Regression] ICE: verify_flow_info failed: BB 5 cannot throw but has an EH edge with -Os -finstrument-functions -fnon-call-exceptions -ftrapv

2024-01-30 Thread zsojka at seznam dot cz via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113673

Bug ID: 113673
   Summary: [12/13/14 Regression] ICE: verify_flow_info failed: BB
5 cannot throw but has an EH edge with -Os
-finstrument-functions -fnon-call-exceptions -ftrapv
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: tree-optimization
  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

Created attachment 57266
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57266=edit
reduced testcase

Compiler output:
$ x86_64-pc-linux-gnu-gcc -Os -finstrument-functions -fnon-call-exceptions
-ftrapv testcase.c 
testcase.c: In function 'ssl_scan_clienthello_tlsext_limit':
testcase.c:4:1: error: BB 5 cannot throw but has an EH edge
4 | ssl_scan_clienthello_tlsext_limit (unsigned char *data)
  | ^
during GIMPLE pass: bswap
testcase.c:4:1: internal compiler error: verify_flow_info failed
0xf9044e verify_flow_info()
/repo/gcc-trunk/gcc/cfghooks.cc:287
0x13ca947 execute_function_todo
/repo/gcc-trunk/gcc/passes.cc:2100
0x13cae7e execute_todo
/repo/gcc-trunk/gcc/passes.cc:2142
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-r14-8635-20240130094253-g24d5e0bf19f-checking-yes-rtl-df-extra-nobootstrap-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/14.0.1/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-r14-8635-20240130094253-g24d5e0bf19f-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.1 20240130 (experimental) (GCC)

[Bug rtl-optimization/113660] New: ICE: verify_flow_info failed: missing REG_EH_REGION note at the end of bb 2 with -fnon-call-exceptions -fharden-control-flow-redundancy on invalid

2024-01-29 Thread zsojka at seznam dot cz via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113660

Bug ID: 113660
   Summary: ICE: verify_flow_info failed: missing REG_EH_REGION
note at the end of bb 2 with -fnon-call-exceptions
-fharden-control-flow-redundancy on invalid
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: ice-on-invalid-code
  Severity: normal
  Priority: P3
 Component: rtl-optimization
  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

Created attachment 57254
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57254=edit
reduced testcase

Compiler output:
$ x86_64-pc-linux-gnu-gcc -fnon-call-exceptions
-fharden-control-flow-redundancy testcase.c
testcase.c: In function 'foo':
testcase.c:5:3: error: impossible constraint in 'asm'
5 |   __asm__ volatile("" : "=a"(i));
  |   ^~~
testcase.c:6:1: error: missing REG_EH_REGION note at the end of bb 2
6 | }
  | ^
during RTL pass: into_cfglayout
testcase.c:6:1: internal compiler error: verify_flow_info failed
0xf904ae verify_flow_info()
/repo/gcc-trunk/gcc/cfghooks.cc:287
0x268381b checking_verify_flow_info()
/repo/gcc-trunk/gcc/cfghooks.h:214
0x268381b try_optimize_cfg
/repo/gcc-trunk/gcc/cfgcleanup.cc:2980
0x268381b cleanup_cfg(int)
/repo/gcc-trunk/gcc/cfgcleanup.cc:3143
0xfaaf8a execute
/repo/gcc-trunk/gcc/cfgrtl.cc:3713
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-r14-8487-20240129102032-gb338fdbc2b7-checking-yes-rtl-df-extra-nobootstrap-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/14.0.1/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-r14-8487-20240129102032-gb338fdbc2b7-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.1 20240129 (experimental) (GCC)

[Bug tree-optimization/113639] New: ICE: in handle_operand_addr, at gimple-lower-bitint.cc:2265 at -O with _BitInt() in a struct

2024-01-28 Thread zsojka at seznam dot cz via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113639

Bug ID: 113639
   Summary: ICE: in handle_operand_addr, at
gimple-lower-bitint.cc:2265 at -O with _BitInt() in a
struct
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: tree-optimization
  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

Created attachment 57245
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57245=edit
reduced testcase (from gcc.dg/torture/pr57393-1.c)

Compiler output:
$ x86_64-pc-linux-gnu-gcc -O testcase.c 
during GIMPLE pass: bitintlower
testcase.c: In function 'foo':
testcase.c:10:1: internal compiler error: in handle_operand_addr, at
gimple-lower-bitint.cc:2265
   10 | foo (struct S s)
  | ^~~
0xd84efa handle_operand_addr
/repo/gcc-trunk/gcc/gimple-lower-bitint.cc:2265
0x2738496 handle_operand_addr
/repo/gcc-trunk/gcc/gimple-lower-bitint.cc:2170
0x273878f lower_muldiv_stmt
/repo/gcc-trunk/gcc/gimple-lower-bitint.cc:3400
0x274b423 gimple_lower_bitint
/repo/gcc-trunk/gcc/gimple-lower-bitint.cc:6562
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-r14-8474-20240128132141-g46df13697a4-checking-yes-rtl-df-extra-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/14.0.1/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
--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-r14-8474-20240128132141-g46df13697a4-checking-yes-rtl-df-extra-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.1 20240128 (experimental) (GCC)

[Bug debug/113637] New: ICE: in as_a, at machmode.h:381 with extern function declaration and _BitInt() used as VLA size

2024-01-28 Thread zsojka at seznam dot cz via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113637

Bug ID: 113637
   Summary: ICE: in as_a, at machmode.h:381 with extern function
declaration and _BitInt() used as VLA size
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: debug
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
CC: jakub at gcc dot gnu.org
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu

Created attachment 57244
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57244=edit
reduced testcase (from gcc.dg/Wvla-parameter-4.c)

Compiler output:
$ x86_64-pc-linux-gnu-gcc testcase.c -g
testcase.c: In function 'foo':
testcase.c:5:1: internal compiler error: in as_a, at machmode.h:381
5 | }
  | ^
0x7418a8 scalar_int_mode as_a(machine_mode)
/repo/gcc-trunk/gcc/machmode.h:381
0x748787 scalar_int_mode as_a(machine_mode)
/repo/gcc-trunk/gcc/tree.h:3813
0x748787 loc_list_from_tree_1
/repo/gcc-trunk/gcc/dwarf2out.cc:19030
0x1058d7b loc_list_from_tree_1
/repo/gcc-trunk/gcc/dwarf2out.cc:19443
0x1066138 loc_list_from_tree
/repo/gcc-trunk/gcc/dwarf2out.cc:19737
0x1066138 add_scalar_info
/repo/gcc-trunk/gcc/dwarf2out.cc:21528
0x10671e1 add_subscript_info
/repo/gcc-trunk/gcc/dwarf2out.cc:21767
0x1053f12 gen_array_type_die
/repo/gcc-trunk/gcc/dwarf2out.cc:22641
0x1053f12 gen_type_die_with_usage
/repo/gcc-trunk/gcc/dwarf2out.cc:26433
0x10557fd gen_type_die
/repo/gcc-trunk/gcc/dwarf2out.cc:26496
0x10557fd modified_type_die
/repo/gcc-trunk/gcc/dwarf2out.cc:13924
0x1055dc5 modified_type_die
/repo/gcc-trunk/gcc/dwarf2out.cc:14068
0x10577a6 add_type_attribute
/repo/gcc-trunk/gcc/dwarf2out.cc:22387
0x1068fc1 gen_formal_parameter_die
/repo/gcc-trunk/gcc/dwarf2out.cc:23096
0x10693ce gen_formal_types_die
/repo/gcc-trunk/gcc/dwarf2out.cc:23191
0x104ce8b gen_subprogram_die
/repo/gcc-trunk/gcc/dwarf2out.cc:24063
0x10508ca gen_decl_die
/repo/gcc-trunk/gcc/dwarf2out.cc:27113
0x106e6cf decls_for_scope
/repo/gcc-trunk/gcc/dwarf2out.cc:26676
0x104beee gen_subprogram_die
/repo/gcc-trunk/gcc/dwarf2out.cc:24174
0x10508ca gen_decl_die
/repo/gcc-trunk/gcc/dwarf2out.cc:27113
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-r14-8474-20240128132141-g46df13697a4-checking-yes-rtl-df-extra-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/14.0.1/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
--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-r14-8474-20240128132141-g46df13697a4-checking-yes-rtl-df-extra-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.1 20240128 (experimental) (GCC)

[Bug libgcc/113604] runtime SIGFPE with _BitInt() division

2024-01-27 Thread zsojka at seznam dot cz via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113604

Zdenek Sojka  changed:

   What|Removed |Added

  Attachment #57239|0   |1
is obsolete||

--- Comment #10 from Zdenek Sojka  ---
Created attachment 57242
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57242=edit
testcase5 (not beautified)

[Bug libgcc/113604] runtime SIGFPE with _BitInt() division

2024-01-27 Thread zsojka at seznam dot cz via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113604

--- Comment #9 from Zdenek Sojka  ---
Created attachment 57241
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57241=edit
testcase4 (not beautified)

[Bug libgcc/113604] runtime SIGFPE with _BitInt() division

2024-01-27 Thread zsojka at seznam dot cz via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113604

--- Comment #8 from Zdenek Sojka  ---
Created attachment 57240
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57240=edit
testcase3 (not beautified)

[Bug libgcc/113604] runtime SIGFPE with _BitInt() division

2024-01-27 Thread zsojka at seznam dot cz via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113604

--- Comment #7 from Zdenek Sojka  ---
Created attachment 57239
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57239=edit
testcase2 (not beautified)

[Bug libgcc/113604] runtime SIGFPE with _BitInt() division

2024-01-27 Thread zsojka at seznam dot cz via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113604

--- Comment #5 from Zdenek Sojka  ---
(In reply to Jakub Jelinek from comment #4)
> Created attachment 57221 [details]
> gcc14-pr113604.patch
> 
> Untested fix.  I've tried to explain what's going on in the large comment.

I can confirm this fixes the testcase and other 3 testcases I have locally.

[Bug tree-optimization/113614] New: wrong code with _BitInt() division at -O1

2024-01-25 Thread zsojka at seznam dot cz via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113614

Bug ID: 113614
   Summary: wrong code with _BitInt() division at -O1
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: wrong-code
  Severity: normal
  Priority: P3
 Component: tree-optimization
  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

Created attachment 57220
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57220=edit
reduced testcase

Output:
$ x86_64-pc-linux-gnu-gcc -O1 testcase.c
$ ./a.out
Aborted

The wrong result is -39, as if the division were with signed types.

$ 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-r14-8419-20240125172014-gc6c2a1d79eb-checking-yes-rtl-df-extra-nobootstrap-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/14.0.1/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-r14-8419-20240125172014-gc6c2a1d79eb-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.1 20240125 (experimental) (GCC)

[Bug c++/113612] New: ICE: SIGSEGV in get_template_info (pt.cc:378) or tree_check (tree.h:3611) with invalid -fpreprocessed

2024-01-25 Thread zsojka at seznam dot cz via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113612

Bug ID: 113612
   Summary: ICE: SIGSEGV in get_template_info (pt.cc:378) or
tree_check (tree.h:3611) with invalid -fpreprocessed
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: ice-on-invalid-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

Created attachment 57219
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57219=edit
reduced testcase

Compiler output:
$ x86_64-pc-linux-gnu-gcc testcase.C -c
$ x86_64-pc-linux-gnu-gcc -fpreprocessed testcase.C -wrapper valgrind,-q
testcase.C:1:1: error: stray '#' in program
1 | #if defined0
  | ^
testcase.C:6:1: error: stray '#' in program
6 | #endif
  | ^
testcase.C:1:2: error: expected unqualified-id before 'if'
1 | #if defined0
  |  ^~
==1836== Invalid read of size 2
==1836==at 0x10B82AE: get_template_info(tree_node const*) (pt.cc:378)
==1836==by 0x10D80F7: get_partial_spec_bindings(tree_node*, tree_node*,
tree_node*) (pt.cc:25875)
==1836==by 0x10D890D: most_specialized_partial_spec(tree_node*, int, bool)
(pt.cc:26190)
==1836==by 0x10D975F: instantiate_template(tree_node*, tree_node*, int)
(pt.cc:22074)
==1836==by 0x113558A: finish_id_expression_1(tree_node*, tree_node*,
tree_node*, cp_id_kind*, bool, bool, bool*, bool, bool, bool, bool, char
const**, unsigned int) (semantics.cc:4392)
==1836==by 0x1135F66: finish_id_expression(tree_node*, tree_node*,
tree_node*, cp_id_kind*, bool, bool, bool*, bool, bool, bool, bool, char
const**, unsigned int) (semantics.cc:4573)
==1836==by 0x107D2DA: cp_parser_primary_expression(cp_parser*, bool, bool,
bool, bool, cp_id_kind*) (parser.cc:6300)
==1836==by 0x108A225: cp_parser_postfix_expression(cp_parser*, bool, bool,
bool, bool, cp_id_kind*) (parser.cc:7924)
==1836==by 0x106805C: cp_parser_binary_expression(cp_parser*, bool, bool,
bool, cp_parser_prec, cp_id_kind*) (parser.cc:10383)
==1836==by 0x1068D62: cp_parser_assignment_expression(cp_parser*,
cp_id_kind*, bool, bool) (parser.cc:10727)
==1836==by 0x1069E85: cp_parser_constant_expression(cp_parser*, int, bool*,
bool) (parser.cc:11017)
==1836==by 0x106AE16: cp_parser_initializer_clause(cp_parser*, bool*)
(parser.cc:26126)
==1836==  Address 0x53dce10 is in a rw- anonymous segment
==1836== 
==1836== Invalid read of size 2
==1836==at 0x10D80F8: tree_check (tree.h:3611)
==1836==by 0x10D80F8: get_partial_spec_bindings(tree_node*, tree_node*,
tree_node*) (pt.cc:25875)
==1836==by 0x10D890D: most_specialized_partial_spec(tree_node*, int, bool)
(pt.cc:26190)
==1836==by 0x10D975F: instantiate_template(tree_node*, tree_node*, int)
(pt.cc:22074)
==1836==by 0x113558A: finish_id_expression_1(tree_node*, tree_node*,
tree_node*, cp_id_kind*, bool, bool, bool*, bool, bool, bool, bool, char
const**, unsigned int) (semantics.cc:4392)
==1836==by 0x1135F66: finish_id_expression(tree_node*, tree_node*,
tree_node*, cp_id_kind*, bool, bool, bool*, bool, bool, bool, bool, char
const**, unsigned int) (semantics.cc:4573)
==1836==by 0x107D2DA: cp_parser_primary_expression(cp_parser*, bool, bool,
bool, bool, cp_id_kind*) (parser.cc:6300)
==1836==by 0x108A225: cp_parser_postfix_expression(cp_parser*, bool, bool,
bool, bool, cp_id_kind*) (parser.cc:7924)
==1836==by 0x106805C: cp_parser_binary_expression(cp_parser*, bool, bool,
bool, cp_parser_prec, cp_id_kind*) (parser.cc:10383)
==1836==by 0x1068D62: cp_parser_assignment_expression(cp_parser*,
cp_id_kind*, bool, bool) (parser.cc:10727)
==1836==by 0x1069E85: cp_parser_constant_expression(cp_parser*, int, bool*,
bool) (parser.cc:11017)
==1836==by 0x106AE16: cp_parser_initializer_clause(cp_parser*, bool*)
(parser.cc:26126)
==1836==by 0x106FA94: cp_parser_initializer(cp_parser*, bool*, bool*, bool)
(parser.cc:26065)
==1836==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==1836== 
testcase.C:5:35: internal compiler error: Segmentation fault
5 | template  T *t = t
  |   ^~
0x18044bf crash_signal
/repo/gcc-trunk/gcc/toplev.cc:317
0x10d80f8 tree_check(tree_node*, char const*, int, char const*, tree_code)
/repo/gcc-trunk/gcc/tree.h:3611
0x10d80f8 get_partial_spec_bindings
/repo/gcc-trunk/gcc/cp/pt.cc:25875
0x10d890d most_specialized_partial_spec(tree_node*, int, bool)
/repo/gcc-trunk/gcc/cp/pt.cc:26190
...

$ 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-r14-8419-20240125172014-gc6c2a1d79eb-checking-yes-rtl-df-extra-nobootstrap-amd64/bin/../libexec/gcc/x86

[Bug libgcc/113604] New: runtime SIGFPE with _BitInt() division

2024-01-25 Thread zsojka at seznam dot cz via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113604

Bug ID: 113604
   Summary: runtime SIGFPE with _BitInt() division
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: wrong-code
  Severity: normal
  Priority: P3
 Component: libgcc
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
CC: jakub at gcc dot gnu.org
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu

Created attachment 57217
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57217=edit
reduced testcase

Output:
$ x86_64-pc-linux-gnu-gcc testcase.c
$ valgrind -q ./a.out 
==6365== 
==6365== Process terminating with default action of signal 8 (SIGFPE)
==6365==  Integer divide by zero at address 0x1002C76A28
==6365==at 0x4016DF: __divmodbitint4 (libgcc2.c:1868)
==6365==by 0x4011CF: foo (in a.out)
==6365==by 0x401254: main (in a.out)
Floating point exception

$ 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-r14-8419-20240125172014-gc6c2a1d79eb-checking-yes-rtl-df-extra-nobootstrap-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/14.0.1/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-r14-8419-20240125172014-gc6c2a1d79eb-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.1 20240125 (experimental) (GCC)

[Bug tree-optimization/113602] New: ICE: in vn_reference_maybe_forwprop_address, at tree-ssa-sccvn.cc:1426 with invalid _BitInt() register asm with -O2 -fno-tree-loop-optimize

2024-01-25 Thread zsojka at seznam dot cz via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113602

Bug ID: 113602
   Summary: ICE: in vn_reference_maybe_forwprop_address, at
tree-ssa-sccvn.cc:1426 with invalid _BitInt() register
asm with -O2 -fno-tree-loop-optimize
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: ice-on-invalid-code
  Severity: normal
  Priority: P3
 Component: tree-optimization
  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

Created attachment 57216
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57216=edit
reduced testcase (from gcc.dg/torture/pr60606-1.c)

Compiler output:
$ x86_64-pc-linux-gnu-gcc -O2 -fno-tree-loop-optimize testcase.c 
during GIMPLE pass: fre
testcase.c: In function 'f':
testcase.c:2:1: internal compiler error: in
vn_reference_maybe_forwprop_address, at tree-ssa-sccvn.cc:1426
2 | f(void) {
  | ^
0x875c2c vn_reference_maybe_forwprop_address
/repo/gcc-trunk/gcc/tree-ssa-sccvn.cc:1426
0x17176d8 valueize_refs_1
/repo/gcc-trunk/gcc/tree-ssa-sccvn.cc:1718
0x171c008 valueize_shared_reference_ops_from_ref
/repo/gcc-trunk/gcc/tree-ssa-sccvn.cc:1763
0x171c008 valueize_shared_reference_ops_from_ref
/repo/gcc-trunk/gcc/tree-ssa-sccvn.cc:1757
0x171c008 vn_reference_lookup(tree_node*, tree_node*, vn_lookup_kind,
vn_reference_s**, bool, tree_node**, tree_node*, bool)
/repo/gcc-trunk/gcc/tree-ssa-sccvn.cc:3963
0x1720437 visit_reference_op_load
/repo/gcc-trunk/gcc/tree-ssa-sccvn.cc:5752
0x1720437 visit_stmt
/repo/gcc-trunk/gcc/tree-ssa-sccvn.cc:6273
0x1720abb process_bb
/repo/gcc-trunk/gcc/tree-ssa-sccvn.cc:8037
0x1722496 do_rpo_vn_1
/repo/gcc-trunk/gcc/tree-ssa-sccvn.cc:8638
0x172400b execute
/repo/gcc-trunk/gcc/tree-ssa-sccvn.cc:8799
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-r14-8419-20240125172014-gc6c2a1d79eb-checking-yes-rtl-df-extra-nobootstrap-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/14.0.1/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-r14-8419-20240125172014-gc6c2a1d79eb-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.1 20240125 (experimental) (GCC)

[Bug target/113586] New: ICE: RTL check: expected code 'const_int', have 'reg' in rtx_to_poly_int64, at rtl.h:2398 with -march=rv32gcv -mabi=ilp32e

2024-01-24 Thread zsojka at seznam dot cz via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113586

Bug ID: 113586
   Summary: ICE: RTL check: expected code 'const_int', have 'reg'
in rtx_to_poly_int64, at rtl.h:2398 with
-march=rv32gcv -mabi=ilp32e
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: riscv64-unknown-linux-gnu

Created attachment 57208
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57208=edit
reduced testcase (from gcc.target/riscv/rvv/vsetvl/imm_switch-1.c)

I have a strong feeling of reporting this before, but I can't find the original
PR. Sorry for the dup, if I searched poorly.

This probably needs RTL checking enabled.

Compiler output:
$ riscv64-unknown-linux-gnu-gcc -march=rv32gcv -mabi=ilp32e testcase.c 
during RTL pass: expand
testcase.c: In function 'f_n':
testcase.c:2:6: internal compiler error: RTL check: expected code 'const_int',
have 'reg' in rtx_to_poly_int64, at rtl.h:2398
2 | void f_n() {
  |  ^~~
0xad3dd3 rtl_check_failed_code1(rtx_def const*, rtx_code, char const*, int,
char const*)
/repo/gcc-trunk/gcc/rtl.cc:770
0x9fdf35 rtx_to_poly_int64(rtx_def const*)
/repo/gcc-trunk/gcc/rtl.h:2398
0x9fdf35 rtx_to_poly_int64(rtx_def const*)
/repo/gcc-trunk/gcc/rtl.h:2389
0x9fdf35 expand_stack_vars
/repo/gcc-trunk/gcc/cfgexpand.cc:1328
0x1184673 expand_used_vars
/repo/gcc-trunk/gcc/cfgexpand.cc:2417
0x1188b01 execute
/repo/gcc-trunk/gcc/cfgexpand.cc:6708
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.

$ riscv64-unknown-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=/repo/gcc-trunk/binary-latest-riscv64/bin/riscv64-unknown-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-r14-8383-20240124073818-g59004711660-checking-yes-rtl-df-extra-riscv64/bin/../libexec/gcc/riscv64-unknown-linux-gnu/14.0.1/lto-wrapper
Target: riscv64-unknown-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--with-cloog --with-ppl --with-isl --with-isa-spec=2.2
--with-sysroot=/usr/riscv64-unknown-linux-gnu --build=x86_64-pc-linux-gnu
--host=x86_64-pc-linux-gnu --target=riscv64-unknown-linux-gnu
--with-ld=/usr/bin/riscv64-unknown-linux-gnu-ld
--with-as=/usr/bin/riscv64-unknown-linux-gnu-as --disable-multilib
--disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r14-8383-20240124073818-g59004711660-checking-yes-rtl-df-extra-riscv64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.1 20240124 (experimental) (GCC)

[Bug tree-optimization/113574] New: wrong code with shift and _BitInt(1) at any opt level

2024-01-23 Thread zsojka at seznam dot cz via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113574

Bug ID: 113574
   Summary: wrong code with shift and _BitInt(1) at any opt level
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: wrong-code
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
CC: jakub at gcc dot gnu.org
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu

Created attachment 57200
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57200=edit
reduced testcase

Compiler output:
$ x86_64-pc-linux-gnu-gcc testcase.c && ./a.out 
Aborted

-fsanitize=undefined fixes the problem:
$ x86_64-pc-linux-gnu-gcc testcase.c -fsanitize=undefined && ./a.out
(no output)

At the ASM level, at -O1:
...
foo:
# testcase.c:7:   ub1 += (ub16 << 2) | ub8;
or  dil, BYTE PTR ub8[rip]  # _1, ub8
and edi, 1  # _4,

it seems the shift is removed; changing the type of ub1 to "unsigned
_BitInt(2)" fixes this.

$ 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-r14-8373-20240123195900-gdbc5f1f523b-checking-yes-rtl-df-extra-nobootstrap-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/14.0.1/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-r14-8373-20240123195900-gdbc5f1f523b-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.1 20240123 (experimental) (GCC)

[Bug tree-optimization/113568] New: ICE: definition in block 13 does not dominate use in block 15 with _BitInt() at -O1

2024-01-23 Thread zsojka at seznam dot cz via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113568

Bug ID: 113568
   Summary: ICE: definition in block 13 does not dominate use in
block 15 with _BitInt() at -O1
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
CC: jakub at gcc dot gnu.org
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu

Created attachment 57197
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57197=edit
reduced testcase

Compiler output:
$ x86_64-pc-linux-gnu-gcc -O testcase.c
testcase.c: In function 'foo':
testcase.c:5:1: error: definition in block 13 does not dominate use in block 15
5 | foo(void)
  | ^~~
for SSA_NAME: _20 in statement:
_19 = PHI <0(8), _20(15)>
PHI argument
_20
for PHI node
_19 = PHI <0(8), _20(15)>
during GIMPLE pass: bitintlower
testcase.c:5:1: internal compiler error: verify_ssa failed
0x178bed0 verify_ssa(bool, bool)
/repo/gcc-trunk/gcc/tree-ssa.cc:1203
0x13ce6c5 execute_function_todo
/repo/gcc-trunk/gcc/passes.cc:2095
0x13ceb2e execute_todo
/repo/gcc-trunk/gcc/passes.cc:2142
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-r14-8373-20240123195900-gdbc5f1f523b-checking-yes-rtl-df-extra-nobootstrap-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/14.0.1/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-r14-8373-20240123195900-gdbc5f1f523b-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.1 20240123 (experimental) (GCC)

[Bug tree-optimization/113567] New: ICE: SSA corruption: Unable to coalesce ssa_names 1 and 3 which are marked as MUST COALESCE. with _BitInt() and computed goto

2024-01-23 Thread zsojka at seznam dot cz via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113567

Bug ID: 113567
   Summary: ICE: SSA corruption: Unable to coalesce ssa_names 1
and 3 which are marked as MUST COALESCE. with
_BitInt() and computed goto
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
CC: jakub at gcc dot gnu.org
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu

Created attachment 57196
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57196=edit
reduced testcase

Compiler output:
$ x86_64-pc-linux-gnu-gcc testcase.c 

Unable to coalesce ssa_names 1 and 3 which are marked as MUST COALESCE.
a_1(ab) and  a_3(ab)
during GIMPLE pass: bitintlower0
testcase.c: In function 'foo':
testcase.c:2:1: internal compiler error: SSA corruption
2 | foo(_BitInt(953) a)
  | ^~~
0x163e4dd fail_abnormal_edge_coalesce
/repo/gcc-trunk/gcc/tree-ssa-coalesce.cc:1012
0x163e4dd coalesce_partitions
/repo/gcc-trunk/gcc/tree-ssa-coalesce.cc:1444
0x163e4dd coalesce_ssa_name(_var_map*)
/repo/gcc-trunk/gcc/tree-ssa-coalesce.cc:1898
0x271baf3 gimple_lower_bitint
/repo/gcc-trunk/gcc/gimple-lower-bitint.cc:6319
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-r14-8373-20240123195900-gdbc5f1f523b-checking-yes-rtl-df-extra-nobootstrap-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/14.0.1/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-r14-8373-20240123195900-gdbc5f1f523b-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.1 20240123 (experimental) (GCC)

[Bug c/113492] ICE: in composite_type_internal, at c/c-typeck.cc:557 with -std=c2x -funsigned-bitfields since r14-6808

2024-01-20 Thread zsojka at seznam dot cz via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113492

Zdenek Sojka  changed:

   What|Removed |Added

Summary|[14 Regression] ICE: in |ICE: in
   |composite_type_internal, at |composite_type_internal, at
   |c/c-typeck.cc:557 with  |c/c-typeck.cc:557 with
   |-std=c2x|-std=c2x
   |-funsigned-bitfields since  |-funsigned-bitfields since
   |r14-6808|r14-6808

--- Comment #7 from Zdenek Sojka  ---
I am sorry for any confusion. I was not aware of the change between gcc-13 and
gcc-14 that this code should be accepted now.

[Bug c/113492] [14 Regression] ICE: in composite_type_internal, at c/c-typeck.cc:557 with -std=c2x -funsigned-bitfields since r14-6808

2024-01-19 Thread zsojka at seznam dot cz via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113492

--- Comment #3 from Zdenek Sojka  ---
(In reply to uecker from comment #2)
> 
> I agree that "int:3" with -funsigned-bitfields should produce a type which
> is compatible to one  with "unsigned:3" and that forming a composite type
> has to work.
> 
> I am not entirely sure this should be considered a regression as this C23
> feature did not exist before (but was rejected and did not ICE).  Anyway, I
> will look at this and post a patch. Thanks for reporting.

Thank you for having a look.

The "regression" part is for the ICEing.

[Bug debug/113519] New: ICE: in replace_child, at dwarf2out.cc:5704 with -g -mbig-endian -fsso-struct=little-endian -fdebug-types-section

2024-01-19 Thread zsojka at seznam dot cz via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113519

Bug ID: 113519
   Summary: ICE: in replace_child, at dwarf2out.cc:5704 with -g
-mbig-endian -fsso-struct=little-endian
-fdebug-types-section
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: debug
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: riscv64-unknown-linux-gnu

Created attachment 57171
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57171=edit
reduced testcase

Compiler output:
$ riscv64-unknown-linux-gnu-gcc -g -mbig-endian -fsso-struct=little-endian
-fdebug-types-section testcase.c 
testcase.c:4:1: internal compiler error: in replace_child, at dwarf2out.cc:5704
4 | } s;
  | ^
0xa15089 replace_child
/repo/gcc-trunk/gcc/dwarf2out.cc:5704
0x123fd37 remove_child_or_replace_with_skeleton
/repo/gcc-trunk/gcc/dwarf2out.cc:8625
0x123fd37 break_out_comdat_types
/repo/gcc-trunk/gcc/dwarf2out.cc:8772
0x126da3d dwarf2out_early_finish
/repo/gcc-trunk/gcc/dwarf2out.cc:33096
0x11cb11f symbol_table::finalize_compilation_unit()
/repo/gcc-trunk/gcc/cgraphunit.cc:2579
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.

$ riscv64-unknown-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=/repo/gcc-trunk/binary-latest-riscv64/bin/riscv64-unknown-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-r14-8284-20240119180625-g54519030b05-checking-yes-rtl-df-extra-riscv64/bin/../libexec/gcc/riscv64-unknown-linux-gnu/14.0.1/lto-wrapper
Target: riscv64-unknown-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--with-cloog --with-ppl --with-isl --with-isa-spec=2.2
--with-sysroot=/usr/riscv64-unknown-linux-gnu --build=x86_64-pc-linux-gnu
--host=x86_64-pc-linux-gnu --target=riscv64-unknown-linux-gnu
--with-ld=/usr/bin/riscv64-unknown-linux-gnu-ld
--with-as=/usr/bin/riscv64-unknown-linux-gnu-as --disable-multilib
--disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r14-8284-20240119180625-g54519030b05-checking-yes-rtl-df-extra-riscv64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.1 20240119 (experimental) (GCC)

[Bug tree-optimization/113518] New: ICE: in gimplify_expr, at gimplify.cc:18596 with atomic_fetch_or_explicit() on _BitInt()

2024-01-19 Thread zsojka at seznam dot cz via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113518

Bug ID: 113518
   Summary: ICE: in gimplify_expr, at gimplify.cc:18596 with
atomic_fetch_or_explicit() on _BitInt()
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
CC: jakub at gcc dot gnu.org
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu

Created attachment 57170
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57170=edit
reduced testcase (from gcc.target/i386/pr102566-2.c)

Compiler output:
$ x86_64-pc-linux-gnu-gcc testcase.c
In file included from testcase.c:1:
testcase.c: In function 'foo':
testcase.c:8:34: internal compiler error: in gimplify_expr, at
gimplify.cc:18596
8 |   atomic_fetch_or_explicit(, 1 << 31, memory_order_relaxed);
  |  ^
0x78cb81 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
/repo/gcc-trunk/gcc/gimplify.cc:18596
0x11a66a6 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
/repo/gcc-trunk/gcc/gimplify.cc:18085
0x11a62ef gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
/repo/gcc-trunk/gcc/gimplify.cc:18568
0x11bcae5 gimplify_modify_expr
/repo/gcc-trunk/gcc/gimplify.cc:6405
0x11a6489 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
/repo/gcc-trunk/gcc/gimplify.cc:17780
0x11b4b29 gimplify_target_expr
/repo/gcc-trunk/gcc/gimplify.cc:7399
0x11a66e0 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
/repo/gcc-trunk/gcc/gimplify.cc:18177
0x11a8b76 gimplify_stmt(tree_node**, gimple**)
/repo/gcc-trunk/gcc/gimplify.cc:7480
0x11a74e0 gimplify_statement_list
/repo/gcc-trunk/gcc/gimplify.cc:
0x11a74e0 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
/repo/gcc-trunk/gcc/gimplify.cc:18225
0x11b4ced gimplify_target_expr
/repo/gcc-trunk/gcc/gimplify.cc:7393
0x11a66e0 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
/repo/gcc-trunk/gcc/gimplify.cc:18177
0x11a8b76 gimplify_stmt(tree_node**, gimple**)
/repo/gcc-trunk/gcc/gimplify.cc:7480
0x11a9c79 gimplify_bind_expr
/repo/gcc-trunk/gcc/gimplify.cc:1614
0x11a71f7 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
/repo/gcc-trunk/gcc/gimplify.cc:17981
0x11bde24 gimplify_stmt(tree_node**, gimple**)
/repo/gcc-trunk/gcc/gimplify.cc:7480
0x11bde24 gimplify_body(tree_node*, bool)
/repo/gcc-trunk/gcc/gimplify.cc:19047
0x11be24a gimplify_function_tree(tree_node*)
/repo/gcc-trunk/gcc/gimplify.cc:19246
0xfcd037 cgraph_node::analyze()
/repo/gcc-trunk/gcc/cgraphunit.cc:685
0xfcf957 analyze_functions
/repo/gcc-trunk/gcc/cgraphunit.cc:1248
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-r14-8284-20240119180625-g54519030b05-checking-yes-rtl-df-extra-nobootstrap-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/14.0.1/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-r14-8284-20240119180625-g54519030b05-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.1 20240119 (experimental) (GCC)

[Bug analyzer/113509] New: ICE: SIGSEGV in c_tree_printer (c-objc-common.cc:341) with -fanalyzer -fanalyzer-verbose-state-changes

2024-01-19 Thread zsojka at seznam dot cz via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113509

Bug ID: 113509
   Summary: ICE: SIGSEGV in c_tree_printer (c-objc-common.cc:341)
with -fanalyzer -fanalyzer-verbose-state-changes
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: analyzer
  Assignee: dmalcolm 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

Created attachment 57165
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57165=edit
auto-reduced testcase

Compiler output:
$ x86_64-pc-linux-gnu-gcc -fanalyzer -fanalyzer-verbose-state-changes
cryptlib.i -wrapper valgrind,-q
==26950== Invalid read of size 2
==26950==at 0xE46470: c_tree_printer(pretty_printer*, text_info*, char
const*, int, bool, bool, bool, bool*, char const**) (c-objc-common.cc:341)
==26950==by 0x29E8159: pp_format(pretty_printer*, text_info*, urlifier
const*) (pretty-print.cc:1704)
==26950==by 0x290686B: make_label_text(bool, char const*, ...)
(analyzer.cc:494)
==26950==by 0x291319E: ana::state_change_event::get_desc(bool) const
(checker-event.cc:464)
==26950==by 0x2911478:
ana::checker_event::prepare_for_emission(ana::checker_path*,
ana::pending_diagnostic*, diagnostic_event_id_t) (checker-event.cc:230)
==26950==by 0x29300F3: prepare_for_emission (checker-path.h:108)
==26950==by 0x29300F3:
ana::diagnostic_manager::emit_saved_diagnostic(ana::exploded_graph const&,
ana::saved_diagnostic&) (diagnostic-manager.cc:1601)
==26950==by 0x2933FC6:
ana::dedupe_winners::emit_best(ana::diagnostic_manager*, ana::exploded_graph
const&) (diagnostic-manager.cc:1472)
==26950==by 0x2930733:
ana::diagnostic_manager::emit_saved_diagnostics(ana::exploded_graph const&)
(diagnostic-manager.cc:1524)
==26950==by 0x1911447: ana::impl_run_checkers(ana::logger*)
(engine.cc:6226)
==26950==by 0x1912326: ana::run_checkers() (engine.cc:6300)
==26950==by 0x1900F98: (anonymous
namespace)::pass_analyzer::execute(function*) (analyzer-pass.cc:87)
==26950==by 0x13CC0EA: execute_one_pass(opt_pass*) (passes.cc:2646)
==26950==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==26950== 
during IPA pass: analyzer
cryptlib.i:4:1: internal compiler error: Segmentation fault
4 | }
  | ^
0x150de9f crash_signal
/repo/gcc-trunk/gcc/toplev.cc:317
0xe46470 c_tree_printer
/repo/gcc-trunk/gcc/c/c-objc-common.cc:341
0x29e8159 pp_format(pretty_printer*, text_info*, urlifier const*)
/repo/gcc-trunk/gcc/pretty-print.cc:1704
0x290686b make_label_text(bool, char const*, ...)
/repo/gcc-trunk/gcc/analyzer/analyzer.cc:494
0x291319e ana::state_change_event::get_desc(bool) const
/repo/gcc-trunk/gcc/analyzer/checker-event.cc:464
0x2911478 ana::checker_event::prepare_for_emission(ana::checker_path*,
ana::pending_diagnostic*, diagnostic_event_id_t)
/repo/gcc-trunk/gcc/analyzer/checker-event.cc:230
0x29300f3 ana::checker_path::prepare_for_emission(ana::pending_diagnostic*)
/repo/gcc-trunk/gcc/analyzer/checker-path.h:108
0x29300f3 ana::diagnostic_manager::emit_saved_diagnostic(ana::exploded_graph
const&, ana::saved_diagnostic&)
/repo/gcc-trunk/gcc/analyzer/diagnostic-manager.cc:1601
0x2933fc6 ana::dedupe_winners::emit_best(ana::diagnostic_manager*,
ana::exploded_graph const&)
/repo/gcc-trunk/gcc/analyzer/diagnostic-manager.cc:1472
0x2930733 ana::diagnostic_manager::emit_saved_diagnostics(ana::exploded_graph
const&)
/repo/gcc-trunk/gcc/analyzer/diagnostic-manager.cc:1524
0x1911447 ana::impl_run_checkers(ana::logger*)
/repo/gcc-trunk/gcc/analyzer/engine.cc:6226
0x1912326 ana::run_checkers()
/repo/gcc-trunk/gcc/analyzer/engine.cc:6300
0x1900f98 execute
/repo/gcc-trunk/gcc/analyzer/analyzer-pass.cc:87
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-r14-8284-20240119180625-g54519030b05-checking-yes-rtl-df-extra-nobootstrap-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/14.0.1/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-tr

[Bug c/112878] ICE: in ctf_add_slice, at ctfc.cc:499 with -std=c23 -gctf1

2024-01-19 Thread zsojka at seznam dot cz via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112878

Zdenek Sojka  changed:

   What|Removed |Added

 CC||jakub at gcc dot gnu.org,
   ||zsojka at seznam dot cz

--- Comment #1 from Zdenek Sojka  ---
Also fails with a union:
$ cat testcase.c 
union {
  _BitInt(448) f2 : 1;
} b;
$ x86_64-pc-linux-gnu-gcc -gbtf testcase.c 
testcase.c:3:1: internal compiler error: in ctf_add_slice, at ctfc.cc:499
3 | } b;
  | ^
0xd60e19 ctf_add_slice(ctf_container*, unsigned int, unsigned long, unsigned
int, unsigned int, die_struct*)
/repo/gcc-trunk/gcc/ctfc.cc:499
0x101d9d0 gen_ctf_sou_type
/repo/gcc-trunk/gcc/dwarf2ctf.cc:617
0x101d177 gen_ctf_type
/repo/gcc-trunk/gcc/dwarf2ctf.cc:892
...

[Bug tree-optimization/113491] ICE: SIGSEGV in make_ssa_name_fn (tree-ssanames.cc:354) at -Os with _BitInt() used as switch control expression

2024-01-19 Thread zsojka at seznam dot cz via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113491

--- Comment #1 from Zdenek Sojka  ---
Created attachment 57162
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57162=edit
shorter testcase (reduced from gcc.dg/torture/pr45830.c)

$ x86_64-pc-linux-gnu-gcc -Os pr45830.i -wrapper valgrind,-q
==7594== Invalid read of size 2
==7594==at 0x177D97A: make_ssa_name_fn(function*, tree_node*, gimple*,
unsigned int) (tree-ssanames.cc:354)
==7594==by 0x1610F62: make_ssa_name (tree-ssanames.h:98)
==7594==by 0x1610F62:
tree_switch_conversion::switch_conversion::build_arrays()
(tree-switch-conversion.cc:727)
==7594==by 0x1611346:
tree_switch_conversion::switch_conversion::expand(gswitch*) [clone .part.0]
(tree-switch-conversion.cc:1067)
==7594==by 0x161140A: expand (tree-switch-conversion.cc:2546)
==7594==by 0x161140A: (anonymous
namespace)::pass_convert_switch::execute(function*)
(tree-switch-conversion.cc:2564)
==7594==by 0x13CC0EA: execute_one_pass(opt_pass*) (passes.cc:2646)
==7594==by 0x13CC9DF: execute_pass_list_1(opt_pass*) (passes.cc:2755)
==7594==by 0x13CC9F1: execute_pass_list_1(opt_pass*) (passes.cc:2756)
==7594==by 0x13CCA18: execute_pass_list(function*, opt_pass*)
(passes.cc:2766)
==7594==by 0x13CD33C: do_per_function_toporder(void (*)(function*, void*),
void*) [clone .part.0] (passes.cc:1773)
==7594==by 0x13CD56E: do_per_function_toporder (passes.cc:1740)
==7594==by 0x13CD56E: execute_ipa_pass_list(opt_pass*) (passes.cc:3100)
==7594==by 0xFCDDE7: ipa_passes (cgraphunit.cc:2211)
==7594==by 0xFCDDE7: symbol_table::compile() [clone .part.0]
(cgraphunit.cc:2332)
==7594==by 0xFD0667: compile (cgraphunit.cc:2312)
==7594==by 0xFD0667: symbol_table::finalize_compilation_unit()
(cgraphunit.cc:2584)
==7594==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==7594== 
during GIMPLE pass: switchconv
pr45830.i: In function 'foo':
pr45830.i:19:1: internal compiler error: Segmentation fault
   19 | }
  | ^
0x150de9f crash_signal
/repo/gcc-trunk/gcc/toplev.cc:317
0x177d97a make_ssa_name_fn(function*, tree_node*, gimple*, unsigned int)
/repo/gcc-trunk/gcc/tree-ssanames.cc:354
0x1610f62 make_ssa_name(tree_node*, gimple*)
/repo/gcc-trunk/gcc/tree-ssanames.h:98
0x1610f62 tree_switch_conversion::switch_conversion::build_arrays()
/repo/gcc-trunk/gcc/tree-switch-conversion.cc:727
0x1611346 tree_switch_conversion::switch_conversion::expand(gswitch*)
/repo/gcc-trunk/gcc/tree-switch-conversion.cc:1067
0x161140a tree_switch_conversion::switch_conversion::expand(gswitch*)
/repo/gcc-trunk/gcc/tree-switch-conversion.cc:2546
0x161140a execute
/repo/gcc-trunk/gcc/tree-switch-conversion.cc:2564
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See  for instructions.

[Bug rtl-optimization/113506] New: ICE: RTL check: expected elt 2 type 'B', have '0' (rtx barrier) in BLOCK_FOR_INSN, at rtl.h:1495 with -Os -fno-tree-coalesce-vars -finline-stringops

2024-01-19 Thread zsojka at seznam dot cz via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113506

Bug ID: 113506
   Summary: ICE: RTL check: expected elt 2 type 'B', have '0' (rtx
barrier) in BLOCK_FOR_INSN, at rtl.h:1495 with -Os
-fno-tree-coalesce-vars -finline-stringops
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: rtl-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: riscv64-unknown-linux-gnu

Created attachment 57161
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57161=edit
reduced testcase (from gcc.dg/torture/pr69886.c)

RTL checking might need to be enabled.

Compiler output:
$ riscv64-unknown-linux-gnu-gcc -Os -fno-tree-coalesce-vars -finline-stringops
testcase.c
during RTL pass: expand
testcase.c: In function 'foo':
testcase.c:12:1: internal compiler error: RTL check: expected elt 2 type 'B',
have '0' (rtx barrier) in BLOCK_FOR_INSN, at rtl.h:1495
   12 | }
  | ^
0xad3d4c rtl_check_failed_type1(rtx_def const*, int, int, char const*, int,
char const*)
/repo/gcc-trunk/gcc/rtl.cc:751
0xa20a79 BLOCK_FOR_INSN(rtx_def*)
/repo/gcc-trunk/gcc/rtl.h:1495
0xa242a6 BLOCK_FOR_INSN(rtx_def*)
/repo/gcc-trunk/gcc/emit-rtl.cc:4384
0xa242a6 set_block_for_insn(rtx_insn*, basic_block_def*)
/repo/gcc-trunk/gcc/rtl.h:1500
0xa242a6 add_insn_before(rtx_insn*, rtx_insn*, basic_block_def*)
/repo/gcc-trunk/gcc/emit-rtl.cc:4379
0x127efd0 emit_pattern_before_noloc
/repo/gcc-trunk/gcc/emit-rtl.cc:4647
0x11a0d04 commit_one_edge_insertion(edge_def*)
/repo/gcc-trunk/gcc/cfgrtl.cc:2071
0x11a6011 commit_edge_insertions()
/repo/gcc-trunk/gcc/cfgrtl.cc:2133
0x11866e0 execute
/repo/gcc-trunk/gcc/cfgexpand.cc:6956
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.

$ riscv64-unknown-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=/repo/gcc-trunk/binary-latest-riscv64/bin/riscv64-unknown-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-r14-8284-20240119180625-g54519030b05-checking-yes-rtl-df-extra-riscv64/bin/../libexec/gcc/riscv64-unknown-linux-gnu/14.0.1/lto-wrapper
Target: riscv64-unknown-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--with-cloog --with-ppl --with-isl --with-isa-spec=2.2
--with-sysroot=/usr/riscv64-unknown-linux-gnu --build=x86_64-pc-linux-gnu
--host=x86_64-pc-linux-gnu --target=riscv64-unknown-linux-gnu
--with-ld=/usr/bin/riscv64-unknown-linux-gnu-ld
--with-as=/usr/bin/riscv64-unknown-linux-gnu-as --disable-multilib
--disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r14-8284-20240119180625-g54519030b05-checking-yes-rtl-df-extra-riscv64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.1 20240119 (experimental) (GCC)

[Bug analyzer/113505] New: ICE: SIGSEGV in tree_class_check (tree.h:3766) with -O -fdump-analyzer -fanalyzer

2024-01-19 Thread zsojka at seznam dot cz via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113505

Bug ID: 113505
   Summary: ICE: SIGSEGV in tree_class_check (tree.h:3766) with -O
-fdump-analyzer -fanalyzer
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: analyzer
  Assignee: dmalcolm 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

Created attachment 57160
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57160=edit
auto-reduced testcase

Compiler output:
$ x86_64-pc-linux-gnu-gcc -O -fdump-analyzer -fanalyzer obj_dat.i -wrapper
valgrind,-q
==17749== Invalid read of size 2
==17749==at 0x15EC8C4: tree_class_check (tree.h:3766)
==17749==by 0x15EC8C4: dump_mem_ref(pretty_printer*, tree_node*, int,
dump_flag) (tree-pretty-print.cc:1870)
==17749==by 0x15E17D4: dump_generic_node(pretty_printer*, tree_node*, int,
dump_flag, bool) (tree-pretty-print.cc:2255)
==17749==by 0x15E12FC: dump_generic_node(pretty_printer*, tree_node*, int,
dump_flag, bool) (tree-pretty-print.cc:3263)
==17749==by 0x15E6B3A: dump_generic_node(pretty_printer*, tree_node*, int,
dump_flag, bool) (tree-pretty-print.cc:3148)
==17749==by 0x15E6B1E: dump_generic_node(pretty_printer*, tree_node*, int,
dump_flag, bool) (tree-pretty-print.cc:3163)
==17749==by 0x19396C9: dump_tree (region-model.cc:95)
==17749==by 0x19396C9: ana::dump_quoted_tree(pretty_printer*, tree_node*)
(region-model.cc:105)
==17749==by 0x192AB36: ana::sm_state_map::print(ana::region_model const*,
bool, bool, pretty_printer*) const (program-state.cc:238)
==17749==by 0x192B0CE: ana::program_state::dump_to_pp(ana::extrinsic_state
const&, bool, bool, pretty_printer*) const (program-state.cc:1000)
==17749==by 0x192B640: ana::program_state::detect_leaks(ana::program_state
const&, ana::program_state const&, ana::svalue const*, ana::extrinsic_state
const&, ana::region_model_context*) (program-state.cc:1492)
==17749==by 0x190DE15:
ana::exploded_graph::process_node(ana::exploded_node*) (engine.cc:4138)
==17749==by 0x190ECBA: ana::exploded_graph::process_worklist()
(engine.cc:3515)
==17749==by 0x1911415: ana::impl_run_checkers(ana::logger*)
(engine.cc:6209)
==17749==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==17749== 
during IPA pass: analyzer
obj_dat.i: In function 'OBJ_create_objects':
obj_dat.i:13:27: internal compiler error: Segmentation fault
   13 | while (__ctype_b_loc()[*l])
  |~~~^~~~
0x150de9f crash_signal
/repo/gcc-trunk/gcc/toplev.cc:317
0x15ec8c4 tree_class_check(tree_node*, tree_code_class, char const*, int, char
const*)
/repo/gcc-trunk/gcc/tree.h:3766
0x15ec8c4 dump_mem_ref
/repo/gcc-trunk/gcc/tree-pretty-print.cc:1870
0x15e17d4 dump_generic_node(pretty_printer*, tree_node*, int, dump_flag, bool)
/repo/gcc-trunk/gcc/tree-pretty-print.cc:2255
0x15e12fc dump_generic_node(pretty_printer*, tree_node*, int, dump_flag, bool)
/repo/gcc-trunk/gcc/tree-pretty-print.cc:3263
0x15e6b3a dump_generic_node(pretty_printer*, tree_node*, int, dump_flag, bool)
/repo/gcc-trunk/gcc/tree-pretty-print.cc:3148
0x15e6b1e dump_generic_node(pretty_printer*, tree_node*, int, dump_flag, bool)
/repo/gcc-trunk/gcc/tree-pretty-print.cc:3163
0x19396c9 ana::dump_tree(pretty_printer*, tree_node*)
/repo/gcc-trunk/gcc/analyzer/region-model.cc:95
0x19396c9 ana::dump_quoted_tree(pretty_printer*, tree_node*)
/repo/gcc-trunk/gcc/analyzer/region-model.cc:105
0x192ab36 ana::sm_state_map::print(ana::region_model const*, bool, bool,
pretty_printer*) const
/repo/gcc-trunk/gcc/analyzer/program-state.cc:238
0x192b0ce ana::program_state::dump_to_pp(ana::extrinsic_state const&, bool,
bool, pretty_printer*) const
/repo/gcc-trunk/gcc/analyzer/program-state.cc:1000
0x192b640 ana::program_state::detect_leaks(ana::program_state const&,
ana::program_state const&, ana::svalue const*, ana::extrinsic_state const&,
ana::region_model_context*)
/repo/gcc-trunk/gcc/analyzer/program-state.cc:1492
0x190de15 ana::exploded_graph::process_node(ana::exploded_node*)
/repo/gcc-trunk/gcc/analyzer/engine.cc:4138
0x190ecba ana::exploded_graph::process_worklist()
/repo/gcc-trunk/gcc/analyzer/engine.cc:3515
0x1911415 ana::impl_run_checkers(ana::logger*)
/repo/gcc-trunk/gcc/analyzer/engine.cc:6209
0x19122db ana::run_checkers()
/repo/gcc-trunk/gcc/analyzer/engine.cc:6300
0x1900f98 execute
/repo/gcc-trunk/gcc/analyzer/analyzer-pass.cc:87
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

[Bug analyzer/113496] New: ICE: in cmp, at analyzer/constraint-manager.cc:782 with -fanalyzer -fdump-analyzer

2024-01-18 Thread zsojka at seznam dot cz via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113496

Bug ID: 113496
   Summary: ICE: in cmp, at analyzer/constraint-manager.cc:782
with -fanalyzer -fdump-analyzer
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: analyzer
  Assignee: dmalcolm 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

Created attachment 57150
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57150=edit
auto-reduced testcase

Compiler output:
$ x86_64-pc-linux-gnu-gcc -fanalyzer -fdump-analyzer u_format_latc.c.i
u_format_latc.c.i: In function
'util_format_colormask_descutil_format_colormask':
u_format_latc.c.i:11:5: warning: infinite loop [CWE-835]
[-Wanalyzer-infinite-loop]
   11 | case UTIL_FORMAT_COLORSPACE_ZS:;
  | ^~~~
  'util_format_colormask_descutil_format_colormask': event 1
|
|   11 | case UTIL_FORMAT_COLORSPACE_ZS:;
|  | ^~~~
|  | |
|  | (1) infinite loop here
|
  'util_format_colormask_descutil_format_colormask': event 2
|
|cc1:
| (2): looping back...
|
  'util_format_colormask_descutil_format_colormask': event 3
|
|   11 | case UTIL_FORMAT_COLORSPACE_ZS:;
|  | ^~~~
|  | |
|  | (3) ...to here
|
during IPA pass: analyzer
At top level:
cc1: internal compiler error: in cmp, at analyzer/constraint-manager.cc:782
0xdd2429 ana::bounded_ranges::cmp(ana::bounded_ranges const*,
ana::bounded_ranges const*)
/repo/gcc-trunk/gcc/analyzer/constraint-manager.cc:782
0xdd2429 ana::bounded_ranges::cmp(ana::bounded_ranges const*,
ana::bounded_ranges const*)
/repo/gcc-trunk/gcc/analyzer/constraint-manager.cc:770
0x29fcbd8 cmp1
/repo/gcc-trunk/gcc/sort.cc:151
0x29fcc31 netsort
/repo/gcc-trunk/gcc/sort.cc:168
0x29fcc31 mergesort
/repo/gcc-trunk/gcc/sort.cc:205
0x29fce7d mergesort
/repo/gcc-trunk/gcc/sort.cc:212
0x29fd22f gcc_qsort(void*, unsigned long, unsigned long, int (*)(void const*,
void const*))
/repo/gcc-trunk/gcc/sort.cc:268
0x291b316 vec::qsort(int
(*)(void const*, void const*))
/repo/gcc-trunk/gcc/vec.h:1217
0x291b316 vec::qsort(int (*)(void
const*, void const*))
/repo/gcc-trunk/gcc/vec.h:2240
0x291b316 ana::bounded_ranges_manager::log_stats(ana::logger*, bool) const
/repo/gcc-trunk/gcc/analyzer/constraint-manager.cc:1040
0x195f957 ana::region_model_manager::log_stats(ana::logger*, bool) const
/repo/gcc-trunk/gcc/analyzer/region-model-manager.cc:1929
0x190fc1f ana::exploded_graph::log_stats() const
/repo/gcc-trunk/gcc/analyzer/engine.cc:4551
0x19113f7 ana::impl_run_checkers(ana::logger*)
/repo/gcc-trunk/gcc/analyzer/engine.cc:6230
0x191227b ana::run_checkers()
/repo/gcc-trunk/gcc/analyzer/engine.cc:6300
0x1900f38 execute
/repo/gcc-trunk/gcc/analyzer/analyzer-pass.cc:87
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-r14-8259-20240118193928-gb6c4fcda7fe-checking-yes-rtl-df-extra-nobootstrap-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/14.0.1/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-r14-8259-20240118193928-gb6c4fcda7fe-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.1 20240118 (experimental) (GCC)

[Bug c/113492] New: [14 Regression] ICE: in composite_type_internal, at c/c-typeck.cc:557 with -std=c2x -funsigned-bitfields

2024-01-18 Thread zsojka at seznam dot cz via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113492

Bug ID: 113492
   Summary: [14 Regression] ICE: in composite_type_internal, at
c/c-typeck.cc:557 with -std=c2x -funsigned-bitfields
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  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

Created attachment 57147
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57147=edit
reduced testcase (from gcc.dg/c23-tag-composite-3.c)

Compiler output:
$ x86_64-pc-linux-gnu-gcc -std=c2x -funsigned-bitfields testcase.c 
testcase.c: In function 'foo':
testcase.c:11:3: internal compiler error: in composite_type_internal, at
c/c-typeck.cc:557
   11 |   1 ? a : c;
  |   ^
0x6eabe7 composite_type_internal(tree_node*, tree_node*, composite_cache*)
/repo/gcc-trunk/gcc/c/c-typeck.cc:557
0xe267e0 composite_type(tree_node*, tree_node*)
/repo/gcc-trunk/gcc/c/c-typeck.cc:748
0xe267e0 build_conditional_expr(unsigned int, tree_node*, bool, tree_node*,
tree_node*, unsigned int, tree_node*, tree_node*, unsigned int)
/repo/gcc-trunk/gcc/c/c-typeck.cc:5733
0xe59a26 c_parser_conditional_expression
/repo/gcc-trunk/gcc/c/c-parser.cc:9238
0xe59d64 c_parser_expr_no_commas
/repo/gcc-trunk/gcc/c/c-parser.cc:9072
0xe5a1c1 c_parser_expression
/repo/gcc-trunk/gcc/c/c-parser.cc:12762
0xe5a697 c_parser_expression_conv
/repo/gcc-trunk/gcc/c/c-parser.cc:12802
0xe7c5ef c_parser_statement_after_labels
/repo/gcc-trunk/gcc/c/c-parser.cc:7761
0xe516c6 c_parser_compound_statement_nostart
/repo/gcc-trunk/gcc/c/c-parser.cc:7248
0xe78d44 c_parser_compound_statement
/repo/gcc-trunk/gcc/c/c-parser.cc:6533
0xe7b058 c_parser_declaration_or_fndef
/repo/gcc-trunk/gcc/c/c-parser.cc:3017
0xe84c9b c_parser_external_declaration
/repo/gcc-trunk/gcc/c/c-parser.cc:2046
0xe85683 c_parser_translation_unit
/repo/gcc-trunk/gcc/c/c-parser.cc:1900
0xe85683 c_parse_file()
/repo/gcc-trunk/gcc/c/c-parser.cc:26815
0xefb1b1 c_common_parse_file()
/repo/gcc-trunk/gcc/c-family/c-opts.cc:1301
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.

I would even say that with -funsigned-bitfields, the code is valid, but I am
not a language lawyer.
gcc-13, or gcc-14 without -std=2x, rejects the code though. On the other hand,
changing the "unsigned" to "signed", makes the code to be accepted, with the
default "signed" bitfields, so "int" and "signed" bitfield types are equal;
maybe my understanding of the "-funsigned-bitfields" as "any plain 'int'
bitfield is 'unsigned'" is incorrect.

$ 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-r14-8251-20240118071416-g48c8d26d771-checking-yes-rtl-df-extra-nobootstrap-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/14.0.1/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-r14-8251-20240118071416-g48c8d26d771-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.1 20240118 (experimental) (GCC)

[Bug tree-optimization/113491] New: ICE: SIGSEGV in make_ssa_name_fn (tree-ssanames.cc:354) at -Os with _BitInt() used as switch control expression

2024-01-18 Thread zsojka at seznam dot cz via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113491

Bug ID: 113491
   Summary: ICE: SIGSEGV in make_ssa_name_fn
(tree-ssanames.cc:354) at -Os with _BitInt() used as
switch control expression
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
CC: jakub at gcc dot gnu.org
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu

Created attachment 57146
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57146=edit
reduced testcase (from gcc.c-torture/compile/pr34093.c -Dint=_BitInt(617) )

Compiler output:
$ x86_64-pc-linux-gnu-gcc -Os testcase.c -wrapper valgrind,-q
==8560== Invalid read of size 2
==8560==at 0x177D8AA: make_ssa_name_fn(function*, tree_node*, gimple*,
unsigned int) (tree-ssanames.cc:354)
==8560==by 0x1610EB2: make_ssa_name (tree-ssanames.h:98)
==8560==by 0x1610EB2:
tree_switch_conversion::switch_conversion::build_arrays()
(tree-switch-conversion.cc:727)
==8560==by 0x1611296:
tree_switch_conversion::switch_conversion::expand(gswitch*) [clone .part.0]
(tree-switch-conversion.cc:1067)
==8560==by 0x161135A: expand (tree-switch-conversion.cc:2546)
==8560==by 0x161135A: (anonymous
namespace)::pass_convert_switch::execute(function*)
(tree-switch-conversion.cc:2564)
==8560==by 0x13CC03A: execute_one_pass(opt_pass*) (passes.cc:2646)
==8560==by 0x13CC92F: execute_pass_list_1(opt_pass*) (passes.cc:2755)
==8560==by 0x13CC941: execute_pass_list_1(opt_pass*) (passes.cc:2756)
==8560==by 0x13CC968: execute_pass_list(function*, opt_pass*)
(passes.cc:2766)
==8560==by 0x13CD28C: do_per_function_toporder(void (*)(function*, void*),
void*) [clone .part.0] (passes.cc:1773)
==8560==by 0x13CD4BE: do_per_function_toporder (passes.cc:1740)
==8560==by 0x13CD4BE: execute_ipa_pass_list(opt_pass*) (passes.cc:3100)
==8560==by 0xFCDD37: ipa_passes (cgraphunit.cc:2211)
==8560==by 0xFCDD37: symbol_table::compile() [clone .part.0]
(cgraphunit.cc:2332)
==8560==by 0xFD05B7: compile (cgraphunit.cc:2312)
==8560==by 0xFD05B7: symbol_table::finalize_compilation_unit()
(cgraphunit.cc:2584)
==8560==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==8560== 
during GIMPLE pass: switchconv
testcase.c: In function 'foo':
testcase.c:263:1: internal compiler error: Segmentation fault
  263 | }
  | ^
0x150ddef crash_signal
/repo/gcc-trunk/gcc/toplev.cc:317
0x177d8aa make_ssa_name_fn(function*, tree_node*, gimple*, unsigned int)
/repo/gcc-trunk/gcc/tree-ssanames.cc:354
0x1610eb2 make_ssa_name(tree_node*, gimple*)
/repo/gcc-trunk/gcc/tree-ssanames.h:98
0x1610eb2 tree_switch_conversion::switch_conversion::build_arrays()
/repo/gcc-trunk/gcc/tree-switch-conversion.cc:727
0x1611296 tree_switch_conversion::switch_conversion::expand(gswitch*)
/repo/gcc-trunk/gcc/tree-switch-conversion.cc:1067
0x161135a tree_switch_conversion::switch_conversion::expand(gswitch*)
/repo/gcc-trunk/gcc/tree-switch-conversion.cc:2546
0x161135a execute
/repo/gcc-trunk/gcc/tree-switch-conversion.cc:2564
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.

[Bug ipa/113490] New: [14 Regression] ICE: in propagate_vals_across_arith_jfunc, at ipa-cp.cc:2425 at -O3

2024-01-18 Thread zsojka at seznam dot cz via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113490

Bug ID: 113490
   Summary: [14 Regression] ICE: in
propagate_vals_across_arith_jfunc, at ipa-cp.cc:2425
at -O3
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: ipa
  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

Created attachment 57145
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57145=edit
reduced testcase

Compiler output:
$ x86_64-pc-linux-gnu-gcc -O3 testcase.c -Wno-psabi
during IPA pass: cp
testcase.c:28:1: internal compiler error: in propagate_vals_across_arith_jfunc,
at ipa-cp.cc:2425
   28 | }
  | ^
0xda3a43 propagate_vals_across_arith_jfunc
/repo/gcc-trunk/gcc/ipa-cp.cc:2425
0x27d4b07 propagate_vals_across_pass_through
/repo/gcc-trunk/gcc/ipa-cp.cc:2481
0x27d4b07 propagate_scalar_across_jump_function
/repo/gcc-trunk/gcc/ipa-cp.cc:2563
0x27d4b07 propagate_constants_across_call
/repo/gcc-trunk/gcc/ipa-cp.cc:3281
0x27df470 propagate_constants_topo
/repo/gcc-trunk/gcc/ipa-cp.cc:4154
0x27df470 ipcp_propagate_stage
/repo/gcc-trunk/gcc/ipa-cp.cc:4361
0x27df470 ipcp_driver
/repo/gcc-trunk/gcc/ipa-cp.cc:6700
0x27df470 execute
/repo/gcc-trunk/gcc/ipa-cp.cc:6775
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-r14-8251-20240118071416-g48c8d26d771-checking-yes-rtl-df-extra-nobootstrap-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/14.0.1/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-r14-8251-20240118071416-g48c8d26d771-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.1 20240118 (experimental) (GCC)

[Bug target/113486] New: ICE: in extract_insn, at recog.cc:2812 (unrecognizable insn) with -mgeneral-regs-only and __builtin_apply() on aarch64

2024-01-18 Thread zsojka at seznam dot cz via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113486

Bug ID: 113486
   Summary: ICE: in extract_insn, at recog.cc:2812 (unrecognizable
insn) with -mgeneral-regs-only and __builtin_apply()
on aarch64
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: aarch64-unknown-linux-gnu

Created attachment 57142
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57142=edit
reduced testcase (from c-c++-common/torture/harden-cfr-bret-except.c)

Compiler output:
$ aarch64-unknown-linux-gnu-gcc -mgeneral-regs-only testcase.c
testcase.c: In function 'foo':
testcase.c:5:1: error: unrecognizable insn:
5 | }
  | ^
(insn 25 24 26 2 (set (reg:TI 32 v0)
(mem:TI (reg/f:DI 111) [0  S16 A64])) "testcase.c":4:3 -1
 (nil))
during RTL pass: vregs
testcase.c:5:1: internal compiler error: in extract_insn, at recog.cc:2812
0x86009f _fatal_insn(char const*, rtx_def const*, char const*, int, char
const*)
/repo/gcc-trunk/gcc/rtl-error.cc:108
0x86011c _fatal_insn_not_found(rtx_def const*, char const*, int, char const*)
/repo/gcc-trunk/gcc/rtl-error.cc:116
0x85113d extract_insn(rtx_insn*)
/repo/gcc-trunk/gcc/recog.cc:2812
0xf5e8f1 instantiate_virtual_regs_in_insn
/repo/gcc-trunk/gcc/function.cc:1611
0xf5e8f1 instantiate_virtual_regs
/repo/gcc-trunk/gcc/function.cc:1994
0xf5e8f1 execute
/repo/gcc-trunk/gcc/function.cc:2041
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.

$ aarch64-unknown-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=/repo/gcc-trunk/binary-latest-aarch64/bin/aarch64-unknown-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-r14-8193-20240117105849-g3340878009a-checking-yes-rtl-df-extra-aarch64/bin/../libexec/gcc/aarch64-unknown-linux-gnu/14.0.1/lto-wrapper
Target: aarch64-unknown-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--with-cloog --with-ppl --with-isl
--with-sysroot=/usr/aarch64-unknown-linux-gnu --build=x86_64-pc-linux-gnu
--host=x86_64-pc-linux-gnu --target=aarch64-unknown-linux-gnu
--with-ld=/usr/bin/aarch64-unknown-linux-gnu-ld
--with-as=/usr/bin/aarch64-unknown-linux-gnu-as --disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r14-8193-20240117105849-g3340878009a-checking-yes-rtl-df-extra-aarch64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.1 20240117 (experimental) (GCC)

[Bug rtl-optimization/113464] ICE: in lower_asm, at gimple-lower-bitint.cc:5200 with invalid __asm__ on _BitInt() at -O1 and above

2024-01-17 Thread zsojka at seznam dot cz via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113464

--- Comment #1 from Zdenek Sojka  ---
Created attachment 57128
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57128=edit
testcase triggering SIGSEGV at -O0

Slightly different testcase, triggers SIGSEGV at -O0 at a similar place:
$ x86_64-pc-linux-gnu-gcc testcase2.c -wrapper valgrind,-q
==8413== Invalid read of size 8
==8413==at 0x271971F: var_to_partition (tree-ssa-live.h:163)
==8413==by 0x271971F: lower_asm (gimple-lower-bitint.cc:5199)
==8413==by 0x271971F: (anonymous
namespace)::bitint_large_huge::lower_stmt(gimple*)
(gimple-lower-bitint.cc:5236)
==8413==by 0x271BB69: gimple_lower_bitint() (gimple-lower-bitint.cc:6534)
==8413==by 0x13CBE7A: execute_one_pass(opt_pass*) (passes.cc:2646)
==8413==by 0x13CC76F: execute_pass_list_1(opt_pass*) (passes.cc:2755)
==8413==by 0x13CC7A8: execute_pass_list(function*, opt_pass*)
(passes.cc:2766)
==8413==by 0xFCC675: expand (cgraphunit.cc:1842)
==8413==by 0xFCC675: cgraph_node::expand() (cgraphunit.cc:1795)
==8413==by 0xFCD589: output_in_order (cgraphunit.cc:2192)
==8413==by 0xFCD589: symbol_table::compile() [clone .part.0]
(cgraphunit.cc:2396)
==8413==by 0xFD0537: compile (cgraphunit.cc:2312)
==8413==by 0xFD0537: symbol_table::finalize_compilation_unit()
(cgraphunit.cc:2584)
==8413==by 0x150E111: compile_file() (toplev.cc:474)
==8413==by 0xDE6E6B: do_compile (toplev.cc:2152)
==8413==by 0xDE6E6B: toplev::main(int, char**) (toplev.cc:2308)
==8413==by 0xDE864A: main (main.cc:39)
==8413==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==8413== 
during GIMPLE pass: bitintlower0
testcase2.c: In function 'bar':
testcase2.c:2:1: internal compiler error: Segmentation fault
2 | bar(void)
  | ^~~
0x150dc2f crash_signal
/repo/gcc-trunk/gcc/toplev.cc:317
0x271971f var_to_partition(_var_map*, tree_node*)
/repo/gcc-trunk/gcc/tree-ssa-live.h:163
0x271971f lower_asm
/repo/gcc-trunk/gcc/gimple-lower-bitint.cc:5199
0x271971f lower_stmt
/repo/gcc-trunk/gcc/gimple-lower-bitint.cc:5236
0x271bb69 gimple_lower_bitint
/repo/gcc-trunk/gcc/gimple-lower-bitint.cc:6534
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See  for instructions.

[Bug tree-optimization/113466] New: ICE: verify_flow_info failed: returns_twice call is not first in basic block 7 with a __returns_twice__ function with _BitInt() argument

2024-01-17 Thread zsojka at seznam dot cz via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113466

Bug ID: 113466
   Summary: ICE: verify_flow_info failed: returns_twice call is
not first in basic block 7 with a __returns_twice__
function with _BitInt() argument
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
CC: jakub at gcc dot gnu.org
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu

Created attachment 57127
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57127=edit
reduced testcase

Compiler output:
$ x86_64-pc-linux-gnu-gcc testcase.c
testcase.c: In function 'foo':
testcase.c:4:1: error: returns_twice call is not first in basic block 7
4 | foo(int x)
  | ^~~
bar (_8);
during GIMPLE pass: bitintlower0
testcase.c:4:1: internal compiler error: verify_flow_info failed
0xf8edde verify_flow_info()
/repo/gcc-trunk/gcc/cfghooks.cc:287
0x156029c checking_verify_flow_info()
/repo/gcc-trunk/gcc/cfghooks.h:214
0x156029c cleanup_tree_cfg_noloop
/repo/gcc-trunk/gcc/tree-cfgcleanup.cc:1154
0x156029c cleanup_tree_cfg(unsigned int)
/repo/gcc-trunk/gcc/tree-cfgcleanup.cc:1205
0x13c8a3c execute_function_todo
/repo/gcc-trunk/gcc/passes.cc:2057
0x13c8eee execute_todo
/repo/gcc-trunk/gcc/passes.cc:2142
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 testcase.c
testcase.c: In function 'foo':
testcase.c:4:1: error: returns_twice call is not first in basic block 7
4 | foo(int x)
  | ^~~
bar (_8);
during GIMPLE pass: bitintlower0
testcase.c:4:1: internal compiler error: verify_flow_info failed
0xf8edde verify_flow_info()
/repo/gcc-trunk/gcc/cfghooks.cc:287
0x156029c checking_verify_flow_info()
/repo/gcc-trunk/gcc/cfghooks.h:214
0x156029c cleanup_tree_cfg_noloop
/repo/gcc-trunk/gcc/tree-cfgcleanup.cc:1154
0x156029c cleanup_tree_cfg(unsigned int)
/repo/gcc-trunk/gcc/tree-cfgcleanup.cc:1205
0x13c8a3c execute_function_todo
/repo/gcc-trunk/gcc/passes.cc:2057
0x13c8eee execute_todo
/repo/gcc-trunk/gcc/passes.cc:2142
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.

[Bug rtl-optimization/113464] New: ICE: in lower_asm, at gimple-lower-bitint.cc:5200 with invalid __asm__ on _BitInt() at -O1 and above

2024-01-17 Thread zsojka at seznam dot cz via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113464

Bug ID: 113464
   Summary: ICE: in lower_asm, at gimple-lower-bitint.cc:5200 with
invalid __asm__ on _BitInt() at -O1 and above
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: ice-on-invalid-code
  Severity: normal
  Priority: P3
 Component: rtl-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
CC: jakub at gcc dot gnu.org
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu

Created attachment 57126
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57126=edit
reduced testcase

Compiler output:
$ x86_64-pc-linux-gnu-gcc -O testcase.c 
during GIMPLE pass: bitintlower
testcase.c: In function 'foo':
testcase.c:4:1: internal compiler error: in lower_asm, at
gimple-lower-bitint.cc:5200
4 | foo(void)
  | ^~~
0xd8ab5d lower_asm
/repo/gcc-trunk/gcc/gimple-lower-bitint.cc:5200
0xd8ab5d lower_stmt
/repo/gcc-trunk/gcc/gimple-lower-bitint.cc:5236
0x271bb69 gimple_lower_bitint
/repo/gcc-trunk/gcc/gimple-lower-bitint.cc:6534
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-r14-8193-20240117105849-g3340878009a-checking-yes-rtl-df-extra-nobootstrap-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/14.0.1/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-r14-8193-20240117105849-g3340878009a-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.1 20240117 (experimental) (GCC)

[Bug tree-optimization/113463] New: ICE: in extended_tree, at tree.h:6449 with _BitInt() used as offset

2024-01-17 Thread zsojka at seznam dot cz via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113463

Bug ID: 113463
   Summary: ICE: in extended_tree, at tree.h:6449 with _BitInt()
used as offset
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
CC: jakub at gcc dot gnu.org
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu

Created attachment 57125
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57125=edit
reduced testcase

Compiler output:
$ x86_64-pc-linux-gnu-gcc testcase.c 
during GIMPLE pass: lower
testcase.c: In function 'foo':
testcase.c:4:11: internal compiler error: in extended_tree, at tree.h:6449
4 |  void foo (void)
  |   ^~~
0x784f0c wi::extended_tree<128>::extended_tree(tree_node const*)
/repo/gcc-trunk/gcc/tree.h:6449
0x784f0c wi::extended_tree<128>::extended_tree(tree_node const*)
/repo/gcc-trunk/gcc/tree.h:6446
0x784f0c generic_wide_int >::generic_wide_int(tree_node const* const&)
/repo/gcc-trunk/gcc/wide-int.h:847
0x784f0c wi::to_offset(tree_node const*)
/repo/gcc-trunk/gcc/tree.h:6401
0x784f0c extend_offset_range
/repo/gcc-trunk/gcc/gimple-ssa-warn-restrict.cc:402
0x118edfe set_base_and_offset
/repo/gcc-trunk/gcc/gimple-ssa-warn-restrict.cc:493
0x118f6ee builtin_memref
/repo/gcc-trunk/gcc/gimple-ssa-warn-restrict.cc:269
0x118fdbc check_bounds_or_overlap(pointer_query&, gimple*, tree_node*,
tree_node*, tree_node*, tree_node*, bool, bool)
/repo/gcc-trunk/gcc/gimple-ssa-warn-restrict.cc:2022
0x11929dc check_bounds_or_overlap(gimple*, tree_node*, tree_node*, tree_node*,
tree_node*, bool, bool)
/repo/gcc-trunk/gcc/gimple-ssa-warn-restrict.cc:2009
0x11684a2 gimple_fold_builtin_memory_op
/repo/gcc-trunk/gcc/gimple-fold.cc:992
0x116a363 gimple_fold_builtin
/repo/gcc-trunk/gcc/gimple-fold.cc:5093
0x116a363 gimple_fold_call
/repo/gcc-trunk/gcc/gimple-fold.cc:5664
0x116be2b fold_stmt_1
/repo/gcc-trunk/gcc/gimple-fold.cc:6431
0x2700b2f lower_stmt
/repo/gcc-trunk/gcc/gimple-low.cc:797
0x270184a lower_sequence
/repo/gcc-trunk/gcc/gimple-low.cc:229
0x270184a lower_gimple_bind
/repo/gcc-trunk/gcc/gimple-low.cc:886
0x27019e8 lower_function_body
/repo/gcc-trunk/gcc/gimple-low.cc:119
0x27019e8 execute
/repo/gcc-trunk/gcc/gimple-low.cc:206
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-r14-8193-20240117105849-g3340878009a-checking-yes-rtl-df-extra-nobootstrap-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/14.0.1/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-r14-8193-20240117105849-g3340878009a-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.1 20240117 (experimental) (GCC)

[Bug tree-optimization/113462] New: ICE: in handle_cast, at gimple-lower-bitint.cc:1539 at -O with _BitInt() in a struct

2024-01-17 Thread zsojka at seznam dot cz via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113462

Bug ID: 113462
   Summary: ICE: in handle_cast, at gimple-lower-bitint.cc:1539 at
-O with _BitInt() in a struct
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
CC: jakub at gcc dot gnu.org
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu

Created attachment 57124
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57124=edit
reduced testcase

Compiler output:
$ x86_64-pc-linux-gnu-gcc -O testcase.c 
during GIMPLE pass: bitintlower
testcase.c: In function 'foo':
testcase.c:2:1: internal compiler error: in handle_cast, at
gimple-lower-bitint.cc:1539
2 | foo(void)
  | ^~~
0xd88dea handle_cast
/repo/gcc-trunk/gcc/gimple-lower-bitint.cc:1539
0x27092c0 handle_operand
/repo/gcc-trunk/gcc/gimple-lower-bitint.cc:815
0x27141fd lower_mergeable_stmt
/repo/gcc-trunk/gcc/gimple-lower-bitint.cc:2481
0x271914d lower_stmt
/repo/gcc-trunk/gcc/gimple-lower-bitint.cc:5339
0x271bb69 gimple_lower_bitint
/repo/gcc-trunk/gcc/gimple-lower-bitint.cc:6534
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-r14-8193-20240117105849-g3340878009a-checking-yes-rtl-df-extra-nobootstrap-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/14.0.1/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-r14-8193-20240117105849-g3340878009a-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.1 20240117 (experimental) (GCC)

[Bug tree-optimization/113459] New: ICE: in as_a, at machmode.h:381 with memset() on a _BitInt() at -O1 and above

2024-01-17 Thread zsojka at seznam dot cz via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113459

Bug ID: 113459
   Summary: ICE: in as_a, at machmode.h:381 with memset() on a
_BitInt() at -O1 and above
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
CC: jakub at gcc dot gnu.org
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu

Created attachment 57119
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57119=edit
reduced testcase

Compiler output:
$ cc1 -quiet -O testcase.c 
during GIMPLE pass: fre
testcase.c: In function 'foo':
testcase.c:8:1: internal compiler error: in as_a, at machmode.h:381
8 | }
  | ^
0x876149 scalar_int_mode as_a(machine_mode)
/repo/gcc-trunk/gcc/machmode.h:381
0x876149 scalar_int_mode as_a(machine_mode)
/repo/gcc-trunk/gcc/machmode.h:379
0x876149 vn_reference_lookup_3
/repo/gcc-trunk/gcc/tree-ssa-sccvn.cc:2972
0x16226f7 walk_non_aliased_vuses(ao_ref*, tree_node*, bool, void* (*)(ao_ref*,
tree_node*, void*), void* (*)(ao_ref*, tree_node*, void*, translate_flags*),
tree_node* (*)(tree_node*), unsigned int&, void*)
/repo/gcc-trunk/gcc/tree-ssa-alias.cc:3914
0x171a4ef vn_reference_lookup(tree_node*, tree_node*, vn_lookup_kind,
vn_reference_s**, bool, tree_node**, tree_node*, bool)
/repo/gcc-trunk/gcc/tree-ssa-sccvn.cc:4023
0x171e7e7 visit_reference_op_load
/repo/gcc-trunk/gcc/tree-ssa-sccvn.cc:5740
0x171e7e7 visit_stmt
/repo/gcc-trunk/gcc/tree-ssa-sccvn.cc:6261
0x171ee6b process_bb
/repo/gcc-trunk/gcc/tree-ssa-sccvn.cc:8025
0x1720846 do_rpo_vn_1
/repo/gcc-trunk/gcc/tree-ssa-sccvn.cc:8626
0x17223bb execute
/repo/gcc-trunk/gcc/tree-ssa-sccvn.cc:8787
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.

$ xgcc -v
Using built-in specs.
COLLECT_GCC=/repo/build-gcc-trunk-amd64A/gcc/xgcc
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-r14-8193-20240117105849-g3340878009a-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.1 20240117 (experimental) (GCC)

[Bug middle-end/112684] ICE: in main, at toplev.cc:2327 with -ftarget-help -fdiagnostics-generate-patch

2024-01-16 Thread zsojka at seznam dot cz via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112684

--- Comment #1 from Zdenek Sojka  ---
This happens also with --help=c:

$ x86_64-pc-linux-gnu-gcc --help=c -fdiagnostics-generate-patch testcase.c 
The following options are supported by the language C:
  --all-warnings  Same as -Wall.
...
  -undef  Do not predefine system-specific and GCC-specific
macros.
  -v  Enable verbose output.
  -w  Suppress warnings.

cc1: internal compiler error: in main, at toplev.cc:2329
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See  for instructions.

[Bug tree-optimization/113421] New: wrong code with -O -fno-tree-fre and _BitInt() multiplication

2024-01-16 Thread zsojka at seznam dot cz via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113421

Bug ID: 113421
   Summary: wrong code with -O -fno-tree-fre and _BitInt()
multiplication
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: wrong-code
  Severity: normal
  Priority: P3
 Component: tree-optimization
  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

Created attachment 57101
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57101=edit
reduced testcase

Output:
$ x86_64-pc-linux-gnu-gcc testcase.c -O -fno-tree-fre
$ ./a.out 
Aborted

On the asm level:
...
mov r9d, 1024   #,
lea r8, [rsp+16]#,
mov ecx, 1024   #,
mov edx, OFFSET FLAT:g  #,
mov esi, 1024   #,
mov rdi, rdx#,
call__mulbitint3#
...

rdi == rdx, overlapping the "ret" and "u" arguments of __mulbitint3

$ 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-r14-7274-20240116114934-g1251d3957de-checking-yes-rtl-df-extra-nobootstrap-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/14.0.1/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-r14-7274-20240116114934-g1251d3957de-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.1 20240116 (experimental) (GCC)

[Bug target/113416] New: ICE: in force_constant_size, at gimplify.cc:742 (in convert_move, at expr.cc:223) with -march=rv64gcv (-march=rv32gcv) and -ftree-parallelize-loops=2

2024-01-15 Thread zsojka at seznam dot cz via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113416

Bug ID: 113416
   Summary: ICE: in force_constant_size, at gimplify.cc:742 (in
convert_move, at expr.cc:223) with -march=rv64gcv
(-march=rv32gcv) and -ftree-parallelize-loops=2
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: riscv64-unknown-linux-gnu

Created attachment 57098
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57098=edit
reduced testcase

This has been reduced from gcc.target/riscv/rvv/vsetvl/vlmax_back_prop-27.c ;
it fails the same way with -ftree-parallelize-loops=2.

Compiler output:
$ riscv64-unknown-linux-gnu-gcc -O -march=rv64gcv -ftree-parallelize-loops=2
testcase.c 
during GIMPLE pass: parloops
testcase.c: In function 'f':
testcase.c:4:1: internal compiler error: in force_constant_size, at
gimplify.cc:743
4 | f(long out, int n)
  | ^
0xa18136 force_constant_size
/repo/gcc-trunk/gcc/gimplify.cc:743
0x134e297 gimple_add_tmp_var(tree_node*)
/repo/gcc-trunk/gcc/gimplify.cc:781
0x1304676 create_tmp_var(tree_node*, char const*)
/repo/gcc-trunk/gcc/gimple-expr.cc:491
0x1780c4d separate_decls_in_region
/repo/gcc-trunk/gcc/tree-parloops.cc:2125
0x1782dd1 gen_parallel_loop
/repo/gcc-trunk/gcc/tree-parloops.cc:3162
0x1784a48 parallelize_loops
/repo/gcc-trunk/gcc/tree-parloops.cc:4140
0x1785dc1 execute
/repo/gcc-trunk/gcc/tree-parloops.cc:4228
0x1785dc1 execute
/repo/gcc-trunk/gcc/tree-parloops.cc:4207
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.


$ riscv64-unknown-linux-gnu-gcc -O -march=rv32gcv -mabi=ilp32
-ftree-parallelize-loops=2 testcase.c 
during RTL pass: expand
testcase.c: In function 'f._loopfn.0':
testcase.c:6:17: internal compiler error: in convert_move, at expr.cc:223
6 |   for (int i; i < n; i++) {
  | ^
0x9f3dd1 convert_move(rtx_def*, rtx_def*, int)
/repo/gcc-trunk/gcc/expr.cc:223
0x127807a store_expr(tree_node*, rtx_def*, int, bool, bool)
/repo/gcc-trunk/gcc/expr.cc:6810
0x1279909 expand_assignment(tree_node*, tree_node*, bool)
/repo/gcc-trunk/gcc/expr.cc:6443
0x112715c expand_gimple_stmt_1
/repo/gcc-trunk/gcc/cfgexpand.cc:3966
0x112715c expand_gimple_stmt
/repo/gcc-trunk/gcc/cfgexpand.cc:4064
0x112e2be expand_gimple_basic_block
/repo/gcc-trunk/gcc/cfgexpand.cc:6120
0x112fec7 execute
/repo/gcc-trunk/gcc/cfgexpand.cc:6855
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.


$ riscv64-unknown-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=/repo/gcc-trunk/binary-latest-riscv64/bin/riscv64-unknown-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-r14-7258-20240115151353-g731444b3c39-checking-yes-rtl-df-extra-riscv64/bin/../libexec/gcc/riscv64-unknown-linux-gnu/14.0.1/lto-wrapper
Target: riscv64-unknown-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--with-cloog --with-ppl --with-isl --with-isa-spec=2.2
--with-sysroot=/usr/riscv64-unknown-linux-gnu --build=x86_64-pc-linux-gnu
--host=x86_64-pc-linux-gnu --target=riscv64-unknown-linux-gnu
--with-ld=/usr/bin/riscv64-unknown-linux-gnu-ld
--with-as=/usr/bin/riscv64-unknown-linux-gnu-as --disable-multilib
--disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r14-7258-20240115151353-g731444b3c39-checking-yes-rtl-df-extra-riscv64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.1 20240115 (experimental) (GCC)

[Bug rtl-optimization/113415] New: ICE: RTL check: expected elt 3 type 'e' or 'u', have '0' (rtx code_label) in PATTERN, at rtl.h:1511 with -mstringop-strategy=byte_loop and invalid __asm__ on _BitInt

2024-01-15 Thread zsojka at seznam dot cz via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113415

Bug ID: 113415
   Summary: ICE: RTL check: expected elt 3 type 'e' or 'u', have
'0' (rtx code_label) in PATTERN, at rtl.h:1511 with
-mstringop-strategy=byte_loop and invalid __asm__ on
_BitInt()
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: ice-on-invalid-code
  Severity: normal
  Priority: P3
 Component: rtl-optimization
  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

Created attachment 57097
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57097=edit
reduced testcase

This probably needs RTL checking enabled. The asm constraints are invalid; ICEs
before the diagnostics.

Compiler output:
$ x86_64-pc-linux-gnu-gcc -mstringop-strategy=byte_loop testcase.c
during RTL pass: expand
testcase.c: In function 'foo':
testcase.c:6:3: internal compiler error: RTL check: expected elt 3 type 'e' or
'u', have '0' (rtx code_label) in PATTERN, at rtl.h:1511
6 |   __asm__ goto("" : "=r"(x) : : : lab);
  |   ^~~
0x800c3a rtl_check_failed_type2(rtx_def const*, int, int, int, char const*,
int, char const*)
/repo/gcc-trunk/gcc/rtl.cc:761
0x724644 PATTERN(rtx_def*)
/repo/gcc-trunk/gcc/rtl.h:1511
0x726bf6 PATTERN(rtx_def*)
/repo/gcc-trunk/gcc/rtl.h:1479
0x726bf6 expand_asm_stmt
/repo/gcc-trunk/gcc/cfgexpand.cc:3655
0xf88909 expand_gimple_stmt_1
/repo/gcc-trunk/gcc/cfgexpand.cc:3897
0xf88909 expand_gimple_stmt
/repo/gcc-trunk/gcc/cfgexpand.cc:4064
0xf8a007 expand_gimple_basic_block
/repo/gcc-trunk/gcc/cfgexpand.cc:6120
0xf8c66e execute
/repo/gcc-trunk/gcc/cfgexpand.cc:6855
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-r14-7258-20240115151353-g731444b3c39-checking-yes-rtl-df-extra-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/14.0.1/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
--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-r14-7258-20240115151353-g731444b3c39-checking-yes-rtl-df-extra-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.1 20240115 (experimental) (GCC)

[Bug tree-optimization/113410] New: ICE: in maybe_check_access_sizes, at gimple-ssa-warn-access.cc:3423 with _BitInt() used as array length

2024-01-15 Thread zsojka at seznam dot cz via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113410

Bug ID: 113410
   Summary: ICE: in maybe_check_access_sizes, at
gimple-ssa-warn-access.cc:3423 with _BitInt() used as
array length
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
CC: jakub at gcc dot gnu.org
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu

Created attachment 57096
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57096=edit
reduced testcase

This is reduced from gcc.dg/builtin-dynamic-object-size-20.c, when testsuite is
run with -Dint=_BitInt($RANDOM)

Compiler output:
$ x86_64-pc-linux-gnu-gcc testcase.c
during GIMPLE pass: waccess
testcase.c: In function 'foo':
testcase.c:4:1: internal compiler error: in maybe_check_access_sizes, at
gimple-ssa-warn-access.cc:3423
4 | foo (int n)
  | ^~~
0x783992 maybe_check_access_sizes
/repo/gcc-trunk/gcc/gimple-ssa-warn-access.cc:3423
0x1186c57 check_call_access
/repo/gcc-trunk/gcc/gimple-ssa-warn-access.cc:3644
0x1186c57 check_call
/repo/gcc-trunk/gcc/gimple-ssa-warn-access.cc:4351
0x1186c57 check_block
/repo/gcc-trunk/gcc/gimple-ssa-warn-access.cc:4434
0x1186c57 execute
/repo/gcc-trunk/gcc/gimple-ssa-warn-access.cc:4769
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-r14-7255-20240115165927-g6c703b4eb68-checking-yes-rtl-df-extra-nobootstrap-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/14.0.1/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-r14-7255-20240115165927-g6c703b4eb68-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.1 20240115 (experimental) (GCC)

[Bug tree-optimization/113409] New: ICE: in omp_extract_for_data, at omp-general.cc:411 with -fopenmp-simd and _BitInt()

2024-01-15 Thread zsojka at seznam dot cz via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113409

Bug ID: 113409
   Summary: ICE: in omp_extract_for_data, at omp-general.cc:411
with -fopenmp-simd and _BitInt()
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
CC: jakub at gcc dot gnu.org
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu

Created attachment 57095
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57095=edit
reduced testcase

This is reduced from gcc.dg/ipa/pr90555.c, when testsuite is run with
-Dint=_BitInt($RANDOM)

Compiler output:
$ x86_64-pc-linux-gnu-gcc -fopenmp-simd testcase.c 
during GIMPLE pass: omplower
testcase.c: In function 'test_simduid2':
testcase.c:9:9: internal compiler error: in omp_extract_for_data, at
omp-general.cc:411
9 | #pragma omp simd reduction(+: c2)
  | ^~~
0x7cb15b omp_extract_for_data(gomp_for*, omp_for_data*, omp_for_data_loop*)
/repo/gcc-trunk/gcc/omp-general.cc:411
0x137d0c9 lower_omp_for
/repo/gcc-trunk/gcc/omp-low.cc:11782
0x1368804 lower_omp_1
/repo/gcc-trunk/gcc/omp-low.cc:14388
0x1368804 lower_omp
/repo/gcc-trunk/gcc/omp-low.cc:14590
0x13681db lower_omp_1
/repo/gcc-trunk/gcc/omp-low.cc:14372
0x13681db lower_omp
/repo/gcc-trunk/gcc/omp-low.cc:14590
0x136c420 execute_lower_omp
/repo/gcc-trunk/gcc/omp-low.cc:14629
0x136c420 execute
/repo/gcc-trunk/gcc/omp-low.cc:14683
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-r14-7255-20240115165927-g6c703b4eb68-checking-yes-rtl-df-extra-nobootstrap-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/14.0.1/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-r14-7255-20240115165927-g6c703b4eb68-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.1 20240115 (experimental) (GCC)

[Bug tree-optimization/113408] New: ICE: in handle_cast, at gimple-lower-bitint.cc:1539 at -O with _BitInt()

2024-01-15 Thread zsojka at seznam dot cz via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113408

Bug ID: 113408
   Summary: ICE: in handle_cast, at gimple-lower-bitint.cc:1539 at
-O with _BitInt()
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
CC: jakub at gcc dot gnu.org
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu

Created attachment 57094
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57094=edit
reduced testcase

This is reduced from gcc.c-torture/execute/pr82387.c, when testsuite is run
with -Dint=_BitInt($RANDOM)

Compiler output:
$ x86_64-pc-linux-gnu-gcc -O testcase.c 
during GIMPLE pass: bitintlower
testcase.c: In function 'foo':
testcase.c:8:1: internal compiler error: in handle_cast, at
gimple-lower-bitint.cc:1539
8 | foo(void)
  | ^~~
0xd88b9a handle_cast
/repo/gcc-trunk/gcc/gimple-lower-bitint.cc:1539
0x2707c50 handle_operand
/repo/gcc-trunk/gcc/gimple-lower-bitint.cc:815
0x2713592 lower_mergeable_stmt
/repo/gcc-trunk/gcc/gimple-lower-bitint.cc:2462
0x2717a7d lower_stmt
/repo/gcc-trunk/gcc/gimple-lower-bitint.cc:5336
0x271a499 gimple_lower_bitint
/repo/gcc-trunk/gcc/gimple-lower-bitint.cc:6530
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-r14-7255-20240115165927-g6c703b4eb68-checking-yes-rtl-df-extra-nobootstrap-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/14.0.1/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-r14-7255-20240115165927-g6c703b4eb68-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.1 20240115 (experimental) (GCC)

[Bug tree-optimization/113406] New: ICE: tree check: expected class 'type', have 'exceptional' (error_mark) in useless_type_conversion_p, at gimple-expr.cc:85 with -fstrub=internal and _BitInt()

2024-01-15 Thread zsojka at seznam dot cz via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113406

Bug ID: 113406
   Summary: ICE: tree check: expected class 'type', have
'exceptional' (error_mark) in
useless_type_conversion_p, at gimple-expr.cc:85 with
-fstrub=internal and _BitInt()
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
CC: jakub at gcc dot gnu.org
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu

Created attachment 57092
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57092=edit
reduced testcase

Compiler output:
$ x86_64-pc-linux-gnu-gcc -fstrub=internal testcase.c 
during GIMPLE pass: bitintlower0
testcase.c: In function 'foo':
testcase.c:2:1: internal compiler error: tree check: expected class 'type',
have 'exceptional' (error_mark) in useless_type_conversion_p, at
gimple-expr.cc:85
2 | foo(void)
  | ^~~
0x89127d tree_class_check_failed(tree_node const*, tree_code_class, char
const*, int, char const*)
/repo/gcc-trunk/gcc/tree.cc:9002
0x77c702 tree_class_check(tree_node*, tree_code_class, char const*, int, char
const*)
/repo/gcc-trunk/gcc/tree.h:3767
0x77c702 useless_type_conversion_p(tree_node*, tree_node*)
/repo/gcc-trunk/gcc/gimple-expr.cc:85
0x15540a4 verify_gimple_return
/repo/gcc-trunk/gcc/tree-cfg.cc:4888
0x15540a4 verify_gimple_stmt
/repo/gcc-trunk/gcc/tree-cfg.cc:5125
0x1558311 verify_gimple_in_cfg(function*, bool, bool)
/repo/gcc-trunk/gcc/tree-cfg.cc:5602
0x13c83d4 execute_function_todo
/repo/gcc-trunk/gcc/passes.cc:2088
0x13c892e execute_todo
/repo/gcc-trunk/gcc/passes.cc:2142
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-r14-7255-20240115165927-g6c703b4eb68-checking-yes-rtl-df-extra-nobootstrap-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/14.0.1/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-r14-7255-20240115165927-g6c703b4eb68-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.1 20240115 (experimental) (GCC)

[Bug target/113404] New: ICE: in to_constant, at poly-int.h:588 with -march=rv64gcv -mbig-endian --param=riscv-vector-abi

2024-01-15 Thread zsojka at seznam dot cz via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113404

Bug ID: 113404
   Summary: ICE: in to_constant, at poly-int.h:588 with
-march=rv64gcv -mbig-endian --param=riscv-vector-abi
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: riscv64-unknown-linux-gnu

Created attachment 57088
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57088=edit
reduced testcase

This has been reduced from
gcc.target/riscv/rvv/base/float-point-dynamic-frm-66.c

Compiler output:
$ riscv64-unknown-linux-gnu-gcc -march=rv64gcv -mbig-endian
--param=riscv-vector-abi a-float-point-dynamic-frm-66.i
a-float-point-dynamic-frm-66.i: In function 'test_float_point_dynamic_frm':
a-float-point-dynamic-frm-66.i:2:14: warning: ABI for the vector type is
currently in experimental stage and may changes in the upcoming version of GCC.
[-Wpsabi]
2 | vfloat32m1_t test_float_point_dynamic_frm(vfloat32m1_t) {}
  |  ^~~~
during RTL pass: expand
a-float-point-dynamic-frm-66.i:2:14: internal compiler error: in to_constant,
at poly-int.h:588
0xab4c2c poly_int<2u, unsigned short>::to_constant() const
/repo/gcc-trunk/gcc/poly-int.h:588
0xab4de1 poly_int<2u, unsigned short>::to_constant() const
/repo/gcc-trunk/gcc/tree.h:4055
0xab4de1 default_function_arg_padding(machine_mode, tree_node const*)
/repo/gcc-trunk/gcc/targhooks.cc:844
0x12e2327 locate_and_pad_parm(machine_mode, tree_node*, int, int, int,
tree_node*, args_size*, locate_and_pad_arg_data*)
/repo/gcc-trunk/gcc/function.cc:4061
0x12e2aca assign_parm_find_entry_rtl
/repo/gcc-trunk/gcc/function.cc:2614
0x12e2c89 assign_parms
/repo/gcc-trunk/gcc/function.cc:3693
0x12e59df expand_function_start(tree_node*)
/repo/gcc-trunk/gcc/function.cc:5152
0x112fafb execute
/repo/gcc-trunk/gcc/cfgexpand.cc:6739
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.

$ riscv64-unknown-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=/repo/gcc-trunk/binary-latest-riscv64/bin/riscv64-unknown-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-r14-7255-20240115165927-g6c703b4eb68-checking-yes-rtl-df-extra-riscv64/bin/../libexec/gcc/riscv64-unknown-linux-gnu/14.0.1/lto-wrapper
Target: riscv64-unknown-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--with-cloog --with-ppl --with-isl --with-isa-spec=2.2
--with-sysroot=/usr/riscv64-unknown-linux-gnu --build=x86_64-pc-linux-gnu
--host=x86_64-pc-linux-gnu --target=riscv64-unknown-linux-gnu
--with-ld=/usr/bin/riscv64-unknown-linux-gnu-ld
--with-as=/usr/bin/riscv64-unknown-linux-gnu-as --disable-multilib
--disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r14-7255-20240115165927-g6c703b4eb68-checking-yes-rtl-df-extra-riscv64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.1 20240115 (experimental) (GCC)

[Bug tree-optimization/113397] [14 Regression] ICE: SIGSEGV in tree_check (tree.h:3611) with -fdump-ada-spec-slim on gcc.c-torture/execute/pr22061-2.c

2024-01-15 Thread zsojka at seznam dot cz via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113397

--- Comment #1 from Zdenek Sojka  ---
This actually fails the same way with plain -fdump-ada-spec, but I disabled
that flag due to PR107978 and PR107977

[Bug tree-optimization/113397] New: [14 Regression] ICE: SIGSEGV in tree_check (tree.h:3611) with -fdump-ada-spec-slim on gcc.c-torture/execute/pr22061-2.c

2024-01-15 Thread zsojka at seznam dot cz via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113397

Bug ID: 113397
   Summary: [14 Regression] ICE: SIGSEGV in tree_check
(tree.h:3611) with -fdump-ada-spec-slim on
gcc.c-torture/execute/pr22061-2.c
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: tree-optimization
  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

This fails on the gcc.c-torture/execute/pr22061-2.c testcase with
-fdump-ada-spec-slim

Compiler output:
$ x86_64-pc-linux-gnu-gcc -fdump-ada-spec-slim
/repo/gcc-trunk/gcc/testsuite/gcc.c-torture/execute/pr22061-2.c -wrapper
valgrind,-q
==1560== Invalid read of size 2
==1560==at 0xF0BC45: tree_check (tree.h:3611)
==1560==by 0xF0BC45: check_type_name_conflict(pretty_printer*, tree_node*)
(c-ada-spec.cc:1570)
==1560==by 0xF0E692: dump_ada_function_declaration(pretty_printer*,
tree_node*, bool, bool, bool, int) (c-ada-spec.cc:1654)
==1560==by 0xF0FFA3: dump_ada_declaration(pretty_printer*, tree_node*,
tree_node*, int) (c-ada-spec.cc:3135)
==1560==by 0xF11859: dump_ada_nodes (c-ada-spec.cc:826)
==1560==by 0xF11859: dump_ads (c-ada-spec.cc:3525)
==1560==by 0xF11859: dump_ada_specs(void (*)(char const*), int
(*)(tree_node*, cpp_operation)) (c-ada-spec.cc:3604)
==1560==by 0xE0D6BF: c_parse_final_cleanups() (c-decl.cc:13416)
==1560==by 0xEFAE00: c_common_parse_file() (c-opts.cc:1319)
==1560==by 0x150D66D: compile_file() (toplev.cc:447)
==1560==by 0xDE6B0B: do_compile (toplev.cc:2152)
==1560==by 0xDE6B0B: toplev::main(int, char**) (toplev.cc:2308)
==1560==by 0xDE82EA: main (main.cc:39)
==1560==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==1560== 
/repo/gcc-trunk/gcc/testsuite/gcc.c-torture/execute/pr22061-2.c:8:1: internal
compiler error: Segmentation fault
8 | }
  | ^
0x150d36f crash_signal
/repo/gcc-trunk/gcc/toplev.cc:317
0xf0bc45 tree_check(tree_node*, char const*, int, char const*, tree_code)
/repo/gcc-trunk/gcc/tree.h:3611
0xf0bc45 check_type_name_conflict
/repo/gcc-trunk/gcc/c-family/c-ada-spec.cc:1570
0xf0e692 dump_ada_function_declaration
/repo/gcc-trunk/gcc/c-family/c-ada-spec.cc:1654
0xf0ffa3 dump_ada_declaration
/repo/gcc-trunk/gcc/c-family/c-ada-spec.cc:3135
0xf11859 dump_ada_nodes
/repo/gcc-trunk/gcc/c-family/c-ada-spec.cc:826
0xf11859 dump_ads
/repo/gcc-trunk/gcc/c-family/c-ada-spec.cc:3525
0xf11859 dump_ada_specs(void (*)(char const*), int (*)(tree_node*,
cpp_operation))
/repo/gcc-trunk/gcc/c-family/c-ada-spec.cc:3604
0xe0d6bf c_parse_final_cleanups()
/repo/gcc-trunk/gcc/c/c-decl.cc:13416
0xefae00 c_common_parse_file()
/repo/gcc-trunk/gcc/c-family/c-opts.cc:1319
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-r14-7239-20240115095837-g8a1927856a1-checking-yes-rtl-df-extra-nobootstrap-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/14.0.1/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-r14-7239-20240115095837-g8a1927856a1-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.1 20240115 (experimental) (GCC)

[Bug rtl-optimization/113394] New: ICE: 'verify_type' failed: type variant with 'TYPE_ALIAS_SET_KNOWN_P' with -fstrub=internal -g

2024-01-14 Thread zsojka at seznam dot cz via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113394

Bug ID: 113394
   Summary: ICE: 'verify_type' failed: type variant with
'TYPE_ALIAS_SET_KNOWN_P' with -fstrub=internal -g
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: rtl-optimization
  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

This fails on the gcc.c-torture/compile/20020210-1.c testcase.

Compiler output:
$ x86_64-pc-linux-gnu-gcc -fstrub=internal -g
/repo/gcc-trunk/gcc/testsuite/gcc.c-torture/compile/20020210-1.c
/repo/gcc-trunk/gcc/testsuite/gcc.c-torture/compile/20020210-1.c:2:15: warning:
anonymous struct declared inside parameter list will not be visible outside of
this definition or declaration
2 | void f(int a, struct {int b[a];} c) {}
  |   ^~
/repo/gcc-trunk/gcc/testsuite/gcc.c-torture/compile/20020210-1.c: In function
'f.strub.0':
/repo/gcc-trunk/gcc/testsuite/gcc.c-torture/compile/20020210-1.c:2:38: error:
type variant with 'TYPE_ALIAS_SET_KNOWN_P'
2 | void f(int a, struct {int b[a];} c) {}
...
during RTL pass: final
/repo/gcc-trunk/gcc/testsuite/gcc.c-torture/compile/20020210-1.c:2:38: internal
compiler error: 'verify_type' failed
0x1837cee verify_type(tree_node const*)
/repo/gcc-trunk/gcc/tree.cc:14386
0x1051814 gen_type_die_with_usage
/repo/gcc-trunk/gcc/dwarf2out.cc:26258
0x104e566 gen_type_die
/repo/gcc-trunk/gcc/dwarf2out.cc:26489
0x104e566 gen_decl_die
/repo/gcc-trunk/gcc/dwarf2out.cc:27226
0x104a93d gen_subprogram_die
/repo/gcc-trunk/gcc/dwarf2out.cc:24094
0x104eab9 gen_decl_die
/repo/gcc-trunk/gcc/dwarf2out.cc:27106
0x104f6eb dwarf2out_decl
/repo/gcc-trunk/gcc/dwarf2out.cc:27687
0x104fb8e dwarf2out_function_decl
/repo/gcc-trunk/gcc/dwarf2out.cc:27702
0x10dfea4 rest_of_handle_final
/repo/gcc-trunk/gcc/final.cc:4273
0x10dfea4 execute
/repo/gcc-trunk/gcc/final.cc:4317
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-r14-7237-20240115123527-g65678b2bae5-checking-yes-rtl-df-extra-nobootstrap-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/14.0.1/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-r14-7237-20240115123527-g65678b2bae5-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.1 20240115 (experimental) (GCC)

[Bug rtl-optimization/113390] New: [14 Regression] ICE: in model_update_limit_points_in_group, at haifa-sched.cc:1986 with -O2 --param=max-sched-region-insns=200 --param=max-sched-extend-regions-iters

2024-01-14 Thread zsojka at seznam dot cz via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113390

Bug ID: 113390
   Summary: [14 Regression] ICE: in
model_update_limit_points_in_group, at
haifa-sched.cc:1986 with -O2
--param=max-sched-region-insns=200
--param=max-sched-extend-regions-iters=2
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: rtl-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: riscv64-unknown-linux-gnu

Created attachment 57079
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57079=edit
reduced testcase

Compiler output:
$ riscv64-unknown-linux-gnu-gcc -O2 --param=max-sched-region-insns=200
--param=max-sched-extend-regions-iters=2 testcase.c 
during RTL pass: sched1
testcase.c: In function 'foo0':
testcase.c:45:1: internal compiler error: in
model_update_limit_points_in_group, at haifa-sched.cc:1986
   45 | }
  | ^
0xe95736 model_update_limit_points_in_group
/repo/gcc-trunk/gcc/haifa-sched.cc:1986
0xe95736 model_update_limit_points
/repo/gcc-trunk/gcc/haifa-sched.cc:1997
0xe95736 schedule_insn
/repo/gcc-trunk/gcc/haifa-sched.cc:4091
0x2a40c39 schedule_block(basic_block_def**, void*)
/repo/gcc-trunk/gcc/haifa-sched.cc:6915
0x1650ec4 schedule_region
/repo/gcc-trunk/gcc/sched-rgn.cc:3203
0x1650ec4 schedule_insns()
/repo/gcc-trunk/gcc/sched-rgn.cc:3525
0x165130c schedule_insns()
/repo/gcc-trunk/gcc/sched-rgn.cc:3511
0x165130c rest_of_handle_sched
/repo/gcc-trunk/gcc/sched-rgn.cc:3729
0x165130c execute
/repo/gcc-trunk/gcc/sched-rgn.cc:3839
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.

$ riscv64-unknown-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=/repo/gcc-trunk/binary-latest-riscv64/bin/riscv64-unknown-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-r14-7215-20240112190107-g8b447fa89d5-checking-yes-rtl-df-extra-riscv64/bin/../libexec/gcc/riscv64-unknown-linux-gnu/14.0.1/lto-wrapper
Target: riscv64-unknown-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--with-cloog --with-ppl --with-isl --with-isa-spec=2.2
--with-sysroot=/usr/riscv64-unknown-linux-gnu --build=x86_64-pc-linux-gnu
--host=x86_64-pc-linux-gnu --target=riscv64-unknown-linux-gnu
--with-ld=/usr/bin/riscv64-unknown-linux-gnu-ld
--with-as=/usr/bin/riscv64-unknown-linux-gnu-as --disable-multilib
--disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r14-7215-20240112190107-g8b447fa89d5-checking-yes-rtl-df-extra-riscv64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.1 20240112 (experimental) (GCC)

[Bug tree-optimization/113372] New: wrong code with _BitInt() arithmetics at -O1

2024-01-13 Thread zsojka at seznam dot cz via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113372

Bug ID: 113372
   Summary: wrong code with _BitInt() arithmetics at -O1
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: wrong-code
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
CC: jakub at gcc dot gnu.org
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu

Created attachment 57068
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57068=edit
reduced testcase

Output:
$ x86_64-pc-linux-gnu-gcc -O testcase.c
$ ./a.out 
Aborted

$ 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-r14-7215-20240112190107-g8b447fa89d5-checking-yes-rtl-df-extra-nobootstrap-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/14.0.1/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-r14-7215-20240112190107-g8b447fa89d5-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.1 20240112 (experimental) (GCC)

[Bug tree-optimization/113371] New: [14 Regression] ICE: verify_ssa failed: PHI node with wrong VUSE on edge from BB 19 with -O -march=silvermont -ftree-vectorize

2024-01-12 Thread zsojka at seznam dot cz via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113371

Bug ID: 113371
   Summary: [14 Regression] ICE: verify_ssa failed: PHI node with
wrong VUSE on edge from BB 19 with -O
-march=silvermont -ftree-vectorize
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: tree-optimization
  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

Created attachment 57067
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57067=edit
reduced testcase

Compiler output:
$ x86_64-pc-linux-gnu-gcc -O -march=silvermont -ftree-vectorize testcase.c 
testcase.c: In function 'BN_uadd':
testcase.c:4:1: error: PHI node with wrong VUSE on edge from BB 19
4 | BN_uadd (int dif, long t1)
  | ^~~
.MEM_125 = PHI <.MEM_8(D)(19)>
expected .MEM_45
during GIMPLE pass: vect
testcase.c:4:1: internal compiler error: verify_ssa failed
0x177532f verify_ssa(bool, bool)
/repo/gcc-trunk/gcc/tree-ssa.cc:1203
0x13c8545 execute_function_todo
/repo/gcc-trunk/gcc/passes.cc:2095
0x13c89ae execute_todo
/repo/gcc-trunk/gcc/passes.cc:2142
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-r14-7215-20240112190107-g8b447fa89d5-checking-yes-rtl-df-extra-nobootstrap-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/14.0.1/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-r14-7215-20240112190107-g8b447fa89d5-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.1 20240112 (experimental) (GCC)

[Bug tree-optimization/113370] New: wrong code with shift and _BitInt() at -O0

2024-01-12 Thread zsojka at seznam dot cz via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113370

Bug ID: 113370
   Summary: wrong code with shift and _BitInt() at -O0
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: wrong-code
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
CC: jakub at gcc dot gnu.org
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu

Created attachment 57066
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57066=edit
reduced testcase

Output:
$ x86_64-pc-linux-gnu-gcc testcase.c
$ ./a.out 
Aborted

$ 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-r14-7215-20240112190107-g8b447fa89d5-checking-yes-rtl-df-extra-nobootstrap-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/14.0.1/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-r14-7215-20240112190107-g8b447fa89d5-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.1 20240112 (experimental) (GCC)

[Bug tree-optimization/113361] New: wrong code with __builtin_mul_overflow_p() and _BitInt() at -O0

2024-01-12 Thread zsojka at seznam dot cz via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113361

Bug ID: 113361
   Summary: wrong code with __builtin_mul_overflow_p() and
_BitInt() at -O0
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code, wrong-code
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
CC: jakub at gcc dot gnu.org
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu

Created attachment 57059
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57059=edit
reduced testcase

Output:
$ x86_64-pc-linux-gnu-gcc testcase.c
$ ./a.out 
Aborted

It fails at different -On levels, depending on the value of 'x'.
If the type of 'x' is changed to _BitInt(63), it ICEs instead:
$ x86_64-pc-linux-gnu-gcc testcase.c
during GIMPLE pass: bitintlower0
testcase.c: In function 'foo':
testcase.c:2:1: internal compiler error: in build_bitint_type, at tree.cc:7178
2 | foo(_BitInt(63) x)
  | ^~~
0x89c77a build_bitint_type(unsigned long, int)
/repo/gcc-trunk/gcc/tree.cc:7178
0x2706118 handle_operand_addr
/repo/gcc-trunk/gcc/gimple-lower-bitint.cc:2244
0x270fc92 lower_mul_overflow
/repo/gcc-trunk/gcc/gimple-lower-bitint.cc:4291
0x270fc92 lower_call
/repo/gcc-trunk/gcc/gimple-lower-bitint.cc:5101
0x271a4b9 gimple_lower_bitint
/repo/gcc-trunk/gcc/gimple-lower-bitint.cc:6524
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-r14-7215-20240112190107-g8b447fa89d5-checking-yes-rtl-df-extra-nobootstrap-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/14.0.1/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-r14-7215-20240112190107-g8b447fa89d5-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.1 20240112 (experimental) (GCC)

[Bug tree-optimization/113334] New: wrong code with _BitInt() shift at -O0

2024-01-11 Thread zsojka at seznam dot cz via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113334

Bug ID: 113334
   Summary: wrong code with _BitInt() shift at -O0
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: wrong-code
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
CC: jakub at gcc dot gnu.org
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu

Created attachment 57040
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57040=edit
reduced testcase

I cannot tell for sure that the code is defined, but I don't see anything
breaking pre-C23 rules, if applied to _BitInt().

Output:
$ x86_64-pc-linux-gnu-gcc testcase.c
$ ./a.out 
Aborted

It works fine on -O1 and above.

$ 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-r14-7127-20240110200826-g2105c49bbe8-checking-yes-rtl-df-extra-nobootstrap-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/14.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-r14-7127-20240110200826-g2105c49bbe8-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.0 20240111 (experimental) (GCC)

[Bug tree-optimization/113330] New: ICE: verify_gimple failed: conversion of register to a different size in 'view_convert_expr' with -O -fstack-check=generic and _BitInt()

2024-01-11 Thread zsojka at seznam dot cz via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113330

Bug ID: 113330
   Summary: ICE: verify_gimple failed: conversion of register to a
different size in 'view_convert_expr' with -O
-fstack-check=generic and _BitInt()
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
CC: jakub at gcc dot gnu.org
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu

Created attachment 57036
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57036=edit
reduced testcase

Maybe related to PR113297

Compiler output:
$ x86_64-pc-linux-gnu-gcc -O --param=large-stack-frame=131072
-fstack-check=generic --param=sccvn-max-alias-queries-per-access=0 testcase.c 
testcase.c: In function 'foo':
testcase.c:15:1: error: conversion of register to a different size in
'view_convert_expr'
   15 | }
  | ^
VIEW_CONVERT_EXPR<_BitInt(65535)>(SR.6_11);

_4 = VIEW_CONVERT_EXPR<_BitInt(65535)>(SR.6_11);
during GIMPLE pass: esra
testcase.c:15:1: internal compiler error: verify_gimple failed
0x1557dbd verify_gimple_in_cfg(function*, bool, bool)
/repo/gcc-trunk/gcc/tree-cfg.cc:5666
0x13c7774 execute_function_todo
/repo/gcc-trunk/gcc/passes.cc:2088
0x13c7cce execute_todo
/repo/gcc-trunk/gcc/passes.cc:2142
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-r14-7127-20240110200826-g2105c49bbe8-checking-yes-rtl-df-extra-nobootstrap-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/14.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-r14-7127-20240110200826-g2105c49bbe8-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.0 20240111 (experimental) (GCC)

[Bug tree-optimization/113323] New: ICE: tree check: expected none of vector_type, have vector_type in bitint_precision_kind, at gimple-lower-bitint.cc:131 with _BitInt()

2024-01-10 Thread zsojka at seznam dot cz via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113323

Bug ID: 113323
   Summary: ICE: tree check: expected none of vector_type, have
vector_type in bitint_precision_kind, at
gimple-lower-bitint.cc:131 with _BitInt()
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
CC: jakub at gcc dot gnu.org
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu

Created attachment 57033
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57033=edit
reduced testcase

Compiler output:
$ x86_64-pc-linux-gnu-gcc -O testcase.c
during GIMPLE pass: bitintlower
testcase.c: In function 'foo':
testcase.c:6:1: internal compiler error: tree check: expected none of
vector_type, have vector_type in bitint_precision_kind, at
gimple-lower-bitint.cc:131
6 | foo (void)
  | ^~~
0x890e56 tree_not_check_failed(tree_node const*, char const*, int, char const*,
...)
/repo/gcc-trunk/gcc/tree.cc:8989
0xd7cac1 tree_not_check(tree_node*, char const*, int, char const*, tree_code)
/repo/gcc-trunk/gcc/tree.h:3621
0xd7cac1 bitint_precision_kind
/repo/gcc-trunk/gcc/gimple-lower-bitint.cc:131
0x26567af before_dom_children
/repo/gcc-trunk/gcc/gimple-lower-bitint.cc:5507
0x261e1ce dom_walker::walk(basic_block_def*)
/repo/gcc-trunk/gcc/domwalk.cc:311
0x266abe9 gimple_lower_bitint
/repo/gcc-trunk/gcc/gimple-lower-bitint.cc:6285
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-r14-7127-20240110200826-g2105c49bbe8-checking-yes-rtl-df-extra-nobootstrap-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/14.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-r14-7127-20240110200826-g2105c49bbe8-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.0 20240111 (experimental) (GCC)

[Bug tree-optimization/113315] during GIMPLE pass: bitintlower0 ICE: in lower_mergeable_stmt, at gimple-lower-bitint.cc:2310 with _BitInt() used as array index

2024-01-10 Thread zsojka at seznam dot cz via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113315

--- Comment #2 from Zdenek Sojka  ---
Created attachment 57031
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57031=edit
probably related testcase, ICEing elsewhere at -O0

Compiler output for testcase3.c:
$ x86_64-pc-linux-gnu-gcc testcase3.c
during GIMPLE pass: bitintlower0
testcase3.c: In function 'foo':
testcase3.c:5:1: internal compiler error: in lower_stmt, at
gimple-lower-bitint.cc:5421
5 | foo (void)
  | ^~~
0xd7fc87 lower_stmt
/repo/gcc-trunk/gcc/gimple-lower-bitint.cc:5421
0x266bf59 gimple_lower_bitint
/repo/gcc-trunk/gcc/gimple-lower-bitint.cc:6514
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See  for instructions.

[Bug tree-optimization/113316] New: during GIMPLE pass: bitintlower ICE: SIGSEGV in var_to_partition (tree-ssa-live.h:163) at -O with uninitialized _BitInt() function argument

2024-01-10 Thread zsojka at seznam dot cz via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113316

Bug ID: 113316
   Summary: during GIMPLE pass: bitintlower ICE: SIGSEGV in
var_to_partition (tree-ssa-live.h:163) at -O with
uninitialized _BitInt() function argument
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
CC: jakub at gcc dot gnu.org
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu

Created attachment 57030
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57030=edit
reduced testcase

Compiler output:
$ x86_64-pc-linux-gnu-gcc -O testcase.c -wrapper valgrind,-q
==9456== Invalid read of size 8
==9456==at 0x2661471: var_to_partition (tree-ssa-live.h:163)
==9456==by 0x2661471: (anonymous
namespace)::bitint_large_huge::lower_call(tree_node*, gimple*)
(gimple-lower-bitint.cc:5120)
==9456==by 0x266BF59: gimple_lower_bitint() (gimple-lower-bitint.cc:6514)
==9456==by 0x13CA4BA: execute_one_pass(opt_pass*) (passes.cc:2646)
==9456==by 0x13CADAF: execute_pass_list_1(opt_pass*) (passes.cc:2755)
==9456==by 0x13CADC1: execute_pass_list_1(opt_pass*) (passes.cc:2756)
==9456==by 0x13CADE8: execute_pass_list(function*, opt_pass*)
(passes.cc:2766)
==9456==by 0xFCB105: expand (cgraphunit.cc:1842)
==9456==by 0xFCB105: cgraph_node::expand() (cgraphunit.cc:1795)
==9456==by 0xFCC44A: expand_all_functions (cgraphunit.cc:2025)
==9456==by 0xFCC44A: symbol_table::compile() [clone .part.0]
(cgraphunit.cc:2399)
==9456==by 0xFCEFC7: compile (cgraphunit.cc:2312)
==9456==by 0xFCEFC7: symbol_table::finalize_compilation_unit()
(cgraphunit.cc:2584)
==9456==by 0x150C3E1: compile_file() (toplev.cc:473)
==9456==by 0xDE691B: do_compile (toplev.cc:2151)
==9456==by 0xDE691B: toplev::main(int, char**) (toplev.cc:2307)
==9456==by 0xDE80FA: main (main.cc:39)
==9456==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==9456== 
during GIMPLE pass: bitintlower
testcase.c: In function 'foo':
testcase.c:4:1: internal compiler error: Segmentation fault
4 | foo (void)
  | ^~~
0x150beff crash_signal
/repo/gcc-trunk/gcc/toplev.cc:316
0x2661471 var_to_partition(_var_map*, tree_node*)
/repo/gcc-trunk/gcc/tree-ssa-live.h:163
0x2661471 lower_call
/repo/gcc-trunk/gcc/gimple-lower-bitint.cc:5120
0x266bf59 gimple_lower_bitint
/repo/gcc-trunk/gcc/gimple-lower-bitint.cc:6514
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.

[Bug tree-optimization/113315] during GIMPLE pass: bitintlower0 ICE: in lower_mergeable_stmt, at gimple-lower-bitint.cc:2310 with _BitInt() used as array index

2024-01-10 Thread zsojka at seznam dot cz via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113315

--- Comment #1 from Zdenek Sojka  ---
Created attachment 57029
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57029=edit
probably related testcase, ICEing elsewhere at -O1

Compiler output with the other testcase at -O1:
$ x86_64-pc-linux-gnu-gcc -O testcase2.c 
during GIMPLE pass: ccp
testcase2.c: In function 'foo':
testcase2.c:8:1: internal compiler error: in extended_tree, at tree.h:6449
8 | }
  | ^
0xf083fe wi::extended_tree<128>::extended_tree(tree_node const*)
/repo/gcc-trunk/gcc/tree.h:6449
0xf083fe wi::extended_tree<128>::extended_tree(tree_node const*)
/repo/gcc-trunk/gcc/tree.h:6446
0x1164b80 generic_wide_int >::generic_wide_int(tree_node const* const&)
/repo/gcc-trunk/gcc/wide-int.h:847
0x1164b80 poly_int<1u, generic_wide_int >
>::poly_int(poly_int_full, tree_node const* const&)
/repo/gcc-trunk/gcc/poly-int.h:467
0x1164b80 poly_int<1u, generic_wide_int >
>::poly_int(tree_node const* const&)
/repo/gcc-trunk/gcc/poly-int.h:453
0x1164b80 wi::to_poly_offset(tree_node const*)
/repo/gcc-trunk/gcc/tree.h:6549
0x1164b80 fold_const_aggregate_ref_1(tree_node*, tree_node* (*)(tree_node*))
/repo/gcc-trunk/gcc/gimple-fold.cc:8358
0x1165c34 gimple_fold_stmt_to_constant_1(gimple*, tree_node* (*)(tree_node*),
tree_node* (*)(tree_node*))
/repo/gcc-trunk/gcc/gimple-fold.cc:7670
0x162f8ae ccp_fold
/repo/gcc-trunk/gcc/tree-ssa-ccp.cc:1288
0x162f8ae evaluate_stmt
/repo/gcc-trunk/gcc/tree-ssa-ccp.cc:2226
0x1631faf visit_assignment
/repo/gcc-trunk/gcc/tree-ssa-ccp.cc:2861
0x16ee563 ssa_propagation_engine::simulate_stmt(gimple*)
/repo/gcc-trunk/gcc/tree-ssa-propagate.cc:221
0x16ee83a ssa_propagation_engine::simulate_block(basic_block_def*)
/repo/gcc-trunk/gcc/tree-ssa-propagate.cc:328
0x16eed73 ssa_propagation_engine::ssa_propagate()
/repo/gcc-trunk/gcc/tree-ssa-propagate.cc:478
0x1627509 do_ssa_ccp
/repo/gcc-trunk/gcc/tree-ssa-ccp.cc:2980
0x1627509 execute
/repo/gcc-trunk/gcc/tree-ssa-ccp.cc:3026
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See  for instructions.

[Bug tree-optimization/113315] New: during GIMPLE pass: bitintlower0 ICE: in lower_mergeable_stmt, at gimple-lower-bitint.cc:2310 with _BitInt() used as array index

2024-01-10 Thread zsojka at seznam dot cz via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113315

Bug ID: 113315
   Summary: during GIMPLE pass: bitintlower0 ICE: in
lower_mergeable_stmt, at gimple-lower-bitint.cc:2310
with _BitInt() used as array index
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
CC: jakub at gcc dot gnu.org
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu

Created attachment 57028
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57028=edit
reduced testcase

Compiler output:
$ x86_64-pc-linux-gnu-gcc testcase.c 
during GIMPLE pass: bitintlower0
testcase.c: In function 'foo':
testcase.c:5:1: internal compiler error: in lower_mergeable_stmt, at
gimple-lower-bitint.cc:2310
5 | foo (void)
  | ^~~
0xd7f264 lower_mergeable_stmt
/repo/gcc-trunk/gcc/gimple-lower-bitint.cc:2310
0x266953d lower_stmt
/repo/gcc-trunk/gcc/gimple-lower-bitint.cc:5320
0x266bf59 gimple_lower_bitint
/repo/gcc-trunk/gcc/gimple-lower-bitint.cc:6514
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-r14-7116-20240110185507-g52e809d5cf3-checking-yes-rtl-df-extra-nobootstrap-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/14.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-r14-7116-20240110185507-g52e809d5cf3-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.0 20240110 (experimental) (GCC)

[Bug tree-optimization/113297] New: during GIMPLE pass: esra ICE: in smallest_mode_for_size, at stor-layout.cc:356 with _BitInt() with -fstack-check=generic

2024-01-09 Thread zsojka at seznam dot cz via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113297

Bug ID: 113297
   Summary: during GIMPLE pass: esra ICE: in
smallest_mode_for_size, at stor-layout.cc:356 with
_BitInt() with -fstack-check=generic
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: tree-optimization
  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

Created attachment 57017
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57017=edit
reduced testcase

Compiler output:
$ x86_64-pc-linux-gnu-gcc -O -fno-tree-fre --param=large-stack-frame=1024
-fstack-check=generic testcase.c
during GIMPLE pass: esra
testcase.c: In function 'foo':
testcase.c:13:1: internal compiler error: in smallest_mode_for_size, at
stor-layout.cc:356
   13 | }
  | ^
0x14f9f6f smallest_mode_for_size(poly_int<1u, unsigned long>, mode_class)
/repo/gcc-trunk/gcc/stor-layout.cc:356
0x14fe8b5 smallest_int_mode_for_size(poly_int<1u, unsigned long>)
/repo/gcc-trunk/gcc/machmode.h:916
0x14fe8b5 layout_type(tree_node*)
/repo/gcc-trunk/gcc/stor-layout.cc:2406
0x1828791 build_nonstandard_integer_type(unsigned long, int)
/repo/gcc-trunk/gcc/tree.cc:7131
0x15fd950 analyze_access_subtree
/repo/gcc-trunk/gcc/tree-sra.cc:2745
0x16037dd analyze_access_trees
/repo/gcc-trunk/gcc/tree-sra.cc:2807
0x16037dd analyze_all_variable_accesses
/repo/gcc-trunk/gcc/tree-sra.cc:3695
0x16037dd perform_intra_sra
/repo/gcc-trunk/gcc/tree-sra.cc:4952
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-r14-7023-20240109134751-gab6224dfe12-checking-yes-rtl-df-extra-nobootstrap-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/14.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-r14-7023-20240109134751-gab6224dfe12-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.0 20240109 (experimental) (GCC)

[Bug ipa/113291] New: [14 Regression] compilation never (?) finishes with recursive always_inline functions at -O and above

2024-01-09 Thread zsojka at seznam dot cz via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113291

Bug ID: 113291
   Summary: [14 Regression] compilation never (?) finishes with
recursive always_inline functions at -O and above
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: ipa
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
CC: marxin at gcc dot gnu.org
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu

Created attachment 57015
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57015=edit
reduced testcase

Compiler output:
$ time x86_64-pc-linux-gnu-gcc -O testcase.c -Wall -W
testcase.c:13:1: warning: 'always_inline' function might not be inlinable
[-Wattributes]
   13 | f1 (void)
  | ^~
testcase.c:6:1: warning: 'always_inline' function might not be inlinable
[-Wattributes]
6 | f0 (void)
  | ^~
testcase.c: In function 'f0':
testcase.c:6:1: warning: infinite recursion detected [-Winfinite-recursion]
In function 'f1',
inlined from 'f0' at testcase.c:8:3:
testcase.c:16:3: note: recursive call
   16 |   f0 ();
  |   ^
testcase.c: In function 'f1':
testcase.c:13:1: warning: infinite recursion detected [-Winfinite-recursion]
   13 | f1 (void)
  | ^~
testcase.c:15:3: note: recursive call
   15 |   f1 ();
  |   ^
^C

real1m21.533s
user0m0.002s
sys 0m0.000s


$ 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-r14-7023-20240109134751-gab6224dfe12-checking-yes-rtl-df-extra-nobootstrap-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/14.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-r14-7023-20240109134751-gab6224dfe12-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.0 20240109 (experimental) (GCC)

[Bug rtl-optimization/113287] New: wrong code with __builtin_mul_overflow_p() and _BitInt() with -O3 -msse4

2024-01-08 Thread zsojka at seznam dot cz via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113287

Bug ID: 113287
   Summary: wrong code with __builtin_mul_overflow_p() and
_BitInt() with -O3 -msse4
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: wrong-code
  Severity: normal
  Priority: P3
 Component: rtl-optimization
  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

Created attachment 57013
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57013=edit
reduced testcase

I don't know if this is a _BitInt() issue, or if it's related to PR113144 (or
is a standalone issue), since it appears only when vectorisation is enabled.

Output:
$ x86_64-pc-linux-gnu-gcc -O3 -msse4 testcase.c
$ ./a.out 
Aborted

$ 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-r14-7009-20240108175617-ga17299c17af-checking-yes-rtl-df-extra-nobootstrap-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/14.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-r14-7009-20240108175617-ga17299c17af-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.0 20240108 (experimental) (GCC)

[Bug tree-optimization/113144] [14 regression] ICE when building dpkg-1.21.15 in verify_dominators (error: dominator of 9 should be 48, not 12)

2024-01-08 Thread zsojka at seznam dot cz via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113144

--- Comment #10 from Zdenek Sojka  ---
Created attachment 57009
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57009=edit
simpler testcase using _BitInt()

$ x86_64-pc-linux-gnu-gcc -O3 -mavx2 testcase.c 
testcase.c: In function 'foo':
testcase.c:5:1: error: dominator of 24 should be 57, not 12
5 | foo (void)
  | ^~~
testcase.c:5:1: error: dominator of 25 should be 57, not 12
during GIMPLE pass: vect
testcase.c:5:1: internal compiler error: in verify_dominators, at
dominance.cc:1194
0x742528 verify_dominators(cdi_direction)
...

<    1   2   3   4   5   6   7   8   9   10   >