[Bug target/116096] New: during RTL pass: cprop_hardreg ICE: in extract_insn, at recog.cc:2848 (unrecognizable insn ashift:TI?) with -O2 -flive-range-shrinkage -fno-peephole2 -mstackrealign

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

Bug ID: 116096
   Summary: during RTL pass: cprop_hardreg ICE: in extract_insn,
at recog.cc:2848 (unrecognizable insn ashift:TI?) with
-O2 -flive-range-shrinkage -fno-peephole2
-mstackrealign
   Product: gcc
   Version: 15.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 58760
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=58760=edit
reduced testcase

Compiler output:
$ x86_64-pc-linux-gnu-gcc -O2 -flive-range-shrinkage -fno-peephole2
-mstackrealign testcase.c -Wno-psabi
testcase.c: In function 'foo':
testcase.c:23:1: error: unrecognizable insn:
   23 | }
  | ^
(insn 98 452 387 2 (parallel [
(set (reg:TI 0 ax [orig:337 _32 ] [337])
(ashift:TI (const_int 1671291085 [0x639de0cd])
(reg:QI 2 cx [521])))
(clobber (reg:CC 17 flags))
]) "testcase.c":11:13 -1
 (expr_list:REG_DEAD (reg:QI 2 cx [521])
(expr_list:REG_UNUSED (reg:CC 17 flags)
(expr_list:REG_EQUIV (mem:TI (plus:DI (reg/f:DI 19 frame)
(const_int -80 [0xffb0])) [2  S16 A128])
(expr_list:REG_EQUAL (ashift:TI (const_int 1671291085
[0x639de0cd])
(reg:QI 0 ax [535]))
(nil))
during RTL pass: cprop_hardreg
testcase.c:23:1: internal compiler error: in extract_insn, at recog.cc:2848
0x2b3d6ae internal_error(char const*, ...)
/repo/gcc-trunk/gcc/diagnostic-global-context.cc:491
0xe50941 fancy_abort(char const*, int, char const*)
/repo/gcc-trunk/gcc/diagnostic.cc:1742
0x81e2f3 _fatal_insn(char const*, rtx_def const*, char const*, int, char
const*)
/repo/gcc-trunk/gcc/rtl-error.cc:108
0x81e370 _fatal_insn_not_found(rtx_def const*, char const*, int, char const*)
/repo/gcc-trunk/gcc/rtl-error.cc:116
0x80d1b9 extract_insn(rtx_insn*)
/repo/gcc-trunk/gcc/recog.cc:2848
0x14d6928 extract_constrain_insn(rtx_insn*)
/repo/gcc-trunk/gcc/recog.cc:2747
0x14e1c9b copyprop_hardreg_forward_1
/repo/gcc-trunk/gcc/regcprop.cc:836
0x14e3094 execute
/repo/gcc-trunk/gcc/regcprop.cc:1423
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-r15-2320-20240725090119-g3aeb697a215-checking-yes-rtl-df-extra-nobootstrap-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/15.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 --enable-libsanitizer
--disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r15-2320-20240725090119-g3aeb697a215-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 15.0.0 20240725 (experimental) (GCC)

[Bug tree-optimization/116093] New: wrong code with -Og -ftree-vrp -fno-tree-dce

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

Bug ID: 116093
   Summary: wrong code with -Og -ftree-vrp -fno-tree-dce
   Product: gcc
   Version: 15.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 58758
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=58758=edit
reduced testcase

Output:
$ x86_64-pc-linux-gnu-gcc -Og -ftree-vrp -fno-tree-dce testcase.c
$ ./a.out 
Aborted

This fails on x86_64-pc-linux-gnu and aarch64-unknown-linux-gnu

$ 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-r15-2320-20240725090119-g3aeb697a215-checking-yes-rtl-df-extra-nobootstrap-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/15.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 --enable-libsanitizer
--disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r15-2320-20240725090119-g3aeb697a215-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 15.0.0 20240725 (experimental) (GCC)

[Bug ipa/116068] New: [15 Regression] ICE: in bitmap_alloc, at bitmap.cc:785 with -Os -flto -ffat-lto-objects -floop-parallelize-all

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

Bug ID: 116068
   Summary: [15 Regression] ICE: in bitmap_alloc, at bitmap.cc:785
with -Os -flto -ffat-lto-objects
-floop-parallelize-all
   Product: gcc
   Version: 15.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 58748
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=58748=edit
reduced testcase

Compiler output:
$ x86_64-pc-linux-gnu-gcc -Os -flto -ffat-lto-objects -floop-parallelize-all
-ftree-parallelize-loops=2 --param=parloops-schedule=dynamic testcase.c 
testcase.c: In function 'foo0._loopfn.0':
testcase.c:24:1: internal compiler error: in bitmap_alloc, at bitmap.cc:785
   24 | }
  | ^
0x2b38cee internal_error(char const*, ...)
/repo/gcc-trunk/gcc/diagnostic-global-context.cc:491
0xe4e87b fancy_abort(char const*, int, char const*)
/repo/gcc-trunk/gcc/diagnostic.cc:1725
0x7331aa bitmap_alloc(bitmap_obstack*)
/repo/gcc-trunk/gcc/bitmap.cc:785
0x16a7a36 walk_aliased_vdefs_1
/repo/gcc-trunk/gcc/tree-ssa-alias.cc:4038
0x16a7acf walk_aliased_vdefs(ao_ref*, tree_node*, bool (*)(ao_ref*, tree_node*,
void*), void*, bitmap_head**, bool*, unsigned int)
/repo/gcc-trunk/gcc/tree-ssa-alias.cc:4082
0x12aef59 ipa_polymorphic_call_context::get_dynamic_type(tree_node*,
tree_node*, tree_node*, gimple*, unsigned int*)
/repo/gcc-trunk/gcc/ipa-polymorphic-call.cc:1738
0x12ea221 ipa_compute_jump_functions_for_edge
/repo/gcc-trunk/gcc/ipa-prop.cc:2343
0x12ebbba ipa_compute_jump_functions_for_bb
/repo/gcc-trunk/gcc/ipa-prop.cc:2500
0x12ebbba analysis_dom_walker::before_dom_children(basic_block_def*)
/repo/gcc-trunk/gcc/ipa-prop.cc:3134
0x289b70e dom_walker::walk(basic_block_def*)
/repo/gcc-trunk/gcc/domwalk.cc:311
0x12e8859 ipa_analyze_node(cgraph_node*)
/repo/gcc-trunk/gcc/ipa-prop.cc:3203
0x1031fb0 symbol_table::call_cgraph_insertion_hooks(cgraph_node*)
/repo/gcc-trunk/gcc/cgraph.cc:385
0x104118a symbol_table::process_new_functions()
/repo/gcc-trunk/gcc/cgraphunit.cc:362
0x1041c3d symbol_table::process_new_functions()
/repo/gcc-trunk/gcc/cgraphunit.cc:304
0x1041c3d expand_all_functions
/repo/gcc-trunk/gcc/cgraphunit.cc:2064
0x1041c3d symbol_table::compile()
/repo/gcc-trunk/gcc/cgraphunit.cc:2404
0x1044607 symbol_table::compile()
/repo/gcc-trunk/gcc/cgraphunit.cc:2315
0x1044607 symbol_table::finalize_compilation_unit()
/repo/gcc-trunk/gcc/cgraphunit.cc:2589
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-r15-2241-20240724125158-g90597341095-checking-yes-rtl-df-extra-nobootstrap-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/15.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 --enable-libsanitizer
--disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r15-2241-20240724125158-g90597341095-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 15.0.0 20240724 (experimental) (GCC)

[Bug rtl-optimization/116067] New: [15 Regression] wrong code at -O2 related to -fext-dce

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

Bug ID: 116067
   Summary: [15 Regression] wrong code at -O2 related to -fext-dce
   Product: gcc
   Version: 15.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 58747
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=58747=edit
reduced testcase

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

The value is 0x2a2b2b2b2b2b2b2b2a

-fno-ext-dce fixes this problem.

Diff from OK to BAD shows one missing zero extension:
-   movzbl  %dil, %eax



$ 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-r15-2241-20240724125158-g90597341095-checking-yes-rtl-df-extra-nobootstrap-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/15.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 --enable-libsanitizer
--disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r15-2241-20240724125158-g90597341095-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 15.0.0 20240724 (experimental) (GCC)

[Bug rtl-optimization/116053] New: [14/15 Regression] during RTL pass: cprop_hardreg ICE: verify_flow_info failed: missing REG_EH_REGION note at the end of bb 2 with -O1 -finstrument-functions -fno-fo

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

Bug ID: 116053
   Summary: [14/15 Regression] during RTL pass: cprop_hardreg ICE:
verify_flow_info failed: missing REG_EH_REGION note at
the end of bb 2 with -O1 -finstrument-functions
-fno-forward-propagate -fno-delete-dead-exceptions
-fnon-call-exceptions
   Product: gcc
   Version: 15.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 58735
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=58735=edit
reduced testcase

Compiler output:
$ x86_64-pc-linux-gnu-gcc -O1 -finstrument-functions -fno-forward-propagate
-fno-delete-dead-exceptions -fnon-call-exceptions testcase.c
testcase.c: In function 'foo':
testcase.c:5:1: error: missing REG_EH_REGION note at the end of bb 2
5 | }
  | ^
during RTL pass: cprop_hardreg
testcase.c:5:1: internal compiler error: verify_flow_info failed
0x2b36e2e internal_error(char const*, ...)
/repo/gcc-trunk/gcc/diagnostic-global-context.cc:491
0x1000a7e verify_flow_info()
/repo/gcc-trunk/gcc/cfghooks.cc:287
0x1442057 execute_function_todo
/repo/gcc-trunk/gcc/passes.cc:2101
0x144258e execute_todo
/repo/gcc-trunk/gcc/passes.cc:2143
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-r15-2220-20240723105132-gb9cefd67a2a-checking-yes-rtl-df-extra-nobootstrap-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/15.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 --enable-libsanitizer
--disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r15-2220-20240723105132-gb9cefd67a2a-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 15.0.0 20240723 (experimental) (GCC)

[Bug rtl-optimization/116037] New: [15 Regression] wrong code at -O2 with vector masking and add

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

Bug ID: 116037
   Summary: [15 Regression] wrong code at -O2 with vector masking
and add
   Product: gcc
   Version: 15.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 58722
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=58722=edit
reduced testcase

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

The values are missing the bit 32 set.

$ 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-r15-2206-20240722194717-g6f81b7fa799-checking-yes-rtl-df-extra-nobootstrap-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/15.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 --enable-libsanitizer
--disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r15-2206-20240722194717-g6f81b7fa799-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 15.0.0 20240722 (experimental) (GCC)

[Bug tree-optimization/116034] [12/13/14/15 Regression] wrong code with memcpy() from _Complex unsigned short at -fno-strict-aliasing -O1 and above

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

--- Comment #6 from Zdenek Sojka  ---
(In reply to Sam James from comment #1)
> on godbolt, 6.5 looks OK, and 7.1 starts to fail for amd64.

My apologies; the results for gcc-6.5.0 and gcc-7.5.0 were not correct due to
linking errors. Indeed 6.5.0 works, and 7.5.0 fails.

[Bug rtl-optimization/53705] wrong code with custom flags - stores to memory are lost

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

Zdenek Sojka  changed:

   What|Removed |Added

  Known to work||10.5.0, 11.5.0, 6.5.0,
   ||7.5.0, 8.5.0, 9.5.0

--- Comment #4 from Zdenek Sojka  ---
This is not failing at least since 6.5.0

[Bug tree-optimization/48620] many libstdc++ tests FAIL with -m32 -fno-early-inlining -fipa-pta

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

Zdenek Sojka  changed:

   What|Removed |Added

  Known to work||10.5.0, 11.5.0, 6.5.0,
   ||7.5.0, 8.5.0, 9.5.0

--- Comment #5 from Zdenek Sojka  ---
This is not failing at least since 6.5.0

[Bug tree-optimization/116034] New: wrong code with memcpy() from _Complex unsigned short at -fno-strict-aliasing -O1 and above

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

Bug ID: 116034
   Summary: wrong code with memcpy() from _Complex unsigned short
at -fno-strict-aliasing -O1 and above
   Product: gcc
   Version: 15.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 58721
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=58721=edit
reduced testcase

Output:
$ x86_64-pc-linux-gnu-gcc -O1 -fno-strict-aliasing 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-r15-2206-20240722194717-g6f81b7fa799-checking-yes-rtl-df-extra-nobootstrap-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/15.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 --enable-libsanitizer
--disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r15-2206-20240722194717-g6f81b7fa799-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 15.0.0 20240722 (experimental) (GCC) 

This is also failing on aarch64-unknown-linux-gnu and
powerpc64le-unknown-linux-gnu, but it's OK on mips64el-unknown-linux-gnuabi64
and riscv64-unknown-linux-gnu.

[Bug middle-end/116003] New: [15 Regression] ICE: in register_initial_def, at value-relation.cc:610 with -O2 -fnon-call-exceptions -fprofile-arcs -finstrument-functions -fno-tree-copy-prop and _BitInt

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

Bug ID: 116003
   Summary: [15 Regression] ICE: in register_initial_def, at
value-relation.cc:610 with -O2 -fnon-call-exceptions
-fprofile-arcs -finstrument-functions
-fno-tree-copy-prop and _BitInt()
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: middle-end
  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 58707
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=58707=edit
reduced testcase

Compiler output:
$ x86_64-pc-linux-gnu-gcc -O2 -fnon-call-exceptions -fprofile-arcs
-finstrument-functions -fno-tree-copy-prop testcase.c 
during GIMPLE pass: bitintlower
testcase.c: In function 'foo':
testcase.c:7:1: internal compiler error: in register_initial_def, at
value-relation.cc:610
7 | foo(_BitInt(128) b128)
  | ^~~
0x2c30d40 internal_error(char const*, ...)
/repo/gcc-trunk/gcc/diagnostic-global-context.cc:491
0xe4ae0b fancy_abort(char const*, int, char const*)
/repo/gcc-trunk/gcc/diagnostic.cc:1725
0x8b98e1 equiv_oracle::register_initial_def(tree_node*)
/repo/gcc-trunk/gcc/value-relation.cc:610
0x198df22 equiv_oracle::record(basic_block_def*, relation_kind_t, tree_node*,
tree_node*)
/repo/gcc-trunk/gcc/value-relation.cc:647
0x29edc63 fold_using_range::range_of_phi(vrange&, gphi*, fur_source&)
/repo/gcc-trunk/gcc/gimple-range-fold.cc:999
0x29f14c0 fold_using_range::fold_stmt(vrange&, gimple*, fur_source&,
tree_node*)
/repo/gcc-trunk/gcc/gimple-range-fold.cc:670
0x29d7b49 gimple_ranger::fold_range_internal(vrange&, gimple*, tree_node*)
/repo/gcc-trunk/gcc/gimple-range.cc:277
0x29d7b49 gimple_ranger::prefill_stmt_dependencies(tree_node*)
/repo/gcc-trunk/gcc/gimple-range.cc:416
0x29d8a4a gimple_ranger::range_of_stmt(vrange&, gimple*, tree_node*)
/repo/gcc-trunk/gcc/gimple-range.cc:334
0x29da58a gimple_ranger::range_of_expr(vrange&, tree_node*, gimple*)
/repo/gcc-trunk/gcc/gimple-range.cc:142
0x29b150c range_to_prec
/repo/gcc-trunk/gcc/gimple-lower-bitint.cc:2180
0x29b681e handle_operand_addr
/repo/gcc-trunk/gcc/gimple-lower-bitint.cc:2383
0x29b6bfd lower_muldiv_stmt
/repo/gcc-trunk/gcc/gimple-lower-bitint.cc:3572
0x29ca40a gimple_lower_bitint
/repo/gcc-trunk/gcc/gimple-lower-bitint.cc:6930
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-r15-2152-20240719085347-gcea6473e48b-checking-yes-rtl-df-extra-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/15.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
--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 --enable-libsanitizer
--disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r15-2152-20240719085347-gcea6473e48b-checking-yes-rtl-df-extra-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 15.0.0 20240719 (experimental) (GCC)

[Bug c/66425] (void) cast doesn't suppress __attribute__((warn_unused_result))

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

--- Comment #75 from Zdenek Sojka  ---
(In reply to Florian Weimer from comment #74)
> (In reply to Zdenek Sojka from comment #73)
> > See MISRA C:2012 Rule 17.7:
> > "...  If the return value of a function is intended not to be used
> > explicitly, it should be cast to the void type. ..."
> > 
> > It would be helpful if gcc could be used to write MISRA-compliant code, or
> > at least if it wouldn't generate compilation warnings when the programmer is
> > targeting MISRA-compliancy.
> 
> Doesn't this (interpretation of MISRA) mean that compliant code cannot use
> __attribute__((warn_unused_result))? That doesn't require any GCC changes.

With the current state of things, yes. MISRA suggests adding the (void) cast,
that does not suppress the warning.

For me the ideal state would be to have a -Wwarn-any-unused-result, to consider
all functions as having the "__attribute__((__warn_unused_result__))"
attribute, with the option of (void) cast to suppress the warning.

Just the following sentence of the MISRA C:2012 explains the "(void)" cast as
the way of preventing dead code; the example from comment #72:

> if (foo()) {
>   /* The return value of foo can be ignored here because X and Y.  */
> }

creates a condition that needs to be covered, even though it might not be
possible to trigger either FALSE or TRUE outcome.

Of course there are other solutions (and possible justifications); I just
wanted to show that the (void) cast of unused function result might not be that
uncommon.

[Bug c/66425] (void) cast doesn't suppress __attribute__((warn_unused_result))

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

--- Comment #73 from Zdenek Sojka  ---
See MISRA C:2012 Rule 17.7:
"...  If the return value of a function is intended not to be used explicitly,
it should be cast to the void type. ..."

It would be helpful if gcc could be used to write MISRA-compliant code, or at
least if it wouldn't generate compilation warnings when the programmer is
targeting MISRA-compliancy.

I understand this might be a very complex topic, due to gcc being free
software, and other companies possibly providing / selling the tool
qualification.

[Bug middle-end/115887] New: ICE: in gsi_insert_on_edge_immediate, at gimple-iterator.cc:849 with -O -fnon-call-exceptions -finstrument-functions and _BitInt()

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

Bug ID: 115887
   Summary: ICE: in gsi_insert_on_edge_immediate, at
gimple-iterator.cc:849 with -O -fnon-call-exceptions
-finstrument-functions and _BitInt()
   Product: gcc
   Version: 15.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: middle-end
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
CC: jakub at gcc dot gnu.org
  Target Milestone: ---

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

Compiler output:
$ x86_64-pc-linux-gnu-gcc -O -fnon-call-exceptions -finstrument-functions
testcase.c
testcase.c: In function 'bar':
testcase.c:9:5: warning: division by zero [-Wdiv-by-zero]
9 |   b %= 0;
  | ^~
during GIMPLE pass: bitintlower
testcase.c: In function 'foo':
testcase.c:17:1: internal compiler error: in gsi_insert_on_edge_immediate, at
gimple-iterator.cc:849
   17 | foo()
  | ^~~
0x2a7433b internal_error(char const*, ...)
/repo/gcc-trunk/gcc/diagnostic-global-context.cc:491
0xe02337 fancy_abort(char const*, int, char const*)
/repo/gcc-trunk/gcc/diagnostic.cc:1725
0x78dfbd gsi_insert_on_edge_immediate(edge_def*, gimple*)
/repo/gcc-trunk/gcc/gimple-iterator.cc:849
0x282ab43 gimple_lower_bitint
/repo/gcc-trunk/gcc/gimple-lower-bitint.cc:6906
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-r15-1975-20240711091856-g4e0aa05f67c-checking-yes-rtl-df-extra-nobootstrap-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/15.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 --enable-libsanitizer
--disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r15-1975-20240711091856-g4e0aa05f67c-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 15.0.0 20240711 (experimental) (GCC)

[Bug target/115881] New: [15 Regression] ICE: RTL check: expected code 'reg', have 'subreg' in rhs_regno, at rtl.h:1934 with -O2 -mx32 -maddress-mode=long

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

Bug ID: 115881
   Summary: [15 Regression] ICE: RTL check: expected code 'reg',
have 'subreg' in rhs_regno, at rtl.h:1934 with -O2
-mx32 -maddress-mode=long
   Product: gcc
   Version: 15.0
Status: UNCONFIRMED
  Keywords: ice-checking
  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-gnux32

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

This might need RTL checking enabled.

Compiler output:
$ x86_64-pc-linux-gnu-gcc -O2 -mx32 -maddress-mode=long testcase.c
testcase.c: In function 'foo':
testcase.c:7:3: warning: '__builtin_memset' writing 940 bytes into a region of
size 4 overflows the destination [-Wstringop-overflow=]
7 |   __builtin_memset(, c, 940);
  |   ^~~~
testcase.c:6:7: note: destination object 'i' of size 4
6 |   int i;
  |   ^
during RTL pass: peephole2
testcase.c:9:1: internal compiler error: RTL check: expected code 'reg', have
'subreg' in rhs_regno, at rtl.h:1934
9 | }
  | ^
0x2a7433b internal_error(char const*, ...)
/repo/gcc-trunk/gcc/diagnostic-global-context.cc:491
0x8167b0 rtl_check_failed_code1(rtx_def const*, rtx_code, char const*, int,
char const*)
/repo/gcc-trunk/gcc/rtl.cc:770
0xc7f0e6 rhs_regno(rtx_def const*)
/repo/gcc-trunk/gcc/rtl.h:1934
0xd8470c rhs_regno(rtx_def const*)
/repo/gcc-trunk/gcc/config/i386/i386.md:1153
0xd8470c peephole2_36
/repo/gcc-trunk/gcc/config/i386/i386.md:27491
0x1487f14 peephole2_optimize
/repo/gcc-trunk/gcc/recog.cc:4229
0x1487f14 rest_of_handle_peephole2
/repo/gcc-trunk/gcc/recog.cc:4380
0x1487f14 execute
/repo/gcc-trunk/gcc/recog.cc:4417
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-r15-1975-20240711091856-g4e0aa05f67c-checking-yes-rtl-df-extra-nobootstrap-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/15.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 --enable-libsanitizer
--disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r15-1975-20240711091856-g4e0aa05f67c-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 15.0.0 20240711 (experimental) (GCC)

[Bug rtl-optimization/115879] New: ICE: verify_flow_info failed: missing REG_EH_REGION note at the end of bb 6 with -O -fnon-call-exceptions -finstrument-functions and _BitInt()

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

Bug ID: 115879
   Summary: ICE: verify_flow_info failed: missing REG_EH_REGION
note at the end of bb 6 with -O -fnon-call-exceptions
-finstrument-functions and _BitInt()
   Product: gcc
   Version: 15.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 58637
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=58637=edit
reduced testcase

Compiler output:
$ x86_64-pc-linux-gnu-gcc -O -fnon-call-exceptions -finstrument-functions
testcase.c
testcase.c: In function 'foo':
testcase.c:10:1: error: missing REG_EH_REGION note at the end of bb 6
   10 | }
  | ^
during RTL pass: subreg3
testcase.c:10:1: internal compiler error: verify_flow_info failed
0x2a7433b internal_error(char const*, ...)
/repo/gcc-trunk/gcc/diagnostic-global-context.cc:491
0xfb501e verify_flow_info()
/repo/gcc-trunk/gcc/cfghooks.cc:287
0x13f66b7 execute_function_todo
/repo/gcc-trunk/gcc/passes.cc:2101
0x13f6bee execute_todo
/repo/gcc-trunk/gcc/passes.cc:2143
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-r15-1975-20240711091856-g4e0aa05f67c-checking-yes-rtl-df-extra-nobootstrap-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/15.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 --enable-libsanitizer
--disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r15-1975-20240711091856-g4e0aa05f67c-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 15.0.0 20240711 (experimental) (GCC)

[Bug rtl-optimization/115877] New: [15 Regression] wrong code at -Os (missing zero extension)

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

Bug ID: 115877
   Summary: [15 Regression] wrong code at -Os (missing zero
extension)
   Product: gcc
   Version: 15.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 58636
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=58636=edit
reduced testcase

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

Diff between gcc-14 and gcc-15 asm shows the issue:
--- a-testcase-14.s  2024-07-11 20:52:55.198377811 +0200
+++ a-testcase.s 2024-07-11 20:53:00.808377734 +0200
@@ -8,7 +8,6 @@
.cfi_startproc
mov ax, WORD PTR u[rip]
not eax
-   movzx   eax, ax
sub edi, eax
movzx   eax, di
mov BYTE PTR a[rax], 1





$ 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-r15-1975-20240711091856-g4e0aa05f67c-checking-yes-rtl-df-extra-nobootstrap-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/15.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 --enable-libsanitizer
--disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r15-1975-20240711091856-g4e0aa05f67c-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 15.0.0 20240711 (experimental) (GCC)

[Bug tree-optimization/115753] New: tree check: expected ssa_name, have integer_cst in supportable_indirect_convert_operation, at tree-vect-stmts.cc:14680[15 Regression] ICE:

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

Bug ID: 115753
   Summary: tree check: expected ssa_name, have integer_cst in
supportable_indirect_convert_operation, at
tree-vect-stmts.cc:14680[15 Regression] ICE:
   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 58562
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=58562=edit
reduced testcase

Compiler output:
$ x86_64-pc-linux-gnu-gcc -O2 -frounding-math testcase.c 
during GIMPLE pass: slp
testcase.c: In function 'foo':
testcase.c:2:1: internal compiler error: tree check: expected ssa_name, have
integer_cst in supportable_indirect_convert_operation, at
tree-vect-stmts.cc:14680
2 | foo (void)
  | ^~~
0x2a68abb internal_error(char const*, ...)
/repo/gcc-trunk/gcc/diagnostic-global-context.cc:491
0x8a6ff4 tree_check_failed(tree_node const*, char const*, int, char const*,
...)
/repo/gcc-trunk/gcc/tree.cc:9001
0x898a80 tree_check(tree_node*, char const*, int, char const*, tree_code)
/repo/gcc-trunk/gcc/tree.h:3632
0x898a80 supportable_indirect_convert_operation(code_helper, tree_node*,
tree_node*, vec, va_heap, vl_ptr>*,
tree_node*)
/repo/gcc-trunk/gcc/tree-vect-stmts.cc:14680
0x17fb8d8 vectorizable_conversion
/repo/gcc-trunk/gcc/tree-vect-stmts.cc:5388
0x17fd2f8 vect_analyze_stmt(vec_info*, _stmt_vec_info*, bool*, _slp_tree*,
_slp_instance*, vec*)
/repo/gcc-trunk/gcc/tree-vect-stmts.cc:13307
0x18581ec vect_slp_analyze_node_operations_1
/repo/gcc-trunk/gcc/tree-vect-slp.cc:6537
0x18581ec vect_slp_analyze_node_operations
/repo/gcc-trunk/gcc/tree-vect-slp.cc:6736
0x185810f vect_slp_analyze_node_operations
/repo/gcc-trunk/gcc/tree-vect-slp.cc:6715
0x1859c5a vect_slp_analyze_operations(vec_info*)
/repo/gcc-trunk/gcc/tree-vect-slp.cc:7133
0x185ec88 vect_slp_analyze_bb_1
/repo/gcc-trunk/gcc/tree-vect-slp.cc:8144
0x185ec88 vect_slp_region
/repo/gcc-trunk/gcc/tree-vect-slp.cc:8191
0x1860e8c vect_slp_bbs
/repo/gcc-trunk/gcc/tree-vect-slp.cc:8402
0x1861410 vect_slp_function(function*)
/repo/gcc-trunk/gcc/tree-vect-slp.cc:8524
0x186ba81 execute
/repo/gcc-trunk/gcc/tree-vectorizer.cc:1534
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-r15-1762-20240702001736-g0b4fd672bf0-checking-yes-rtl-df-extra-nobootstrap-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/15.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 --enable-libsanitizer
--disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r15-1762-20240702001736-g0b4fd672bf0-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 15.0.0 20240702 (experimental) (GCC)

[Bug middle-end/115544] New: ICE: in lower_complexexpr_stmt, at gimple-lower-bitint.cc:4719 with -O -fno-tree-fre -fno-tree-ccp -fno-tree-forwprop and _BitInt() __builtin_mul_overflow()

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

Bug ID: 115544
   Summary: ICE: in lower_complexexpr_stmt, at
gimple-lower-bitint.cc:4719 with -O -fno-tree-fre
-fno-tree-ccp -fno-tree-forwprop and _BitInt()
__builtin_mul_overflow()
   Product: gcc
   Version: 15.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: middle-end
  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 58465
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=58465=edit
reduced testcase

Compiler output:
$ x86_64-pc-linux-gnu-gcc -O -fno-tree-fre -fno-tree-ccp -fno-tree-forwprop
testcase.c 
during GIMPLE pass: bitintlower
testcase.c: In function 'foo':
testcase.c:5:1: internal compiler error: in lower_complexexpr_stmt, at
gimple-lower-bitint.cc:4719
5 | foo()
  | ^~~
0xdad936 lower_complexexpr_stmt
/repo/gcc-trunk/gcc/gimple-lower-bitint.cc:4719
0xdad936 lower_stmt
/repo/gcc-trunk/gcc/gimple-lower-bitint.cc:5708
0x27cf3f1 gimple_lower_bitint
/repo/gcc-trunk/gcc/gimple-lower-bitint.cc:6926
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-r15-1418-20240618085924-gadadb5c7ba0-checking-yes-rtl-df-extra-nobootstrap-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/15.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 --enable-libsanitizer
--disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r15-1418-20240618085924-gadadb5c7ba0-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 15.0.0 20240618 (experimental) (GCC)

[Bug rtl-optimization/115407] New: [15 Regression] ICE: RTL flag check: CONSTANT_POOL_ADDRESS_P used with unexpected rtx code 'reg' in get_pool_constant, at varasm.cc:4046 with -O -mcmodel=large -mavx

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

Bug ID: 115407
   Summary: [15 Regression] ICE: RTL flag check:
CONSTANT_POOL_ADDRESS_P used with unexpected rtx code
'reg' in get_pool_constant, at varasm.cc:4046 with -O
-mcmodel=large -mavx512bw
   Product: gcc
   Version: 15.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: ---

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

Compiler output:
$ x86_64-pc-linux-gnu-gcc -O -mcmodel=large -mavx512bw testcase.c 
during RTL pass: split1
testcase.c: In function 'foo':
testcase.c:6:1: internal compiler error: RTL flag check:
CONSTANT_POOL_ADDRESS_P used with unexpected rtx code 'reg' in
get_pool_constant, at varasm.cc:4046
6 | }
  | ^
0x814a52 rtl_check_failed_flag(char const*, rtx_def const*, char const*, int,
char const*)
/repo/gcc-trunk/gcc/rtl.cc:853
0x8b8dec get_pool_constant(rtx_def const*)
/repo/gcc-trunk/gcc/varasm.cc:4046
0x1a0d17b ix86_broadcast_from_constant(machine_mode, rtx_def*)
/repo/gcc-trunk/gcc/config/i386/i386-expand.cc:612
0x1a337bb ix86_expand_ternlog(machine_mode, rtx_def*, rtx_def*, rtx_def*, int,
rtx_def*)
/repo/gcc-trunk/gcc/config/i386/i386-expand.cc:26045
0x20c4517 gen_split_1541(rtx_insn*, rtx_def**)
/repo/gcc-trunk/gcc/config/i386/sse.md:13050
0x26b8e98 split_79
/repo/gcc-trunk/gcc/config/i386/sse.md:14592
0x109a19a try_split(rtx_def*, rtx_insn*, int)
/repo/gcc-trunk/gcc/emit-rtl.cc:3941
0x146f6f8 split_insn
/repo/gcc-trunk/gcc/recog.cc:3405
0x1476595 split_all_insns()
/repo/gcc-trunk/gcc/recog.cc:3509
0x14766b8 execute
/repo/gcc-trunk/gcc/recog.cc:4433
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-r15-1122-20240609121028-g8bb6b2f4ae1-checking-yes-rtl-df-extra-nobootstrap-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/15.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 --enable-libsanitizer
--disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r15-1122-20240609121028-g8bb6b2f4ae1-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 15.0.0 20240609 (experimental) (GCC)

[Bug target/115406] New: [15 Regression] wrong code with vector compare at -O0 with -mavx512f

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

Bug ID: 115406
   Summary: [15 Regression] wrong code with vector compare at -O0
with -mavx512f
   Product: gcc
   Version: 15.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 58390
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=58390=edit
reduced testcase

Output:
$ x86_64-pc-linux-gnu-gcc -O0 testcase.c -mavx512f
$ ./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-r15-1122-20240609121028-g8bb6b2f4ae1-checking-yes-rtl-df-extra-nobootstrap-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/15.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 --enable-libsanitizer
--disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r15-1122-20240609121028-g8bb6b2f4ae1-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 15.0.0 20240609 (experimental) (GCC)

[Bug tree-optimization/115405] New: wrong code with _BitInt() sign-extension with -fno-strict-aliasing -O1 and above

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

Bug ID: 115405
   Summary: wrong code with _BitInt() sign-extension with
-fno-strict-aliasing -O1 and above
   Product: gcc
   Version: 15.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 58389
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=58389=edit
reduced testcase

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

I think the code should have defined behavior at least at -O1 or with
-fno-strict-aliasing.

$ 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-r15-1122-20240609121028-g8bb6b2f4ae1-checking-yes-rtl-df-extra-nobootstrap-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/15.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 --enable-libsanitizer
--disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r15-1122-20240609121028-g8bb6b2f4ae1-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 15.0.0 20240609 (experimental) (GCC)

[Bug rtl-optimization/115384] New: [15 Regression] ICE: RTL check: expected code 'const_int', have 'const_wide_int' in simplify_binary_operation_1, at simplify-rtx.cc:4088

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

Bug ID: 115384
   Summary: [15 Regression] ICE: RTL check: expected code
'const_int', have 'const_wide_int' in
simplify_binary_operation_1, at simplify-rtx.cc:4088
   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 58379
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=58379=edit
reduced testcase

This might need RTL checking enabled.

Compiler output:
$ x86_64-pc-linux-gnu-gcc -O testcase.c 
during RTL pass: dse1
testcase.c: In function 'foo':
testcase.c:9:1: internal compiler error: RTL check: expected code 'const_int',
have 'const_wide_int' in simplify_binary_operation_1, at simplify-rtx.cc:4088
9 | }
  | ^
0x8132d6 rtl_check_failed_code1(rtx_def const*, rtx_code, char const*, int,
char const*)
/repo/gcc-trunk/gcc/rtl.cc:770
0x824c92 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:4088
0x14fb9ad simplify_context::simplify_binary_operation(rtx_code, machine_mode,
rtx_def*, rtx_def*)
/repo/gcc-trunk/gcc/simplify-rtx.cc:2682
0x14fc6fc simplify_binary_operation(rtx_code, machine_mode, rtx_def*, rtx_def*)
/repo/gcc-trunk/gcc/rtl.h:3493
0x14fc6fc simplify_rtx(rtx_def const*)
/repo/gcc-trunk/gcc/simplify-rtx.cc:8111
0xff4a2f cselib_expand_value_rtx_1
/repo/gcc-trunk/gcc/cselib.cc:2128
0xff4044 expand_loc
/repo/gcc-trunk/gcc/cselib.cc:1756
0xff48d4 cselib_expand_value_rtx_1
/repo/gcc-trunk/gcc/cselib.cc:1919
0xff5c86 cselib_expand_value_rtx(rtx_def*, bitmap_head*, int)
/repo/gcc-trunk/gcc/cselib.cc:1816
0x276ffe0 record_store
/repo/gcc-trunk/gcc/dse.cc:1511
0x277266b scan_insn
/repo/gcc-trunk/gcc/dse.cc:2691
0x277266b dse_step1
/repo/gcc-trunk/gcc/dse.cc:2808
0x277266b rest_of_handle_dse
/repo/gcc-trunk/gcc/dse.cc:3725
0x277266b execute
/repo/gcc-trunk/gcc/dse.cc:3798
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-r15-1093-20240607103208-ga47b1aaa7a7-checking-yes-rtl-df-extra-nobootstrap-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/15.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 --enable-libsanitizer
--disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r15-1093-20240607103208-ga47b1aaa7a7-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 15.0.0 20240607 (experimental) (GCC)

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

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

Bug ID: 115352
   Summary: wrong code with _BitInt() __builtin_sub_overflow_p()
at -O0
   Product: gcc
   Version: 15.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 58350
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=58350=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-r15-1014-20240604161649-g591d30c5c97-checking-yes-rtl-df-extra-nobootstrap-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/15.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 --enable-libsanitizer
--disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r15-1014-20240604161649-g591d30c5c97-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 15.0.0 20240604 (experimental) (GCC)

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

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

Bug ID: 115337
   Summary: wrong code with _BitInt()
__builtin_stdc_first_leading_one() at -O2
   Product: gcc
   Version: 15.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 58338
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=58338=edit
reduced testcase

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-r15-929-20240530161758-g46d931b3dd3-checking-yes-rtl-df-extra-nobootstrap-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/15.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 --enable-libsanitizer
--disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r15-929-20240530161758-g46d931b3dd3-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 15.0.0 20240530 (experimental) (GCC)

[Bug rtl-optimization/115051] New: ICE: RTL check: expected elt 2 type 'B', have '0' (rtx barrier) in BLOCK_FOR_INSN, at rtl.h:1495 with -O -finstrument-functions-once -finline-stringops -fprofile-use

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

Bug ID: 115051
   Summary: ICE: RTL check: expected elt 2 type 'B', have '0' (rtx
barrier) in BLOCK_FOR_INSN, at rtl.h:1495 with -O
-finstrument-functions-once -finline-stringops
-fprofile-use
   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: aarch64-unknown-linux-gnu

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

Compiler output:
$ aarch64-unknown-linux-gnu-gcc -O -finstrument-functions-once
-finline-stringops -fprofile-use testcase.c -w
during RTL pass: expand
testcase.c: In function 'foo':
testcase.c:11:1: internal compiler error: RTL check: expected elt 2 type 'B',
have '0' (rtx barrier) in BLOCK_FOR_INSN, at rtl.h:1495
   11 | }
  | ^
0x864446 rtl_check_failed_type1(rtx_def const*, int, int, char const*, int,
char const*)
/repo/gcc-trunk/gcc/rtl.cc:751
0x7b242f BLOCK_FOR_INSN(rtx_def*)
/repo/gcc-trunk/gcc/rtl.h:1495
0x7b5d1c BLOCK_FOR_INSN(rtx_def*)
/repo/gcc-trunk/gcc/emit-rtl.cc:4384
0x7b5d1c set_block_for_insn(rtx_insn*, basic_block_def*)
/repo/gcc-trunk/gcc/rtl.h:1500
0x7b5d1c add_insn_before(rtx_insn*, rtx_insn*, basic_block_def*)
/repo/gcc-trunk/gcc/emit-rtl.cc:4379
0xeaf750 emit_pattern_before_noloc
/repo/gcc-trunk/gcc/emit-rtl.cc:4647
0xdd034d commit_one_edge_insertion(edge_def*)
/repo/gcc-trunk/gcc/cfgrtl.cc:2106
0xdd5671 commit_edge_insertions()
/repo/gcc-trunk/gcc/cfgrtl.cc:2168
0xdb5b4b execute
/repo/gcc-trunk/gcc/cfgexpand.cc:6959
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-r15-380-20240511175912-g1b0919cd147-checking-yes-rtl-df-extra-nobootstrap-aarch64/bin/../libexec/gcc/aarch64-unknown-linux-gnu/15.0.0/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
--disable-bootstrap --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 --enable-libsanitizer
--disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r15-380-20240511175912-g1b0919cd147-checking-yes-rtl-df-extra-nobootstrap-aarch64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 15.0.0 20240509 (experimental) (GCC)

[Bug tree-optimization/114799] New: [14 Regression] ICE: tree check: expected class 'type', have 'exceptional' (error_mark) in useless_type_conversion_p, at gimple-expr.cc:85 with -O2 -fno-tree-forwpr

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

Bug ID: 114799
   Summary: [14 Regression] ICE: tree check: expected class
'type', have 'exceptional' (error_mark) in
useless_type_conversion_p, at gimple-expr.cc:85 with
-O2 -fno-tree-forwprop -fvect-cost-model=unlimited
   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 58004
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=58004=edit
reduced testcase

Compiler output:
$ x86_64-pc-linux-gnu-gcc -O2 -fno-tree-forwprop -fvect-cost-model=unlimited
testcase.c -Wno-psabi
during GIMPLE pass: slp
testcase.c: In function 'foo':
testcase.c:17:1: internal compiler error: tree check: expected class 'type',
have 'exceptional' (error_mark) in useless_type_conversion_p, at
gimple-expr.cc:85
   17 | foo (void)
  | ^~~
0x894e6f tree_class_check_failed(tree_node const*, tree_code_class, char
const*, int, char const*)
/repo/gcc-trunk/gcc/tree.cc:9006
0x77ef52 tree_class_check(tree_node*, tree_code_class, char const*, int, char
const*)
/repo/gcc-trunk/gcc/tree.h:3779
0x77ef52 useless_type_conversion_p(tree_node*, tree_node*)
/repo/gcc-trunk/gcc/gimple-expr.cc:85
0x155c516 verify_gimple_assign_single
/repo/gcc-trunk/gcc/tree-cfg.cc:4791
0x155c516 verify_gimple_assign
/repo/gcc-trunk/gcc/tree-cfg.cc:4843
0x155c516 verify_gimple_stmt
/repo/gcc-trunk/gcc/tree-cfg.cc:5108
0x155fd01 verify_gimple_in_cfg(function*, bool, bool)
/repo/gcc-trunk/gcc/tree-cfg.cc:5603
0x13ced14 execute_function_todo
/repo/gcc-trunk/gcc/passes.cc:2089
0x13cf26e execute_todo
/repo/gcc-trunk/gcc/passes.cc:2143
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-10062-20240422092604-gec78916bb37-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 --enable-libsanitizer
--disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r14-10062-20240422092604-gec78916bb37-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.1 20240422 (experimental) (GCC)

[Bug libgcc/114762] wrong code with _BitInt() division by "BITINT_NN_MIN"

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

--- Comment #1 from Zdenek Sojka  ---
Created attachment 57981
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57981=edit
testcase trying reasonable input for division (and multiplication)

This can be used to test various input combinations. It might be reasonable to
try both -O0 and -O3.

$ x86_64-pc-linux-gnu-gcc tg.c -O0 -fsanitize=undefined -g3 -static && ./a.out 
1 0
Floating point exception

$ aarch64-unknown-linux-gnu-gcc tg.c -O3 -static && qemu-aarch64 -- ./a.out 
1 0
2 0
2 1
3 0
...
62 57
62 58
62 59
62 60
62 61
63 0
a.out: tg.c:35: divmod: Assertion `q * sb + r == sa' failed.
qemu: uncaught target signal 6 (Aborted) - core dumped
Aborted

No warranty for code correctness.

[Bug libgcc/114762] New: wrong code with _BitInt() division by "BITINT_NN_MIN"

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

Bug ID: 114762
   Summary: wrong code with _BitInt() division by "BITINT_NN_MIN"
   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
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu

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

Output:
$ x86_64-pc-linux-gnu-gcc testcase.c
$ ./a.out 
Floating point exception

Program received signal SIGFPE, Arithmetic exception.
0x00401dc1 in __divmodbitint4 (q=0x7fffd7a0, qprec=,
r=0x0, rprec=, 
u=, uprec=64, v=0x7fffd780, vprec=) at
/repo/gcc-trunk/libgcc/libgcc2.c:1866
1866vv = 1 / vv; /* Divide intentionally by zero.  */


$ 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-9960-20240415001639-gfe99ab1f5e9-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 --enable-libsanitizer
--disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r14-9960-20240415001639-gfe99ab1f5e9-checking-yes-rtl-df-extra-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.1 20240415 (experimental) (GCC)

[Bug libgcc/114755] New: wrong code with _BitInt() modulo at -O0 on aarch64

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

Bug ID: 114755
   Summary: wrong code with _BitInt() modulo at -O0 on aarch64
   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: aarch64-unknown-linux-gnu

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

Output:
$ aarch64-unknown-linux-gnu-gcc testcase.c -O0 -static
$ qemu-aarch64 -- ./a.out 
qemu: uncaught target signal 6 (Aborted) - core dumped
Aborted

$ 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-10007-20240417161722-g57056146f4f-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 --enable-libsanitizer
--disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r14-10007-20240417161722-g57056146f4f-checking-yes-rtl-df-extra-aarch64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.1 20240417 (experimental) (GCC)

[Bug target/114696] New: ICE: in extract_constrain_insn_cached, at recog.cc:2725 insn does not satisfy its constraints: {*anddi_1} with -mapxf -mx32

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

Bug ID: 114696
   Summary: ICE: in extract_constrain_insn_cached, at
recog.cc:2725 insn does not satisfy its constraints:
{*anddi_1} with -mapxf -mx32
   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 57930
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57930=edit
reduced testcase

Compiler output:
$ x86_64-pc-linux-gnu-gcc -mapxf -mx32 testcase.c 
testcase.c: In function 'foo':
testcase.c:8:1: error: insn does not satisfy its constraints:
8 | }
  | ^
(insn 43 42 44 2 (parallel [
(set (reg:DI 1 dx [+8 ])
(and:DI (mem/c:DI (plus:SI (reg:SI 4 si [110])
(const_int 8 [0x8])) [1 a+8 S8 A64 AS1])
(const_int 1 [0x1])))
(clobber (reg:CC 17 flags))
]) "testcase.c":7:7 613 {*anddi_1}
 (nil))
during RTL pass: shorten
testcase.c:8:1: internal compiler error: in extract_constrain_insn_cached, at
recog.cc:2725
0x808789 _fatal_insn(char const*, rtx_def const*, char const*, int, char
const*)
/repo/gcc-trunk/gcc/rtl-error.cc:108
0x808810 _fatal_insn_not_found(rtx_def const*, char const*, int, char const*)
/repo/gcc-trunk/gcc/rtl-error.cc:118
0x7f8fbf extract_constrain_insn_cached(rtx_insn*)
/repo/gcc-trunk/gcc/recog.cc:2725
0x1dce737 get_attr_modrm(rtx_insn*)
/repo/gcc-trunk/gcc/config/i386/i386.md:759
0x1dd2bb7 insn_default_length(rtx_insn*)
/repo/gcc-trunk/gcc/config/i386/i386.md:785
0x10e00ee shorten_branches(rtx_insn*)
/repo/gcc-trunk/gcc/final.cc:1089
0x10e022f rest_of_handle_shorten_branches
/repo/gcc-trunk/gcc/final.cc:4335
0x10e022f execute
/repo/gcc-trunk/gcc/final.cc:4364
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-9911-2024040356-g52b63100b1e-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 --enable-libsanitizer
--disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r14-9911-2024040356-g52b63100b1e-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.1 20240411 (experimental) (GCC)

[Bug ipa/114681] New: ICE: in as_a, at is-a.h:255 with -O -fnon-call-exceptions -fno-exceptions -fcondition-coverage

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

Bug ID: 114681
   Summary: ICE: in as_a, at is-a.h:255 with -O
-fnon-call-exceptions -fno-exceptions
-fcondition-coverage
   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 57923
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57923=edit
reduced testcase

Compiler output:
$ x86_64-pc-linux-gnu-gcc -O -fnon-call-exceptions -fno-exceptions
-fcondition-coverage testcase.c
during IPA pass: inline
testcase.c: In function 'foo':
testcase.c:14:3: internal compiler error: in as_a, at is-a.h:255
   14 |   bar ();
  |   ^~
0x83b2a0 geh_filter const* as_a(gimple const*)
/repo/gcc-trunk/gcc/is-a.h:255
0x83ee63 gcond* as_a(gimple*)
/repo/gcc-trunk/gcc/hash-set.h:64
0x83ee63 copy_bb
/repo/gcc-trunk/gcc/tree-inline.cc:2096
0x15a31aa copy_cfg_body
/repo/gcc-trunk/gcc/tree-inline.cc:3087
0x15a31aa copy_body
/repo/gcc-trunk/gcc/tree-inline.cc:3340
0x15a810e expand_call_inline
/repo/gcc-trunk/gcc/tree-inline.cc:5143
0x15a9a49 gimple_expand_calls_inline
/repo/gcc-trunk/gcc/tree-inline.cc:5343
0x15a9a49 optimize_inline_calls(tree_node*)
/repo/gcc-trunk/gcc/tree-inline.cc:5515
0x12426bb inline_transform(cgraph_node*)
/repo/gcc-trunk/gcc/ipa-inline-transform.cc:792
0x13d14f6 execute_one_ipa_transform_pass
/repo/gcc-trunk/gcc/passes.cc:2334
0x13d14f6 execute_all_ipa_transforms(bool)
/repo/gcc-trunk/gcc/passes.cc:2397
0xfcea7d cgraph_node::expand()
/repo/gcc-trunk/gcc/cgraphunit.cc:1838
0xfcea7d cgraph_node::expand()
/repo/gcc-trunk/gcc/cgraphunit.cc:1798
0xfcfdfa expand_all_functions
/repo/gcc-trunk/gcc/cgraphunit.cc:2028
0xfcfdfa symbol_table::compile()
/repo/gcc-trunk/gcc/cgraphunit.cc:2404
0xfd2977 symbol_table::compile()
/repo/gcc-trunk/gcc/cgraphunit.cc:2315
0xfd2977 symbol_table::finalize_compilation_unit()
/repo/gcc-trunk/gcc/cgraphunit.cc:2589
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-9885-20240410075703-g109f1b28fc9-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 --enable-libsanitizer
--disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r14-9885-20240410075703-g109f1b28fc9-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.1 20240410 (experimental) (GCC)

[Bug tree-optimization/114672] New: during GIMPLE pass: widening_mul ICE: verify_gimple failed: type mismatch in 'widen_mult_plus_expr' at -O2

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

Bug ID: 114672
   Summary: during GIMPLE pass: widening_mul ICE: verify_gimple
failed: type mismatch in 'widen_mult_plus_expr' 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
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: aarch64-unknown-linux-gnu

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

Compiler output:
$ aarch64-unknown-linux-gnu-gcc -O2 testcase.c 
testcase.c: In function 'foo':
testcase.c:9:1: error: type mismatch in 'widen_mult_plus_expr'
9 | foo ()
  | ^~~

signed int
signed int

_8 = WIDEN_MULT_PLUS_EXPR <_11, _12, _1>;
during GIMPLE pass: widening_mul
testcase.c:9:1: internal compiler error: verify_gimple failed
0x1396f9d verify_gimple_in_cfg(function*, bool, bool)
/repo/gcc-trunk/gcc/tree-cfg.cc:5663
0x1202df4 execute_function_todo
/repo/gcc-trunk/gcc/passes.cc:2089
0x120334e execute_todo
/repo/gcc-trunk/gcc/passes.cc:2143
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-9877-20240409180605-g1f719aa7c0d-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 --enable-libsanitizer
--disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r14-9877-20240409180605-g1f719aa7c0d-checking-yes-rtl-df-extra-aarch64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.1 20240409 (experimental) (GCC)

[Bug tree-optimization/114644] New: wrong -Wrestrict on snprintf() of distinct struct array members

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

Bug ID: 114644
   Summary: wrong -Wrestrict on snprintf() of distinct struct
array members
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: diagnostic
  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 57905
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57905=edit
testcase

Output:
$ gcc-14 -Wall res.c -c
res.c: In function ‘f2’:
res.c:4:25: warning: ‘__builtin_snprintf’ argument 4 overlaps destination
object ‘s’ [-Wrestrict]
4 | void f2(int i, int j) { __builtin_snprintf(s[i].a, 10, "%s", s[j].b); }
  | ^~~~
res.c:1:31: note: destination object referenced by ‘restrict’-qualified
argument 1 was declared here
1 | struct { char a[10], b[10]; } s[10];
  |   ^


as far as I can tell, there should be no warning for snprintf(), as there is no
warning for the other functions. I checked all the PRs in PR84774 and didn't
find any this would be duplication.
Of course I am not a language lawyer, so my understanding of 'restrict' might
be incorrect; but the warning is at least inconsistent:
- only snprintf() warns
- the s[] must be an array
- both i/j indices must be variables
- -Wrestrict alone is not enough to trigger this -Wrestrict warning at -O0

[Bug gcov-profile/114601] ICE: SIGSEGV in hash_table_mod1 (hash-table.h:344) with -fcondition-coverage -finstrument-functions-once

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

--- Comment #1 from Zdenek Sojka  ---
This is still failing as of r14-9822 (after the second PR114599#c7 fix).

[Bug target/114621] New: ICE: in extract_insn, at recog.cc:2812 (unrecognizable insn) with -O -fpie and _Thread_local with large offset

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

Bug ID: 114621
   Summary: ICE: in extract_insn, at recog.cc:2812 (unrecognizable
insn) with -O -fpie and _Thread_local with large
offset
   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 57893
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57893=edit
reduced testcase

Compiler output:
$ x86_64-pc-linux-gnu-gcc -O -fpie testcase.c
testcase.c: In function 'foo':
testcase.c:8:1: error: unrecognizable insn:
8 | }
  | ^
(insn 6 5 7 2 (set (reg:DI 106)
(const:DI (plus:DI (unspec:DI [
(symbol_ref:DI ("b") [flags 0x2a] )
] UNSPEC_NTPOFF)
(const_int 34359738367 [0x7] "testcase.c":7:10 -1
 (nil))
during RTL pass: vregs
testcase.c:8:1: internal compiler error: in extract_insn, at recog.cc:2812
0x80873f _fatal_insn(char const*, rtx_def const*, char const*, int, char
const*)
/repo/gcc-trunk/gcc/rtl-error.cc:108
0x8087bc _fatal_insn_not_found(rtx_def const*, char const*, int, char const*)
/repo/gcc-trunk/gcc/rtl-error.cc:116
0x7f762b extract_insn(rtx_insn*)
/repo/gcc-trunk/gcc/recog.cc:2812
0x11329cd instantiate_virtual_regs_in_insn
/repo/gcc-trunk/gcc/function.cc:1612
0x11329cd instantiate_virtual_regs
/repo/gcc-trunk/gcc/function.cc:1995
0x11329cd execute
/repo/gcc-trunk/gcc/function.cc:2042
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-9803-20240405111321-g9ab8fdfeef5-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 --enable-libsanitizer
--disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r14-9803-20240405111321-g9ab8fdfeef5-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.1 20240405 (experimental) (GCC)

[Bug gcov-profile/114601] New: ICE: SIGSEGV in hash_table_mod1 (hash-table.h:344) with -fcondition-coverage -finstrument-functions-once

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

Bug ID: 114601
   Summary: ICE: SIGSEGV in hash_table_mod1 (hash-table.h:344)
with -fcondition-coverage -finstrument-functions-once
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: gcov-profile
  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 happens also after the PR114599 fix.

Compiler output:
$ cat testcase.c 
void foo() {}
$ x86_64-pc-linux-gnu-gcc -fcondition-coverage -finstrument-functions-once
testcase.c -wrapper valgrind,-q
==25248== Invalid read of size 4
==25248==at 0x15FBA4A: hash_table_mod1 (hash-table.h:344)
==25248==by 0x15FBA4A: hash_table, unsigned int> >::hash_entry,
false, xcallocator>::find_with_hash(gcond* const&, unsigned int)
(hash-table.h:985)
==25248==by 0x15F9C4B: get (hash-map.h:191)
==25248==by 0x15F9C4B: condition_uid (tree-profile.cc:370)
==25248==by 0x15F9C4B: find_conditions(function*) (tree-profile.cc:877)
==25248==by 0x140DBD3: branch_prob(bool) (profile.cc:1549)
==25248==by 0x15F92A4: tree_profiling (tree-profile.cc:1917)
==25248==by 0x15F92A4: (anonymous
namespace)::pass_ipa_tree_profile::execute(function*) (tree-profile.cc:2046)
==25248==by 0x13D0F7A: execute_one_pass(opt_pass*) (passes.cc:2647)
==25248==by 0x13D2346: execute_ipa_pass_list(opt_pass*) (passes.cc:3096)
==25248==by 0xFCFEC7: ipa_passes (cgraphunit.cc:2214)
==25248==by 0xFCFEC7: symbol_table::compile() [clone .part.0]
(cgraphunit.cc:2337)
==25248==by 0xFD2747: compile (cgraphunit.cc:2315)
==25248==by 0xFD2747: symbol_table::finalize_compilation_unit()
(cgraphunit.cc:2589)
==25248==by 0x15135E1: compile_file() (toplev.cc:476)
==25248==by 0xDE841B: do_compile (toplev.cc:2154)
==25248==by 0xDE841B: toplev::main(int, char**) (toplev.cc:2310)
==25248==by 0xDE9BFA: main (main.cc:39)
==25248==  Address 0x30 is not stack'd, malloc'd or (recently) free'd
==25248== 
during IPA pass: profile
testcase.c: In function 'foo':
testcase.c:1:1: internal compiler error: Segmentation fault
1 | void foo() {}
  | ^~~~
0x15130ff crash_signal
/repo/gcc-trunk/gcc/toplev.cc:319
0x15fba4a hash_table_mod1(unsigned int, unsigned int)
/repo/gcc-trunk/gcc/hash-table.h:344
0x15fba4a hash_table, unsigned int> >::hash_entry,
false, xcallocator>::find_with_hash(gcond* const&, unsigned int)
/repo/gcc-trunk/gcc/hash-table.h:985
0x15f9c4b hash_map, unsigned int> >::get(gcond*
const&)
/repo/gcc-trunk/gcc/hash-map.h:191
0x15f9c4b condition_uid
/repo/gcc-trunk/gcc/tree-profile.cc:370
0x15f9c4b find_conditions(function*)
/repo/gcc-trunk/gcc/tree-profile.cc:877
0x140dbd3 branch_prob(bool)
/repo/gcc-trunk/gcc/profile.cc:1549
0x15f92a4 tree_profiling
/repo/gcc-trunk/gcc/tree-profile.cc:1917
0x15f92a4 execute
/repo/gcc-trunk/gcc/tree-profile.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.

$ 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-9803-20240405111321-g9ab8fdfeef5-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 --enable-libsanitizer
--disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r14-9803-20240405111321-g9ab8fdfeef5-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.1 20240405 (experimental) (GCC)

[Bug ipa/114599] New: ICE: SIGSEGV in bitmap_set_bit(bitmap_head*, int) (bitmap.cc:975) with -O2 -fcondition-coverage

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

Bug ID: 114599
   Summary: ICE: SIGSEGV in bitmap_set_bit(bitmap_head*, int)
(bitmap.cc:975) with -O2 -fcondition-coverage
   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 57884
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57884=edit
reduced testcase

Compiler output:
$ x86_64-pc-linux-gnu-gcc -O2 -fcondition-coverage testcase.c -wrapper
valgrind,-q
==26792== Invalid write of size 4
==26792==at 0xF3D16E: bitmap_set_bit(bitmap_head*, int) (bitmap.cc:975)
==26792==by 0xFB61F3: symtab_node::check_ifunc_callee_symtab_nodes()
(symtab.cc:1449)
==26792==by 0xFCF454: symbol_table::compile() [clone .part.0]
(cgraphunit.cc:2320)
==26792==by 0xFD2797: compile (cgraphunit.cc:2315)
==26792==by 0xFD2797: symbol_table::finalize_compilation_unit()
(cgraphunit.cc:2589)
==26792==by 0x1513631: compile_file() (toplev.cc:476)
==26792==by 0xDE845B: do_compile (toplev.cc:2154)
==26792==by 0xDE845B: toplev::main(int, char**) (toplev.cc:2310)
==26792==by 0xDE9C3A: main (main.cc:39)
==26792==  Address 0x527a330 is 32 bytes inside a block of size 65,536 alloc'd
==26792==at 0x483E804: malloc (vg_replace_malloc.c:442)
==26792==by 0x2AA5B4B: xmalloc (xmalloc.c:149)
==26792==by 0x2AA2384: call_chunkfun (obstack.c:94)
==26792==by 0x2AA2384: _obstack_begin_worker (obstack.c:141)
==26792==by 0xFD0EDE: analyze_functions(bool) (cgraphunit.cc:1172)
==26792==by 0xFD272D: symbol_table::finalize_compilation_unit()
(cgraphunit.cc:2560)
==26792==by 0x1513631: compile_file() (toplev.cc:476)
==26792==by 0xDE845B: do_compile (toplev.cc:2154)
==26792==by 0xDE845B: toplev::main(int, char**) (toplev.cc:2310)
==26792==by 0xDE9C3A: main (main.cc:39)
...
during IPA pass: profile
testcase.c: In function 'do_all_fn_LHASH_DOALL_ARG_arg2':
testcase.c:16:1: internal compiler error: Segmentation fault
   16 | }
  | ^
0x151314f crash_signal
/repo/gcc-trunk/gcc/toplev.cc:319
0x15fba9a hash_table_mod1(unsigned int, unsigned int)
/repo/gcc-trunk/gcc/hash-table.h:344
0x15fba9a hash_table, unsigned int> >::hash_entry,
false, xcallocator>::find_with_hash(gcond* const&, unsigned int)
/repo/gcc-trunk/gcc/hash-table.h:985
0x15f9c9b hash_map, unsigned int> >::get(gcond*
const&)
/repo/gcc-trunk/gcc/hash-map.h:191
0x15f9c9b condition_uid
/repo/gcc-trunk/gcc/tree-profile.cc:370
0x15f9c9b find_conditions(function*)
/repo/gcc-trunk/gcc/tree-profile.cc:877
0x140dc23 branch_prob(bool)
/repo/gcc-trunk/gcc/profile.cc:1549
0x15f92f4 tree_profiling
/repo/gcc-trunk/gcc/tree-profile.cc:1917
0x15f92f4 execute
/repo/gcc-trunk/gcc/tree-profile.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.

$ 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-9799-20240405035546-g4c8b3600c48-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 --enable-libsanitizer
--disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r14-9799-20240405035546-g4c8b3600c48-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.1 20240405 (experimental) (GCC)

[Bug tree-optimization/114555] ICE: definition in block 14 does not dominate use in block 15 at -O and above with _BitInt() bitfield

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

--- Comment #1 from Zdenek Sojka  ---
Created attachment 57860
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57860=edit
another testcase, failing with -O -fno-tree-forwprop

Compiler output:
$ x86_64-pc-linux-gnu-gcc -O -fno-tree-forwprop testcase2.c 
testcase2.c: In function 'foo':
testcase2.c:9:1: error: definition in block 14 does not dominate use in block
15
9 | foo(void)
  | ^~~
for SSA_NAME: _17 in statement:
_16 = PHI <_15(2), _17(15)>
PHI argument
_17
for PHI node
_16 = PHI <_15(2), _17(15)>
during GIMPLE pass: bitintlower
testcase2.c:9:1: internal compiler error: verify_ssa failed
0x177b02f verify_ssa(bool, bool)
/repo/gcc-trunk/gcc/tree-ssa.cc:1203
0x13cc2c5 execute_function_todo
/repo/gcc-trunk/gcc/passes.cc:2095
0x13cc72e 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  for instructions.

[Bug tree-optimization/114555] New: ICE: definition in block 14 does not dominate use in block 15 at -O and above with _BitInt() bitfield

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

Bug ID: 114555
   Summary: ICE: definition in block 14 does not dominate use in
block 15 at -O and above with _BitInt() bitfield
   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 57843
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57843=edit
reduced testcase

Compiler output:
$ x86_64-pc-linux-gnu-gcc -O testcase.c 
testcase.c: In function 'foo':
testcase.c:10:1: error: definition in block 14 does not dominate use in block
15
   10 | foo (void)
  | ^~~
for SSA_NAME: _15 in statement:
_14 = PHI <_13(2), _15(15)>
PHI argument
_15
for PHI node
_14 = PHI <_13(2), _15(15)>
during GIMPLE pass: bitintlower
testcase.c:10:1: internal compiler error: verify_ssa failed
0x17913a0 verify_ssa(bool, bool)
/repo/gcc-trunk/gcc/tree-ssa.cc:1203
0x13d19e5 execute_function_todo
/repo/gcc-trunk/gcc/passes.cc:2095
0x13d1e4e 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-9731-20240331183750-gb313baba57f-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 --enable-libsanitizer
--disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r14-9731-20240331183750-gb313baba57f-checking-yes-rtl-df-extra-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.1 20240331 (experimental) (GCC)

[Bug analyzer/114473] New: [13/14 Regression] ICE: in deref_rvalue, at analyzer/region-model.cc:2780 with -fanalyzer -fanalyzer-call-summaries

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

Bug ID: 114473
   Summary: [13/14 Regression] ICE: in deref_rvalue, at
analyzer/region-model.cc:2780 with -fanalyzer
-fanalyzer-call-summaries
   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 57814
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57814=edit
reduced testcase

Compiler output:
$ x86_64-pc-linux-gnu-gcc -fanalyzer -fanalyzer-call-summaries testcase.c 
during IPA pass: analyzer
testcase.c: In function 'foo':
testcase.c:26:3: internal compiler error: in deref_rvalue, at
analyzer/region-model.cc:2780
   26 |   bar (q);
  |   ^~~
0x8c5153 ana::region_model::deref_rvalue(ana::svalue const*, tree_node*,
ana::region_model_context*, bool) const
/repo/gcc-trunk/gcc/analyzer/region-model.cc:2780
0x28c742a ana::call_summary_replay::convert_region_from_summary(ana::region
const*)
/repo/gcc-trunk/gcc/analyzer/call-summary.cc:553
0x19c44ca ana::store::replay_call_summary_cluster(ana::call_summary_replay&,
ana::store const&, ana::region const*)
/repo/gcc-trunk/gcc/analyzer/store.cc:3338
0x19c4734 ana::store::replay_call_summary(ana::call_summary_replay&, ana::store
const&)
/repo/gcc-trunk/gcc/analyzer/store.cc:3318
0x197463b ana::region_model::replay_call_summary(ana::call_summary_replay&,
ana::region_model const&)
/repo/gcc-trunk/gcc/analyzer/region-model.cc:5635
0x19552db ana::program_state::replay_call_summary(ana::call_summary_replay&,
ana::program_state const&)
/repo/gcc-trunk/gcc/analyzer/program-state.cc:1635
0x193b6f3 ana::call_summary_edge_info::update_state(ana::program_state*,
ana::exploded_edge const*, ana::region_model_context*) const
/repo/gcc-trunk/gcc/analyzer/engine.cc:1633
0x193397a ana::exploded_graph::process_node(ana::exploded_node*)
/repo/gcc-trunk/gcc/analyzer/engine.cc:4241
0x193442a ana::exploded_graph::process_worklist()
/repo/gcc-trunk/gcc/analyzer/engine.cc:3516
0x1936b9b ana::impl_run_checkers(ana::logger*)
/repo/gcc-trunk/gcc/analyzer/engine.cc:6210
0x1937b66 ana::run_checkers()
/repo/gcc-trunk/gcc/analyzer/engine.cc:6308
0x1926458 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-9652-20240325121350-gcf3fc6f414f-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 --enable-libsanitizer
--disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r14-9652-20240325121350-gcf3fc6f414f-checking-yes-rtl-df-extra-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.1 20240325 (experimental) (GCC)

[Bug analyzer/114472] New: [14 Regression] ICE: in falls_short_of_p, at analyzer/store.cc:365 (in exceeds_p, at analyzer/store.cc:342) with -fanalyzer

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

Bug ID: 114472
   Summary: [14 Regression] ICE: in falls_short_of_p, at
analyzer/store.cc:365 (in exceeds_p, at
analyzer/store.cc:342) 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 57813
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57813=edit
reduced testcase

Compiler output:
$ x86_64-pc-linux-gnu-gcc -fanalyzer testcase.c 
during IPA pass: analyzer
testcase.c: In function 'bar':
testcase.c:13:3: internal compiler error: in falls_short_of_p, at
analyzer/store.cc:365
   13 |   __builtin_strncpy(,  - 3, -1);
  |   ^
0x8ca06b
ana::bit_range::falls_short_of_p(generic_wide_int
>, ana::bit_range*) const
/repo/gcc-trunk/gcc/analyzer/store.cc:365
0x28c0d6e ana::region_model::check_region_bounds(ana::region const*,
ana::access_direction, ana::svalue const*, ana::region_model_context*) const
/repo/gcc-trunk/gcc/analyzer/bounds-checking.cc:1438
0x19622b9 ana::region_model::check_region_access(ana::region const*,
ana::access_direction, ana::svalue const*, ana::region_model_context*) const
/repo/gcc-trunk/gcc/analyzer/region-model.cc:3095
0x19622b9 ana::region_model::check_region_access(ana::region const*,
ana::access_direction, ana::svalue const*, ana::region_model_context*) const
/repo/gcc-trunk/gcc/analyzer/region-model.cc:3084
0x19622b9 ana::region_model::check_region_for_read(ana::region const*,
ana::region_model_context*) const
/repo/gcc-trunk/gcc/analyzer/region-model.cc:3129
0x19622b9 ana::region_model::check_region_for_read(ana::region const*,
ana::region_model_context*) const
/repo/gcc-trunk/gcc/analyzer/region-model.cc:3126
0x19622b9 ana::region_model::get_store_value(ana::region const*,
ana::region_model_context*) const
/repo/gcc-trunk/gcc/analyzer/region-model.cc:2690
0x19688d2 ana::region_model::get_store_value(ana::region const*,
ana::region_model_context*) const
/repo/gcc-trunk/gcc/analyzer/region-model.cc:2686
0x19688d2 ana::region_model::read_bytes(ana::region const*, tree_node*,
ana::svalue const*, ana::region_model_context*) const
/repo/gcc-trunk/gcc/analyzer/region-model.cc:4462
0x19688d2 ana::region_model::read_bytes(ana::region const*, tree_node*,
ana::svalue const*, ana::region_model_context*) const
/repo/gcc-trunk/gcc/analyzer/region-model.cc:4453
0x1945a2a update_model
/repo/gcc-trunk/gcc/analyzer/kf.cc:1609
0x193397a ana::exploded_graph::process_node(ana::exploded_node*)
/repo/gcc-trunk/gcc/analyzer/engine.cc:4241
0x193442a ana::exploded_graph::process_worklist()
/repo/gcc-trunk/gcc/analyzer/engine.cc:3516
0x1936b9b ana::impl_run_checkers(ana::logger*)
/repo/gcc-trunk/gcc/analyzer/engine.cc:6210
0x1937b66 ana::run_checkers()
/repo/gcc-trunk/gcc/analyzer/engine.cc:6308
0x1926458 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-9652-20240325121350-gcf3fc6f414f-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 --enable-libsanitizer
--disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r14-9652-20240325121350-gcf3fc6f414f-checking-yes-rtl-df-extra-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.1 20240325 (experimental) (GCC)

[Bug target/114442] New: ICE: in riscv_sched_variable_issue, at config/riscv/riscv.cc:8421 with -O2 -mtune=xiangshan-nanhu

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

Bug ID: 114442
   Summary: ICE: in riscv_sched_variable_issue, at
config/riscv/riscv.cc:8421 with -O2
-mtune=xiangshan-nanhu
   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 57787
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57787=edit
reduced testcase

Compiler output:
$ riscv64-unknown-linux-gnu-gcc -O2 -mtune=xiangshan-nanhu testcase.c 
during RTL pass: sched2
testcase.c: In function 'foo':
testcase.c:1:18: internal compiler error: in riscv_sched_variable_issue, at
config/riscv/riscv.cc:8421
1 | void foo (void) {}
  |  ^
0xb84f66 riscv_sched_variable_issue
/repo/gcc-trunk/gcc/config/riscv/riscv.cc:8421
0xb84f66 riscv_sched_variable_issue
/repo/gcc-trunk/gcc/config/riscv/riscv.cc:8401
0x2a4205e schedule_block(basic_block_def**, void*)
/repo/gcc-trunk/gcc/haifa-sched.cc:6912
0x16b4f74 schedule_region
/repo/gcc-trunk/gcc/sched-rgn.cc:3203
0x16b4f74 schedule_insns()
/repo/gcc-trunk/gcc/sched-rgn.cc:3525
0x16b540d schedule_insns()
/repo/gcc-trunk/gcc/sched-rgn.cc:3511
0x16b540d rest_of_handle_sched2
/repo/gcc-trunk/gcc/sched-rgn.cc:3749
0x16b540d 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-9644-20240323110757-g543585046d1-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
--enable-libsanitizer --disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r14-9644-20240323110757-g543585046d1-checking-yes-rtl-df-extra-riscv64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.1 20240323 (experimental) (GCC)

[Bug tree-optimization/114433] ICE: verify_ssa failed: definition in block 9 does not dominate use in block 8 with _BitInt() bitfield shift at -O1 and above

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

--- Comment #2 from Zdenek Sojka  ---
Created attachment 57786
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57786=edit
probably related, not fully reduced testcase

[Bug tree-optimization/114433] New: ICE: verify_ssa failed: definition in block 9 does not dominate use in block 8 with _BitInt() bitfield shift at -O1 and above

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

Bug ID: 114433
   Summary: ICE: verify_ssa failed: definition in block 9 does not
dominate use in block 8 with _BitInt() bitfield shift
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 57778
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57778=edit
reduced testcase

Similar to PR114365

Compiler output:
$ x86_64-pc-linux-gnu-gcc -O testcase.c 
testcase.c: In function 'foo':
testcase.c:7:1: error: definition in block 9 does not dominate use in block 8
7 | foo()
  | ^~~
for SSA_NAME: _12 in statement:
_38 = _12 >> 31;
during GIMPLE pass: bitintlower
testcase.c:7:1: internal compiler error: verify_ssa failed
0x177a70f verify_ssa(bool, bool)
/repo/gcc-trunk/gcc/tree-ssa.cc:1203
0x13cbd45 execute_function_todo
/repo/gcc-trunk/gcc/passes.cc:2095
0x13cc1ae 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-9610-20240322092442-gddd4a3ca874-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 --enable-libsanitizer
--disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r14-9610-20240322092442-gddd4a3ca874-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.1 20240322 (experimental) (GCC)

[Bug tree-optimization/114425] wrong code with _BitInt() __builtin_add_overflow_p() and __builtin_mul_overflow_p() at -O2

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

--- Comment #4 from Zdenek Sojka  ---
Created attachment 57773
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57773=edit
another unreduced testcase ; output differs between -O0 and -O2

[Bug tree-optimization/114425] wrong code with _BitInt() __builtin_add_overflow_p() and __builtin_mul_overflow_p() at -O2

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

--- Comment #3 from Zdenek Sojka  ---
Created attachment 57772
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57772=edit
unreduced testcase ; output differs between -O0 and -O2

[Bug tree-optimization/114425] wrong code with _BitInt() __builtin_add_overflow_p() at -O2

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

--- Comment #1 from Zdenek Sojka  ---
Created attachment 57771
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57771=edit
another testcase, using __builtin_mul_overflow_p

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

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

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

Bug ID: 114425
   Summary: wrong code with _BitInt() __builtin_add_overflow_p()
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 57764
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57764=edit
reduced testcase

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-9595-20240321132344-ga2fe34e0b99-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 --enable-libsanitizer
--disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r14-9595-20240321132344-ga2fe34e0b99-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.1 20240321 (experimental) (GCC)

[Bug target/114415] New: wrong code with -Oz -fno-dce -fno-forward-propagate -flive-range-shrinkage -fweb

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

Bug ID: 114415
   Summary: wrong code with -Oz -fno-dce -fno-forward-propagate
-flive-range-shrinkage -fweb
   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 57755
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57755=edit
reduced testcase

Output:
$ x86_64-pc-linux-gnu-gcc -Oz -fno-dce -fno-forward-propagate
-flive-range-shrinkage -fweb testcase.c -Wno-psabi
$ ./a.out 
Aborted


It seems the issue is in:


   0x0040137e <+214>:   movq   $0x1,-0x1b0(%rbp)
   0x00401389 <+225>:   push   $0x10
   0x0040138b <+227>:   pop%rcx
   0x0040138c <+228>:   rep movsl %ds:(%rsi),%es:(%rdi)
=> 0x0040138e <+230>:   push   $0x10
   0x00401390 <+232>:   mov%rbx,%rdi
   0x00401393 <+235>:   lea-0xf0(%rbp),%rsi
   0x0040139a <+242>:   pop%rcx

(gdb) p $rsp
$48 = (void *) 0x7fffd3c0

(gdb) p/x $rdi
$50 = 0x7fffd3c0

that "push" overwrites the destination of the just finished "rep movsd"; this
is probably specific to -Oz


$ 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-9591-20240321175934-gac2f8c2a367-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 --enable-libsanitizer
--disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r14-9591-20240321175934-gac2f8c2a367-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.1 20240321 (experimental) (GCC)

[Bug tree-optimization/114405] New: ICE: in min_value, at wide-int.cc:344 with _BitInt() bitfield arithmetics

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

Bug ID: 114405
   Summary: ICE: in min_value, at wide-int.cc:344 with _BitInt()
bitfield arithmetics
   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 57746
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57746=edit
reduced testcase

Compiler output:
$ x86_64-pc-linux-gnu-gcc -O testcase.c 
during GIMPLE pass: dom
testcase.c: In function 'foo':
testcase.c:6:1: internal compiler error: in min_value, at wide-int.cc:344
6 | foo ()
  | ^~~
0x8b5cef wi::min_value(unsigned int, signop)
/repo/gcc-trunk/gcc/wide-int.cc:344
0xe905c0 irange::set_varying(tree_node*)
/repo/gcc-trunk/gcc/value-range.h:1084
0x26a548d ranger_cache::get_global_range(vrange&, tree_node*) const
/repo/gcc-trunk/gcc/gimple-range-cache.cc:1019
0x26a548d ranger_cache::get_global_range(vrange&, tree_node*) const
/repo/gcc-trunk/gcc/gimple-range-cache.cc:1015
0x26a01eb gimple_ranger::range_of_expr(vrange&, tree_node*, gimple*)
/repo/gcc-trunk/gcc/gimple-range.cc:131
0x164a000 cprop_operand
/repo/gcc-trunk/gcc/tree-ssa-dom.cc:2038
0x164c402 cprop_into_stmt
/repo/gcc-trunk/gcc/tree-ssa-dom.cc:2115
0x164c402 dom_opt_dom_walker::optimize_stmt(basic_block_def*,
gimple_stmt_iterator*, bool*)
/repo/gcc-trunk/gcc/tree-ssa-dom.cc:2343
0x164dc97 dom_opt_dom_walker::before_dom_children(basic_block_def*)
/repo/gcc-trunk/gcc/tree-ssa-dom.cc:1748
0x263f7ae dom_walker::walk(basic_block_def*)
/repo/gcc-trunk/gcc/domwalk.cc:311
0x164e728 execute
/repo/gcc-trunk/gcc/tree-ssa-dom.cc:939
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-9570-20240320105507-g456e10f28b3-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 --enable-libsanitizer
--disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r14-9570-20240320105507-g456e10f28b3-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.1 20240320 (experimental) (GCC)

[Bug libgcc/114397] New: wrong code with _BitInt() division at -O0

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

Bug ID: 114397
   Summary: wrong code with _BitInt() division at -O0
   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 57740
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57740=edit
reduced testcase

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

The result is 0 instead of -1.

$ 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-9532-20240318213256-g9eeca775367-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 --enable-libsanitizer
--disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r14-9532-20240318213256-g9eeca775367-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.1 20240319 (experimental) (GCC)

[Bug tree-optimization/114365] New: ICE: verify_ssa failed: definition in block 4 does not dominate use in block 5 at -O with _BitInt() shift in a bitfield

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

Bug ID: 114365
   Summary: ICE: verify_ssa failed: definition in block 4 does not
dominate use in block 5 at -O with _BitInt() shift in
a bitfield
   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 57717
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57717=edit
reduced testcase

Compiler output:
$ x86_64-pc-linux-gnu-gcc -O testcase.c
testcase.c: In function 'foo':
testcase.c:7:1: error: definition in block 4 does not dominate use in block 5
7 | foo(int a)
  | ^~~
for SSA_NAME: _33 in statement:
_36 = _33 << 33;
during GIMPLE pass: bitintlower
testcase.c:7:1: internal compiler error: verify_ssa failed
0x177d34f verify_ssa(bool, bool)
/repo/gcc-trunk/gcc/tree-ssa.cc:1203
0x13ceab5 execute_function_todo
/repo/gcc-trunk/gcc/passes.cc:2095
0x13cef1e 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-9503-20240316151633-g218d1749612-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 --enable-libsanitizer
--disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r14-9503-20240316151633-g218d1749612-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.1 20240316 (experimental) (GCC)

[Bug target/114334] New: [14 Regression] ICE: in extract_insn, at recog.cc:2812 (unrecognizable insn and:HF?) with lroundf16() and -ffast-math -mavx512fp16

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

Bug ID: 114334
   Summary: [14 Regression] ICE: in extract_insn, at recog.cc:2812
(unrecognizable insn and:HF?) with lroundf16() and
-ffast-math -mavx512fp16
   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 57696
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57696=edit
reduced testcase

Compiler output:
$ x86_64-pc-linux-gnu-gcc -ffast-math -mavx512fp16 testcase.c  
testcase.c: In function 'foo':
testcase.c:5:1: error: unrecognizable insn:
5 | }
  | ^
(insn 10 9 11 2 (set (reg:HF 102)
(and:HF (reg:HF 104)
(reg:HF 101))) "testcase.c":4:10 -1
 (nil))
during RTL pass: vregs
testcase.c:5:1: internal compiler error: in extract_insn, at recog.cc:2812
0x8071a7 _fatal_insn(char const*, rtx_def const*, char const*, int, char
const*)
/repo/gcc-trunk/gcc/rtl-error.cc:108
0x807224 _fatal_insn_not_found(rtx_def const*, char const*, int, char const*)
/repo/gcc-trunk/gcc/rtl-error.cc:116
0x7f6093 extract_insn(rtx_insn*)
/repo/gcc-trunk/gcc/recog.cc:2812
0x113444d instantiate_virtual_regs_in_insn
/repo/gcc-trunk/gcc/function.cc:1611
0x113444d instantiate_virtual_regs
/repo/gcc-trunk/gcc/function.cc:1994
0x113444d 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.

$ 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-9454-20240313184120-g11caf47b599-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 --enable-libsanitizer
--disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r14-9454-20240313184120-g11caf47b599-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.1 20240313 (experimental) (GCC)

[Bug tree-optimization/114332] New: wrong code with _Atomic _BitInt(5) at -O -fwrapv

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

Bug ID: 114332
   Summary: wrong code with _Atomic _BitInt(5) at -O -fwrapv
   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 57691
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57691=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-9454-20240313184120-g11caf47b599-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 --enable-libsanitizer
--disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r14-9454-20240313184120-g11caf47b599-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.1 20240313 (experimental) (GCC)

[Bug libgcc/114327] `-CST % 1` is wrong for _BitInt()

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

--- Comment #3 from Zdenek Sojka  ---
It's not only % 1; wrong results are also for:
  B x = foo (3, -0x9e9b9fe60);

or for

B
foo (char c, B b)
{
  return b / c;
}


  B x = foo (-0x6, 0); /* 0 / -6 = 0 */

in all these cases, the result is the same: -1 << 64.

[Bug tree-optimization/114329] New: ICE: verify_gimple failed: 'bit_field_ref' of non-mode-precision operand with bitfield _BitInt()

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

Bug ID: 114329
   Summary: ICE: verify_gimple failed: 'bit_field_ref' of
non-mode-precision operand with bitfield _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 57690
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57690=edit
reduced testcase

Compiler output:
$ x86_64-pc-linux-gnu-gcc testcase.c
testcase.c: In function 'foo':
testcase.c:6:1: error: 'bit_field_ref' of non-mode-precision operand
6 | foo(void)
  | ^~~
# .MEM_20 = VDEF <.MEM_19>
BIT_FIELD_REF  = _9;
during GIMPLE pass: bitintlower0
testcase.c:6:1: internal compiler error: verify_gimple failed
0x155f56d verify_gimple_in_cfg(function*, bool, bool)
/repo/gcc-trunk/gcc/tree-cfg.cc:5663
0x13ce234 execute_function_todo
/repo/gcc-trunk/gcc/passes.cc:2088
0x13ce78e 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-9454-20240313184120-g11caf47b599-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 --enable-libsanitizer
--disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r14-9454-20240313184120-g11caf47b599-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.1 20240313 (experimental) (GCC)

[Bug libgcc/114327] New: wrong code with _BitInt() modulo at -O0

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

Bug ID: 114327
   Summary: wrong code with _BitInt() modulo at -O0
   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 57688
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57688=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-9441-20240312154250-gef79c64cb57-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 --enable-libsanitizer
--disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r14-9441-20240312154250-gef79c64cb57-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.1 20240312 (experimental) (GCC)

[Bug tree-optimization/114313] New: ICE: in limb_access_type, at gimple-lower-bitint.cc:591 with _BitInt() in a bitfield

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

Bug ID: 114313
   Summary: ICE: in limb_access_type, at
gimple-lower-bitint.cc:591 with _BitInt() in a
bitfield
   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 57674
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57674=edit
reduced testcase

Compiler output:
$ x86_64-pc-linux-gnu-gcc testcase.c
during GIMPLE pass: bitintlower0
testcase.c: In function 'foo':
testcase.c:8:1: internal compiler error: in limb_access_type, at
gimple-lower-bitint.cc:591
8 | foo (void)
  | ^~~
0xd748bf limb_access_type
/repo/gcc-trunk/gcc/gimple-lower-bitint.cc:591
0x264c8d4 limb_access_type
/repo/gcc-trunk/gcc/gimple-lower-bitint.cc:587
0x264c8d4 limb_access
/repo/gcc-trunk/gcc/gimple-lower-bitint.cc:606
0x265c659 handle_load
/repo/gcc-trunk/gcc/gimple-lower-bitint.cc:1857
0x265c659 handle_stmt
/repo/gcc-trunk/gcc/gimple-lower-bitint.cc:2066
0x265e1f4 lower_mergeable_stmt
/repo/gcc-trunk/gcc/gimple-lower-bitint.cc:2610
0x26625dc lower_stmt
/repo/gcc-trunk/gcc/gimple-lower-bitint.cc:5560
0x2665699 gimple_lower_bitint
/repo/gcc-trunk/gcc/gimple-lower-bitint.cc:6860
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-9425-2024032226-g119f5ae0455-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 --enable-libsanitizer
--disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r14-9425-2024032226-g119f5ae0455-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.1 20240311 (experimental) (GCC)

[Bug middle-end/114312] New: ICE: SIGSEGV: infinite recursion in chrec_fold_plus_1 (tree-chrec.cc:336) at -O3 with _BitInt()

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

Bug ID: 114312
   Summary: ICE: SIGSEGV: infinite recursion in chrec_fold_plus_1
(tree-chrec.cc:336) at -O3 with _BitInt()
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: middle-end
  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 57673
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57673=edit
reduced testcase

Compiler output:
$ x86_64-pc-linux-gnu-gcc -O3 testcase.c -wrapper gdb,--args
GNU gdb (Gentoo 14.1 vanilla) 14.1
...
(gdb) r
Starting program:
/repo/gcc-trunk/binary-trunk-r14-9425-2024032226-g119f5ae0455-checking-yes-rtl-df-extra-nobootstrap-amd64/libexec/gcc/x86_64-pc-linux-gnu/14.0.1/cc1
-quiet -iprefix
/repo/gcc-trunk/binary-trunk-r14-9425-2024032226-g119f5ae0455-checking-yes-rtl-df-extra-nobootstrap-amd64/bin/../lib/gcc/x86_64-pc-linux-gnu/14.0.1/
testcase.c -quiet -dumpdir a- -dumpbase testcase.c -dumpbase-ext .c
-mtune=generic -march=x86-64 -O3 -o /tmp/ccMD8BgN.s
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".

Program received signal SIGSEGV, Segmentation fault.
ggc_internal_alloc (size=size@entry=32, f=f@entry=0x0, s=s@entry=0,
n=n@entry=1) at /repo/gcc-trunk/gcc/ggc-page.cc:1401
1401  memset (result, 0xaf, object_size);
(gdb) bt
#0  ggc_internal_alloc (size=size@entry=32, f=f@entry=0x0, s=s@entry=0,
n=n@entry=1) at /repo/gcc-trunk/gcc/ggc-page.cc:1401
#1  0x01820695 in ggc_internal_alloc (s=32) at
/repo/gcc-trunk/gcc/ggc.h:136
#2  ggc_alloc_tree_node_stat (s=32) at /repo/gcc-trunk/gcc/ggc.h:319
#3  build1 (code=code@entry=NOP_EXPR, type=type@entry=0x775b1888,
node=node@entry=0x775ea870) at /repo/gcc-trunk/gcc/tree.cc:5010
#4  0x0110e71d in build1_loc (arg1=0x775ea870, type=0x775b1888,
code=NOP_EXPR, loc=0) at /repo/gcc-trunk/gcc/tree.h:4740
#5  fold_build1_loc (loc=0, code=NOP_EXPR, type=0x775b1888,
op0=0x775ea870) at /repo/gcc-trunk/gcc/fold-const.cc:14144
#6  0x027db3a1 in chrec_convert_1 (type=0x775b1888,
chrec=0x775ea870, at_stmt=0x0, use_overflow_semantics=,
from=0x0)
at /repo/gcc-trunk/gcc/tree-chrec.cc:1601
#7  0x027dd2b4 in chrec_convert (from=0x0, use_overflow_semantics=true,
at_stmt=0x0, chrec=0x775ea870, type=0x775b1888) at
/repo/gcc-trunk/gcc/tree-chrec.cc:1655
#8  chrec_fold_plus_1 (op1=, op0=0x775ea870,
type=0x77422000, code=MINUS_EXPR) at /repo/gcc-trunk/gcc/tree-chrec.cc:336
#9  chrec_fold_plus_1 (code=MINUS_EXPR, type=0x77422000,
op0=0x775ea870, op1=) at
/repo/gcc-trunk/gcc/tree-chrec.cc:233
#10 0x027dcfd5 in chrec_fold_plus_1 (op1=,
op0=0x75f4e900, type=0x775b1888, code=MINUS_EXPR) at
/repo/gcc-trunk/gcc/tree-chrec.cc:336
#11 chrec_fold_plus_1 (code=MINUS_EXPR, type=0x775b1888,
op0=0x75f4e900, op1=) at
/repo/gcc-trunk/gcc/tree-chrec.cc:233
#12 0x027dcfd5 in chrec_fold_plus_1 (op1=,
op0=0x775ea870, type=0x77422000, code=MINUS_EXPR) at
/repo/gcc-trunk/gcc/tree-chrec.cc:336
#13 chrec_fold_plus_1 (code=MINUS_EXPR, type=0x77422000,
op0=0x775ea870, op1=) at
/repo/gcc-trunk/gcc/tree-chrec.cc:233
#14 0x027dcfd5 in chrec_fold_plus_1 (op1=,
op0=0x75f4e8c0, type=0x775b1888, code=MINUS_EXPR) at
/repo/gcc-trunk/gcc/tree-chrec.cc:336
#15 chrec_fold_plus_1 (code=MINUS_EXPR, type=0x775b1888,
op0=0x75f4e8c0, op1=) at
/repo/gcc-trunk/gcc/tree-chrec.cc:233
#16 0x027dcfd5 in chrec_fold_plus_1 (op1=,
op0=0x775ea870, type=0x77422000, code=MINUS_EXPR) at
/repo/gcc-trunk/gcc/tree-chrec.cc:336
#17 chrec_fold_plus_1 (code=MINUS_EXPR, type=0x77422000,
op0=0x775ea870, op1=) at
/repo/gcc-trunk/gcc/tree-chrec.cc:233
#18 0x027dcfd5 in chrec_fold_plus_1 (op1=,
op0=0x75f4e880, type=0x775b1888, code=MINUS_EXPR) at
/repo/gcc-trunk/gcc/tree-chrec.cc:336
#19 chrec_fold_plus_1 (code=MINUS_EXPR, type=0x775b1888,
op0=0x75f4e880, op1=) at
/repo/gcc-trunk/gcc/tree-chrec.cc:233
...

$ 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-9425-2024032226-g119f5ae0455-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
--tar

[Bug tree-optimization/114299] New: ICE: SIGSEGV: in dyn_cast (is-a.h:282) with -mgeneral-regs-only and __bf16

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

Bug ID: 114299
   Summary: ICE: SIGSEGV: in dyn_cast
(is-a.h:282) with -mgeneral-regs-only and __bf16
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: error-recovery
  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 57661
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57661=edit
reduced testcase

Compiler output:
$ x86_64-pc-linux-gnu-gcc -mgeneral-regs-only testcase.c  -wrapper valgrind,-q
testcase.c: In function 'foo':
testcase.c:10:3: error: invalid conversion from type '__bf16' without option
'-msse2'
   10 |   return __builtin_shufflevector(v, a, 1, 2, 5, 0, 1, 6, 6, 4);
  |   ^~
testcase.c:8:1: error: SSE register return with SSE disabled
8 | foo(void)
  | ^~~
==9563== Invalid read of size 1
==9563==at 0x1AAA648: dyn_cast (is-a.h:282)
==9563==by 0x1AAA648: gimple_simplify_VEC_PERM_EXPR(gimple_match_op*,
gimple**, tree_node* (*)(tree_node*), code_helper, tree_node*, tree_node*,
tree_node*, tree_node*) (gimple-match-4.cc:17752)
==9563==by 0x1C8F915: gimple_resimplify3(gimple**, gimple_match_op*,
tree_node* (*)(tree_node*)) (gimple-match-exports.cc:1107)
==9563==by 0x1C90EF7: gimple_simplify(gimple*, gimple_match_op*, gimple**,
tree_node* (*)(tree_node*), tree_node* (*)(tree_node*))
(gimple-match-exports.cc:898)
==9563==by 0x117063C: fold_stmt_1(gimple_stmt_iterator*, bool, tree_node*
(*)(tree_node*)) (gimple-fold.cc:6362)
==9563==by 0x11C14A0: gimplify_modify_expr(tree_node**, gimple**, gimple**,
bool) (gimplify.cc:6582)
==9563==by 0x11AABE9: gimplify_expr(tree_node**, gimple**, gimple**, bool
(*)(tree_node*), int) (gimplify.cc:17786)
==9563==by 0x11AD2D6: gimplify_stmt(tree_node**, gimple**)
(gimplify.cc:7480)
==9563==by 0x11BB6A0: gimplify_and_add (gimplify.cc:493)
==9563==by 0x11BB6A0: gimplify_return_expr(tree_node*, gimple**)
(gimplify.cc:1883)
==9563==by 0x11AB9CA: gimplify_expr(tree_node**, gimple**, gimple**, bool
(*)(tree_node*), int) (gimplify.cc:18048)
==9563==by 0x11AD2D6: gimplify_stmt(tree_node**, gimple**)
(gimplify.cc:7480)
==9563==by 0x11AE3D9: gimplify_bind_expr(tree_node**, gimple**)
(gimplify.cc:1614)
==9563==by 0x11AB957: gimplify_expr(tree_node**, gimple**, gimple**, bool
(*)(tree_node*), int) (gimplify.cc:17987)
==9563==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==9563== 
testcase.c:10:10: internal compiler error: Segmentation fault
   10 |   return __builtin_shufflevector(v, a, 1, 2, 5, 0, 1, 6, 6, 4);
  |  ^
0x151311f crash_signal
/repo/gcc-trunk/gcc/toplev.cc:319
0x1aaa648 gassign* dyn_cast(gimple*)
/repo/gcc-trunk/gcc/is-a.h:282
0x1aaa648 gimple_simplify_VEC_PERM_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-4.cc:17752
0x1c8f915 gimple_resimplify3
/repo/gcc-trunk/gcc/gimple-match-exports.cc:1107
0x1c90ef7 gimple_simplify(gimple*, gimple_match_op*, gimple**, tree_node*
(*)(tree_node*), tree_node* (*)(tree_node*))
/repo/gcc-trunk/gcc/gimple-match-exports.cc:898
0x117063c fold_stmt_1
/repo/gcc-trunk/gcc/gimple-fold.cc:6362
0x11c14a0 gimplify_modify_expr
/repo/gcc-trunk/gcc/gimplify.cc:6582
0x11aabe9 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
/repo/gcc-trunk/gcc/gimplify.cc:17786
0x11ad2d6 gimplify_stmt(tree_node**, gimple**)
/repo/gcc-trunk/gcc/gimplify.cc:7480
0x11bb6a0 gimplify_and_add(tree_node*, gimple**)
/repo/gcc-trunk/gcc/gimplify.cc:493
0x11bb6a0 gimplify_return_expr
/repo/gcc-trunk/gcc/gimplify.cc:1883
0x11ab9ca gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
/repo/gcc-trunk/gcc/gimplify.cc:18048
0x11ad2d6 gimplify_stmt(tree_node**, gimple**)
/repo/gcc-trunk/gcc/gimplify.cc:7480
0x11ae3d9 gimplify_bind_expr
/repo/gcc-trunk/gcc/gimplify.cc:1614
0x11ab957 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
/repo/gcc-trunk/gcc/gimplify.cc:17987
0x11c2574 gimplify_stmt(tree_node**, gimple**)
/repo/gcc-trunk/gcc/gimplify.cc:7480
0x11c2574 gimplify_body(tree_node*, bool)
/repo/gcc-trunk/gcc/gimplify.cc:19053
0x11c299a gimplify_function_tree(tree_node*)
/repo/gcc-trunk/gcc/gimplify.cc:19252
0xfd0ce7 cgraph_node::analyze()
/repo/gcc-trunk/gcc/cgraphunit.cc:687
0xfd3607 analyze_functions
/repo/gcc-trunk/gcc/cgraphunit.cc:1251
Please submit a full bug report, with preproces

[Bug tree-optimization/114293] New: [14 Regression] ICE: in verify_range, at value-range.cc:1132 at -O2

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

Bug ID: 114293
   Summary: [14 Regression] ICE: in verify_range, at
value-range.cc:1132 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
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu

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

Compiler output:
$ x86_64-pc-linux-gnu-gcc -O2 testcase.c
testcase.c: In function 'bar':
testcase.c:4:3: warning: '__builtin_memset' specified bound
18374966859414961920 exceeds maximum object size 9223372036854775807
[-Wstringop-overflow=]
4 |   __builtin_memset (, a, 0xFF00FF00FF00FF00);
  |   ^~~~
during GIMPLE pass: strlen
testcase.c: In function 'foo':
testcase.c:9:1: internal compiler error: in verify_range, at
value-range.cc:1132
9 | foo (void)
  | ^~~
0x8a195e irange::verify_range()
/repo/gcc-trunk/gcc/value-range.cc:1132
0x1853427 irange::set(tree_node*, generic_wide_int const&,
generic_wide_int const&, value_range_kind)
/repo/gcc-trunk/gcc/value-range.cc:1076
0x17394e8 int_range<2u, false>::int_range(tree_node*,
generic_wide_int const&, generic_wide_int
const&, value_range_kind)
/repo/gcc-trunk/gcc/value-range.h:1047
0x17394e8 set_strlen_range(tree_node*, generic_wide_int,
generic_wide_int, tree_node*)
/repo/gcc-trunk/gcc/tree-ssa-strlen.cc:1942
0x17455f8 strlen_pass::handle_builtin_strlen()
/repo/gcc-trunk/gcc/tree-ssa-strlen.cc:2344
0x1745ab5 strlen_pass::check_and_optimize_call(bool*)
/repo/gcc-trunk/gcc/tree-ssa-strlen.cc:5412
0x1746499 strlen_pass::check_and_optimize_stmt(bool*)
/repo/gcc-trunk/gcc/tree-ssa-strlen.cc:5670
0x17468d6 strlen_pass::before_dom_children(basic_block_def*)
/repo/gcc-trunk/gcc/tree-ssa-strlen.cc:5854
0x2615eae dom_walker::walk(basic_block_def*)
/repo/gcc-trunk/gcc/domwalk.cc:311
0x1746dd7 printf_strlen_execute
/repo/gcc-trunk/gcc/tree-ssa-strlen.cc:5913
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-9409-20240309093707-ge9753f4b633-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 --enable-libsanitizer
--disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r14-9409-20240309093707-ge9753f4b633-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.1 20240309 (experimental) (GCC)

[Bug analyzer/114286] New: ICE: in deref_rvalue, at analyzer/region-model.cc:2762 with _Atomic _BitInt() and -fanalyzer

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

Bug ID: 114286
   Summary: ICE: in deref_rvalue, at analyzer/region-model.cc:2762
with _Atomic _BitInt() and -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
CC: jakub at gcc dot gnu.org
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu

Created attachment 57656
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57656=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:5:3: internal compiler error: in deref_rvalue, at
analyzer/region-model.cc:2762
5 |   b;
  |   ^
0x8c81ff ana::region_model::deref_rvalue(ana::svalue const*, tree_node*,
ana::region_model_context*, bool) const
/repo/gcc-trunk/gcc/analyzer/region-model.cc:2762
0x192a209 ana::kf_atomic_load::impl_call_pre(ana::call_details const&) const
/repo/gcc-trunk/gcc/analyzer/kf.cc:289
0x19464f7 ana::region_model::on_call_pre(gcall const*,
ana::region_model_context*)
/repo/gcc-trunk/gcc/analyzer/region-model.cc:1700
0x194a31a ana::region_model::on_stmt_pre(gimple const*, bool*,
ana::region_model_context*)
/repo/gcc-trunk/gcc/analyzer/region-model.cc:1337
0x1912190 ana::exploded_node::on_stmt(ana::exploded_graph&, ana::supernode
const*, gimple const*, ana::program_state*, ana::uncertainty_t*, bool*,
ana::path_context*)
/repo/gcc-trunk/gcc/analyzer/engine.cc:1515
0x1914f2a ana::exploded_graph::process_node(ana::exploded_node*)
/repo/gcc-trunk/gcc/analyzer/engine.cc:4125
0x1915e9a ana::exploded_graph::process_worklist()
/repo/gcc-trunk/gcc/analyzer/engine.cc:3516
0x19185f5 ana::impl_run_checkers(ana::logger*)
/repo/gcc-trunk/gcc/analyzer/engine.cc:6210
0x1919506 ana::run_checkers()
/repo/gcc-trunk/gcc/analyzer/engine.cc:6301
0x1908158 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-9382-20240308082802-g0bd04d9ae2d-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 --enable-libsanitizer
--disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r14-9382-20240308082802-g0bd04d9ae2d-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.1 20240308 (experimental) (GCC)

[Bug rtl-optimization/111822] [12/13/14 Regression] during RTL pass: lr_shrinkage ICE: in operator[], at vec.h:910 with -O2 -m32 -flive-range-shrinkage -fno-dce -fnon-call-exceptions since r12-5301-g0

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

--- Comment #5 from Zdenek Sojka  ---
(In reply to Richard Biener from comment #4)
> We've released with the bug so this cannot be P1.  Note the bisected to rev.
> likely just made this latent issue show up.
> 
> Btw, I can't reproduce - any implicit options missing?
> 
> > ./cc1plus -quiet t.ii -O2 -m32 -flive-range-shrinkage -fno-dce 
> > -fnon-call-exceptions

$
/repo/gcc-trunk/binary-trunk-20240305153615-g08ec4adb028-checking-yes-rtl-df-extra-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/14.0.1/cc1plus
attachment.txt -m32 "-mtune=generic" "-march=x86-64" -O2 -flive-range-shrinkage
-fno-dce -fnon-call-exceptions
...
attachment.txt: In member function 'void SQVM::CallNative()':
attachment.txt:41:1: internal compiler error: in operator[], at vec.h:910
   41 | }
  | ^
...

[Bug rtl-optimization/114278] New: ICE: in extract_bit_field_1, at expmed.cc:1838 with memmove, _BitInt() and -O2 -fno-tree-dce -fno-tree-dse -fno-tree-ccp -m32

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

Bug ID: 114278
   Summary: ICE: in extract_bit_field_1, at expmed.cc:1838 with
memmove, _BitInt() and -O2 -fno-tree-dce -fno-tree-dse
-fno-tree-ccp -m32
   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
CC: jakub at gcc dot gnu.org
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: i686-pc-linux-gnu

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

Compiler output:
$ x86_64-pc-linux-gnu-gcc -O2 -fno-tree-dce -fno-tree-dse -fno-tree-ccp -m32
testcase.c -Wall -W
during RTL pass: expand
testcase.c: In function 'foo':
testcase.c:4:37: internal compiler error: in extract_bit_field_1, at
expmed.cc:1838
4 |   _BitInt(128) b = *(_BitInt(128) *)__builtin_memmove(, p, 16);
  | ^~~~
0x758082 extract_bit_field_1
/repo/gcc-trunk/gcc/expmed.cc:1838
0x10a868c extract_bit_field(rtx_def*, poly_int<1u, unsigned long>, poly_int<1u,
unsigned long>, int, rtx_def*, machine_mode, machine_mode, bool, rtx_def**)
/repo/gcc-trunk/gcc/expmed.cc:2151
0x10c7654 expand_expr_real_1(tree_node*, rtx_def*, machine_mode,
expand_modifier, rtx_def**, bool)
/repo/gcc-trunk/gcc/expr.cc:12456
0x10d323d store_expr(tree_node*, rtx_def*, int, bool, bool)
/repo/gcc-trunk/gcc/expr.cc:6740
0x10d5e6f expand_assignment(tree_node*, tree_node*, bool)
/repo/gcc-trunk/gcc/expr.cc:6461
0x10d5e6f expand_assignment(tree_node*, tree_node*, bool)
/repo/gcc-trunk/gcc/expr.cc:5946
0xf8cfe9 expand_gimple_stmt_1
/repo/gcc-trunk/gcc/cfgexpand.cc:3998
0xf8cfe9 expand_gimple_stmt
/repo/gcc-trunk/gcc/cfgexpand.cc:4077
0xf8e677 expand_gimple_basic_block
/repo/gcc-trunk/gcc/cfgexpand.cc:6133
0xf90cfe execute
/repo/gcc-trunk/gcc/cfgexpand.cc:6872
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-9346-20240306205443-g74e8cc28eda-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 --enable-libsanitizer
--disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r14-9346-20240306205443-g74e8cc28eda-checking-yes-rtl-df-extra-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.1 20240306 (experimental) (GCC)

[Bug ipa/114274] New: ICE: tree check: expected block, have ggc_freed in inlining_chain_to_json, at optinfo-emit-json.cc:284 with -fsave-optimization-record

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

Bug ID: 114274
   Summary: ICE: tree check: expected block, have ggc_freed in
inlining_chain_to_json, at optinfo-emit-json.cc:284
with -fsave-optimization-record
   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 57649
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57649=edit
partially reduced testcase

Compiler output:
$ x86_64-pc-linux-gnu-gcc --param=max-jump-thread-duplication-stmts=0
-fprofile-generate -O2 -fsave-optimization-record aco_ir.cpp.ii -wrapper
valgrind,-q
aco_ir.cpp.ii:50:66: warning: 'alloc_size' attribute ignored on a function
returning 'void' [-Wattributes]
   50 |   void malloc ()  __attribute__ ((__alloc_size__ (1))) ;
  |  ^
...
aco_ir.cpp.ii: At global scope:
aco_ir.cpp.ii:1257:49: warning: 'always_inline' function might not be inlinable
unless also declared 'inline' [-Wattributes]
 1257 | __attribute__((always_inline)) bool get_cmp_info(aco_opcode
op, CmpInfo* info) {
  | ^~~~
==30423== Invalid read of size 2
==30423==at 0x16AB1A0: tree_check (tree.h:3611)
==30423==by 0x16AB1A0:
optrecord_json_writer::inlining_chain_to_json(unsigned int)
(optinfo-emit-json.cc:284)
==30423==by 0x16ABF4A: optrecord_json_writer::optinfo_to_json(optinfo
const*) (optinfo-emit-json.cc:419)
==30423==by 0x16ABF98: optrecord_json_writer::add_record(optinfo const*)
(optinfo-emit-json.cc:141)
==30423==by 0x1318F06: emit_optinfo (dumpfile.cc:1223)
==30423==by 0x1318F06: end_any_optinfo (dumpfile.cc:1209)
==30423==by 0x1318F06: dump_loc (dumpfile.cc:601)
==30423==by 0x1318F06: dump_printf_loc_va (dumpfile.cc:1028)
==30423==by 0x1318F06: dump_printf_loc(dump_metadata_t const&,
dump_user_location_t const&, char const*, ...) (dumpfile.cc:1359)
==30423==by 0x2B483D4: ipa_icf::sem_item_optimizer::merge_classes(unsigned
int, unsigned int) (ipa-icf.cc:3423)
==30423==by 0x2B501F4: ipa_icf::sem_item_optimizer::execute()
(ipa-icf.cc:2484)
==30423==by 0x2B53726: ipa_icf_driver (ipa-icf.cc:3612)
==30423==by 0x2B53726: ipa_icf::pass_ipa_icf::execute(function*)
(ipa-icf.cc:3659)
==30423==by 0x16DBC27: execute_one_pass(opt_pass*) (passes.cc:2646)
==30423==by 0x16DCF96: execute_ipa_pass_list(opt_pass*) (passes.cc:3095)
==30423==by 0x12D7DB0: ipa_passes (cgraphunit.cc:2272)
==30423==by 0x12D7DB0: symbol_table::compile() [clone .part.0]
(cgraphunit.cc:2335)
==30423==by 0x12DAB57: compile (cgraphunit.cc:2315)
==30423==by 0x12DAB57: symbol_table::finalize_compilation_unit()
(cgraphunit.cc:2587)
==30423==by 0x181C671: compile_file() (toplev.cc:476)
==30423==  Address 0x5d5bde0 is in a rw- anonymous segment
==30423== 
==30423== Invalid read of size 2
==30423==at 0x96F1A7: tree_check_failed(tree_node const*, char const*, int,
char const*, ...) (tree.cc:8955)
==30423==by 0x8BF5B1: tree_check (tree.h:3612)
==30423==by 0x8BF5B1:
optrecord_json_writer::inlining_chain_to_json(unsigned int) [clone .cold]
(optinfo-emit-json.cc:284)
==30423==by 0x16ABF4A: optrecord_json_writer::optinfo_to_json(optinfo
const*) (optinfo-emit-json.cc:419)
==30423==by 0x16ABF98: optrecord_json_writer::add_record(optinfo const*)
(optinfo-emit-json.cc:141)
==30423==by 0x1318F06: emit_optinfo (dumpfile.cc:1223)
==30423==by 0x1318F06: end_any_optinfo (dumpfile.cc:1209)
==30423==by 0x1318F06: dump_loc (dumpfile.cc:601)
==30423==by 0x1318F06: dump_printf_loc_va (dumpfile.cc:1028)
==30423==by 0x1318F06: dump_printf_loc(dump_metadata_t const&,
dump_user_location_t const&, char const*, ...) (dumpfile.cc:1359)
==30423==by 0x2B483D4: ipa_icf::sem_item_optimizer::merge_classes(unsigned
int, unsigned int) (ipa-icf.cc:3423)
==30423==by 0x2B501F4: ipa_icf::sem_item_optimizer::execute()
(ipa-icf.cc:2484)
==30423==by 0x2B53726: ipa_icf_driver (ipa-icf.cc:3612)
==30423==by 0x2B53726: ipa_icf::pass_ipa_icf::execute(function*)
(ipa-icf.cc:3659)
==30423==by 0x16DBC27: execute_one_pass(opt_pass*) (passes.cc:2646)
==30423==by 0x16DCF96: execute_ipa_pass_list(opt_pass*) (passes.cc:3095)
==30423==by 0x12D7DB0: ipa_passes (cgraphunit.cc:2272)
==30423==by 0x12D7DB0: symbol_table::compile() [clone .part.0]
(cgraphunit.cc:2335)
==30423==by 0x12DAB57: compile (cgraphunit.cc:2315)
==30423==by 0x12DAB57: symbol_table::finalize_compilation_unit()
(cgraphunit.cc:2587)
==30423==  Address 0x5d5bde0 is

[Bug tree-optimization/114251] [14 regression] ICE when building python-3.12.2's Hacl_Hash_SHA2.c (tree check: expected class ‘type’, have ‘exceptional’ (error_mark) in useless_type_conversion_p, at g

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

Zdenek Sojka  changed:

   What|Removed |Added

 CC||zsojka at seznam dot cz

--- Comment #1 from Zdenek Sojka  ---
Created attachment 57627
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57627=edit
testcase triggering the same ICE, reduced

$ x86_64-pc-linux-gnu-gcc -O2 -fno-vect-cost-model -mavx2 -fno-strict-overflow
testcase.c 
during GIMPLE pass: slp
testcase.c: In function 'foo':
testcase.c:4:1: internal compiler error: tree check: expected class 'type',
have 'exceptional' (error_mark) in useless_type_conversion_p, at
gimple-expr.cc:85
4 | foo (long e)
  | ^~~
0x892abf tree_class_check_failed(tree_node const*, tree_code_class, char
const*, int, char const*)
/repo/gcc-trunk/gcc/tree.cc:9005
0x77dab4 tree_class_check(tree_node*, tree_code_class, char const*, int, char
const*)
/repo/gcc-trunk/gcc/tree.h:3767
0x77dab4 useless_type_conversion_p(tree_node*, tree_node*)
/repo/gcc-trunk/gcc/gimple-expr.cc:85
0x154c759 verify_gimple_assign_binary
/repo/gcc-trunk/gcc/tree-cfg.cc:4305
0x155e9b1 verify_gimple_in_cfg(function*, bool, bool)
/repo/gcc-trunk/gcc/tree-cfg.cc:5599
0x13cde04 execute_function_todo
/repo/gcc-trunk/gcc/passes.cc:2088
0x13ce35e 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 tree-optimization/114246] New: [11/12/13/14 Regression] ICE: verify_gimple failed: invalid argument to gimple call with __builtin_memcpy()

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

Bug ID: 114246
   Summary: [11/12/13/14 Regression] ICE: verify_gimple failed:
invalid argument to gimple call with
__builtin_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
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu

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

Compiler output:
$ x86_64-pc-linux-gnu-gcc -O testcase.c 
testcase.c: In function 'foo':
testcase.c:8:1: error: invalid argument to gimple call
8 | }
  | ^
(char *) 
# .MEM_3 = VDEF <.MEM_2(D)>
__builtin_memcpy (  [(void *) + 1B], (char *) , 1);
during GIMPLE pass: dse
testcase.c:8:1: internal compiler error: verify_gimple failed
0x155f0bd verify_gimple_in_cfg(function*, bool, bool)
/repo/gcc-trunk/gcc/tree-cfg.cc:5663
0x13cde04 execute_function_todo
/repo/gcc-trunk/gcc/passes.cc:2088
0x13ce35e 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-9323-20240305175124-g8776468d9e5-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 --enable-libsanitizer
--disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r14-9323-20240305175124-g8776468d9e5-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.1 20240305 (experimental) (GCC)

[Bug tree-optimization/114211] New: [13/14 Regression] wrong code with -O -fno-tree-coalesce-vars

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

Bug ID: 114211
   Summary: [13/14 Regression] wrong code with -O
-fno-tree-coalesce-vars
   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 57596
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57596=edit
reduced testcase

Output:
$ x86_64-pc-linux-gnu-gcc -O -fno-tree-coalesce-vars 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-9272-20240302122604-gc8d12343a94-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 --enable-libsanitizer
--disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r14-9272-20240302122604-gc8d12343a94-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.1 20240302 (experimental) (GCC)

[Bug middle-end/114209] New: ICE: verify_gimple failed: incorrect sharing of tree nodes at -O and above

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

Bug ID: 114209
   Summary: ICE: verify_gimple failed: incorrect sharing of tree
nodes at -O and above
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: middle-end
  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: i686-pc-linux-gnu

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

Compiler output:
$ x86_64-pc-linux-gnu-gcc -O -m32 testcase.c 
testcase.c: In function 'foo':
testcase.c:7:1: error: incorrect sharing of tree nodes
7 | foo(void)
  | ^~~
MEM[(_BitInt(128) *)p.0_1]
# VUSE <.MEM_5(D)>
_8 = VIEW_CONVERT_EXPR(MEM[(_BitInt(128) *)p.0_1]);
during GIMPLE pass: bitintlower
testcase.c:7:1: internal compiler error: verify_gimple failed
0x155df5d verify_gimple_in_cfg(function*, bool, bool)
/repo/gcc-trunk/gcc/tree-cfg.cc:5663
0x13cccb4 execute_function_todo
/repo/gcc-trunk/gcc/passes.cc:2088
0x13cd20e 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-9248-20240301110451-gd3d0fcb6527-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 --enable-libsanitizer
--disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r14-9248-20240301110451-gd3d0fcb6527-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.1 20240301 (experimental) (GCC)

[Bug tree-optimization/114190] New: wrong code with -O2 -fno-dce -fharden-compares -mvpclmulqdq --param=max-rtl-if-conversion-unpredictable-cost=136

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

Bug ID: 114190
   Summary: wrong code with -O2 -fno-dce -fharden-compares
-mvpclmulqdq
--param=max-rtl-if-conversion-unpredictable-cost=136
   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 57585
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57585=edit
reduced testcase

Output:
$ x86_64-pc-linux-gnu-gcc -O2 -fno-dce -fharden-compares -mvpclmulqdq
--param=max-rtl-if-conversion-unpredictable-cost=136 testcase.c -Wno-psabi
$ ./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-9248-20240301110451-gd3d0fcb6527-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 --enable-libsanitizer
--disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r14-9248-20240301110451-gd3d0fcb6527-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.1 20240301 (experimental) (GCC)

[Bug target/114184] New: ICE: in extract_insn, at recog.cc:2812 (unrecognizable insn ) with -Og -mavx512f and __builtin_memmove() _BitInt(256)

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

Bug ID: 114184
   Summary: ICE: in extract_insn, at recog.cc:2812 (unrecognizable
insn ) with -Og -mavx512f and __builtin_memmove()
_BitInt(256)
   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
CC: jakub at gcc dot gnu.org
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu

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

Compiler output:
$ x86_64-pc-linux-gnu-gcc -Og -mavx512f testcase.c 
testcase.c: In function 'foo':
testcase.c:7:1: error: unrecognizable insn:
7 | }
  | ^
(insn 5 2 6 2 (set (reg/v:XF 98 [ d ])
(subreg:XF (const_vector:V32QI [
(const_int -107 [0xff95])
(const_int -120 [0xff88])
(const_int 89 [0x59])
(const_int 42 [0x2a])
(const_int 38 [0x26])
(const_int -16 [0xfff0])
(const_int -60 [0xffc4])
(const_int -62 [0xffc2])
(const_int 0 [0]) repeated x24
]) 0)) "testcase.c":6:3 -1
 (nil))
during RTL pass: vregs
testcase.c:7:1: internal compiler error: in extract_insn, at recog.cc:2812
0x807075 _fatal_insn(char const*, rtx_def const*, char const*, int, char
const*)
/repo/gcc-trunk/gcc/rtl-error.cc:108
0x8070f2 _fatal_insn_not_found(rtx_def const*, char const*, int, char const*)
/repo/gcc-trunk/gcc/rtl-error.cc:116
0x7f5f61 extract_insn(rtx_insn*)
/repo/gcc-trunk/gcc/recog.cc:2812
0x113331d instantiate_virtual_regs_in_insn
/repo/gcc-trunk/gcc/function.cc:1611
0x113331d instantiate_virtual_regs
/repo/gcc-trunk/gcc/function.cc:1994
0x113331d 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.

$ 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-9247-20240229194557-gc6d4fb0062c-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 --enable-libsanitizer
--disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r14-9247-20240229194557-gc6d4fb0062c-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.1 20240301 (experimental) (GCC)

[Bug analyzer/114159] New: [13/14 Regression] ICE: in call_info, at analyzer/call-info.cc:143 with -fanalyzer -fanalyzer-call-summaries --param=analyzer-max-svalue-depth=0

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

Bug ID: 114159
   Summary: [13/14 Regression] ICE: in call_info, at
analyzer/call-info.cc:143 with -fanalyzer
-fanalyzer-call-summaries
--param=analyzer-max-svalue-depth=0
   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 57572
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57572=edit
auto-reduced testcase

Compiler output:
$ x86_64-pc-linux-gnu-gcc -fanalyzer -fanalyzer-call-summaries
--param=analyzer-max-svalue-depth=0 pr36690-2.i
during IPA pass: analyzer
pr36690-2.i: In function 'main':
pr36690-2.i:13:3: internal compiler error: in call_info, at
analyzer/call-info.cc:143
   13 |   foo();
  |   ^
0xdc029b ana::call_info::call_info(ana::call_details const&)
/repo/gcc-trunk/gcc/analyzer/call-info.cc:143
0xdc029b ana::call_info::call_info(ana::call_details const&)
/repo/gcc-trunk/gcc/analyzer/call-info.cc:139
0x190bf18 ana::call_summary_edge_info::call_summary_edge_info(ana::call_details
const&, function*, ana::call_summary*, ana::extrinsic_state const&)
/repo/gcc-trunk/gcc/analyzer/engine.cc:1619
0x190bf18 std::enable_if::value,
std::unique_ptr > >::type
make_unique(ana::call_details&,
function*&, ana::call_summary*&, ana::extrinsic_state const&)
/repo/gcc-trunk/gcc/make-unique.h:41
0x190bf18 ana::exploded_node::replay_call_summary(ana::exploded_graph&,
ana::supernode const*, gcall const*, ana::program_state*, ana::path_context*,
function*, ana::call_summary*, ana::region_model_context*)
/repo/gcc-trunk/gcc/analyzer/engine.cc:1734
0x190c0bd ana::exploded_node::replay_call_summaries(ana::exploded_graph&,
ana::supernode const*, gcall const*, ana::program_state*, ana::path_context*,
function*, ana::per_function_data*, ana::region_model_context*)
/repo/gcc-trunk/gcc/analyzer/engine.cc:1677
0x19119df ana::exploded_node::on_stmt(ana::exploded_graph&, ana::supernode
const*, gimple const*, ana::program_state*, ana::uncertainty_t*, bool*,
ana::path_context*)
/repo/gcc-trunk/gcc/analyzer/engine.cc:1499
0x19143ba ana::exploded_graph::process_node(ana::exploded_node*)
/repo/gcc-trunk/gcc/analyzer/engine.cc:4124
0x191532a ana::exploded_graph::process_worklist()
/repo/gcc-trunk/gcc/analyzer/engine.cc:3515
0x1917a85 ana::impl_run_checkers(ana::logger*)
/repo/gcc-trunk/gcc/analyzer/engine.cc:6209
0x1918996 ana::run_checkers()
/repo/gcc-trunk/gcc/analyzer/engine.cc:6300
0x19075f8 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-9216-20240228150317-g5c01ede02a1-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-9216-20240228150317-g5c01ede02a1-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.1 20240228 (experimental) (GCC)

[Bug middle-end/114157] New: during GIMPLE pass: bitintlower ICE: in lower_stmt, at gimple-lower-bitint.cc:5561 with -O with _BitInt(256) / vector memmove

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

Bug ID: 114157
   Summary: during GIMPLE pass: bitintlower ICE: in lower_stmt, at
gimple-lower-bitint.cc:5561 with -O with _BitInt(256)
/ vector memmove
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: middle-end
  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 57570
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57570=edit
reduced testcase

This happens even after the PR113988 fix.
I don't know how much is this related to PR114156.

Compiler output:
$ x86_64-pc-linux-gnu-gcc -O testcase.c -Wno-psabi
during GIMPLE pass: bitintlower
testcase.c: In function 'foo':
testcase.c:4:1: internal compiler error: in lower_stmt, at
gimple-lower-bitint.cc:5561
4 | foo (__attribute__((__vector_size__ (64))) long s)
  | ^~~
0xd79d8e lower_stmt
/repo/gcc-trunk/gcc/gimple-lower-bitint.cc:5561
0x269e129 gimple_lower_bitint
/repo/gcc-trunk/gcc/gimple-lower-bitint.cc:6759
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-9216-20240228150317-g5c01ede02a1-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-9216-20240228150317-g5c01ede02a1-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.1 20240228 (experimental) (GCC)

[Bug middle-end/114156] New: during GIMPLE pass: bitintlower ICE: in lower_stmt, at gimple-lower-bitint.cc:5335 with -O -m32 and _BitInt(128) __builtin_memmove()

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

Bug ID: 114156
   Summary: during GIMPLE pass: bitintlower ICE: in lower_stmt, at
gimple-lower-bitint.cc:5335 with -O -m32 and
_BitInt(128) __builtin_memmove()
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: middle-end
  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: i686-pc-linux-gnu

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

This happens even after the PR113988 fix.

Compiler output:
$ x86_64-pc-linux-gnu-gcc -O -m32 testcase.c
during GIMPLE pass: bitintlower
testcase.c: In function 'foo':
testcase.c:4:1: internal compiler error: in lower_stmt, at
gimple-lower-bitint.cc:5335
4 | foo(void)
  | ^~~
0xd79caa lower_stmt
/repo/gcc-trunk/gcc/gimple-lower-bitint.cc:5335
0x269e129 gimple_lower_bitint
/repo/gcc-trunk/gcc/gimple-lower-bitint.cc:6759
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-9216-20240228150317-g5c01ede02a1-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-9216-20240228150317-g5c01ede02a1-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.1 20240228 (experimental) (GCC)

[Bug target/114139] New: ICE: RTL check: expected code 'const_int', have 'reg' in riscv_macro_fusion_pair_p, at config/riscv/riscv.cc:8438 with -O2 -fpic -mexplicit-relocs -mcpu=sifive-p450

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

Bug ID: 114139
   Summary: ICE: RTL check: expected code 'const_int', have 'reg'
in riscv_macro_fusion_pair_p, at
config/riscv/riscv.cc:8438 with -O2 -fpic
-mexplicit-relocs -mcpu=sifive-p450
   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 57555
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57555=edit
reduced testcase

This might need RTL checking enabled to reproduce.

Compiler output:
$ riscv64-unknown-linux-gnu-gcc -O2 -fpic -mexplicit-relocs -mcpu=sifive-p450
testcase.c
during RTL pass: sched2
testcase.c: In function 'foo':
testcase.c:15:1: internal compiler error: RTL check: expected code 'const_int',
have 'reg' in riscv_macro_fusion_pair_p, at config/riscv/riscv.cc:8438
   15 | }
  | ^
0xad7f4d rtl_check_failed_code1(rtx_def const*, rtx_code, char const*, int,
char const*)
/repo/gcc-trunk/gcc/rtl.cc:770
0xb8ccd4 riscv_macro_fusion_pair_p
/repo/gcc-trunk/gcc/config/riscv/riscv.cc:8438
0x2b11634 sched_macro_fuse_insns
/repo/gcc-trunk/gcc/sched-deps.cc:2859
0x2b11634 sched_analyze_insn
/repo/gcc-trunk/gcc/sched-deps.cc:2898
0x2b12329 deps_analyze_insn(deps_desc*, rtx_insn*)
/repo/gcc-trunk/gcc/sched-deps.cc:3690
0x2b1541a sched_analyze(deps_desc*, rtx_insn*, rtx_insn*)
/repo/gcc-trunk/gcc/sched-deps.cc:3843
0x16b24a8 compute_block_dependences
/repo/gcc-trunk/gcc/sched-rgn.cc:2738
0x16b24a8 sched_rgn_compute_dependencies(int)
/repo/gcc-trunk/gcc/sched-rgn.cc:3367
0x16b4d48 schedule_region
/repo/gcc-trunk/gcc/sched-rgn.cc:3139
0x16b4d48 schedule_insns()
/repo/gcc-trunk/gcc/sched-rgn.cc:3525
0x16b53ed schedule_insns()
/repo/gcc-trunk/gcc/sched-rgn.cc:3511
0x16b53ed rest_of_handle_sched2
/repo/gcc-trunk/gcc/sched-rgn.cc:3749
0x16b53ed 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-9189-20240227001746-g1e2a3b278d7-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-9189-20240227001746-g1e2a3b278d7-checking-yes-rtl-df-extra-riscv64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.1 20240227 (experimental) (GCC)

[Bug target/113742] 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-se

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

--- Comment #4 from Zdenek Sojka  ---
I can confirm the supplied testcase no longer fails.

[Bug middle-end/113988] during GIMPLE pass: bitintlower: internal compiler error: in lower_stmt, at gimple-lower-bitint.cc:5470

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

--- Comment #26 from Zdenek Sojka  ---
Created attachment 57548
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57548=edit
testcase failing with -O -m32

This testcase does not need -mavx512f, but -m32 instead:
$ x86_64-pc-linux-gnu-gcc -O -m32 testcase32.c
during GIMPLE pass: bitintlower
testcase32.c: In function 'foo':
testcase32.c:6:1: internal compiler error: in handle_cast, at
gimple-lower-bitint.cc:1559
6 | foo(void)
  | ^~~
0xd784d7 handle_cast
/repo/gcc-trunk/gcc/gimple-lower-bitint.cc:1559
0x2697a04 lower_mergeable_stmt
/repo/gcc-trunk/gcc/gimple-lower-bitint.cc:2525
0x269bdec lower_stmt
/repo/gcc-trunk/gcc/gimple-lower-bitint.cc:5459
0x269ed49 gimple_lower_bitint
/repo/gcc-trunk/gcc/gimple-lower-bitint.cc:6759
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/114121] New: wrong code with _BitInt() arithmetics at -O2

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

Bug ID: 114121
   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 57547
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57547=edit
reduced testcase

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

$ 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-9167-20240225110837-gd1b241b9506-checking-yes-rtl-df-extra-nobootstrap-pr113988-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-9167-20240225110837-gd1b241b9506-checking-yes-rtl-df-extra-nobootstrap-pr113988-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.1 20240225 (experimental) (GCC)

[Bug middle-end/113988] during GIMPLE pass: bitintlower: internal compiler error: in lower_stmt, at gimple-lower-bitint.cc:5470

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

Zdenek Sojka  changed:

   What|Removed |Added

 CC||zsojka at seznam dot cz

--- Comment #25 from Zdenek Sojka  ---
Created attachment 57531
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57531=edit
combined testcase ICEing at different places with -O -mavx512f

This ICEs on,
$ x86_64-pc-linux-gnu-gcc -O -mavx512f testcase.c
...
xxx.c:2:6: internal compiler error: in handle_operand_addr, at
gimple-lower-bitint.cc:2108

xxx.c:3:12: internal compiler error: in handle_cast, at
gimple-lower-bitint.cc:1559

testcase.c:4:1: internal compiler error: in lower_stmt, at
gimple-lower-bitint.cc:5501

depending on which of the functions is compiled

[Bug tree-optimization/114096] ICE: in lower_stmt, at gimple-lower-bitint.cc:5533 on vector -> _BitInt() cast

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

--- Comment #2 from Zdenek Sojka  ---
It is probably dup of PR114073. Sorry about that.

[Bug tree-optimization/114096] ICE: in lower_stmt, at gimple-lower-bitint.cc:5533 on vector -> _BitInt() cast

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

--- Comment #1 from Zdenek Sojka  ---
This seems to no longer fail with r14-9166:

$ x86_64-pc-linux-gnu-gcc testcase.c -Wno-psabi
/usr/bin/x86_64-pc-linux-gnu-ld: /usr/lib/../lib64/crt1.o: in function
`_start':
(.text+0x17): undefined reference to `main'
collect2: error: ld returned 1 exit status

$ 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-9166-20240225001706-g5c45dc1b978-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-9166-20240225001706-g5c45dc1b978-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.1 20240225 (experimental) (GCC)

[Bug tree-optimization/114096] New: ICE: in lower_stmt, at gimple-lower-bitint.cc:5533 on vector -> _BitInt() cast

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

Bug ID: 114096
   Summary: ICE: in lower_stmt, at gimple-lower-bitint.cc:5533 on
vector -> _BitInt() cast
   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: ---

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

Compiler output:
$ x86_64-pc-linux-gnu-gcc testcase.c -Wno-psabi
during GIMPLE pass: bitintlower0
testcase.c: In function 'foo':
testcase.c:5:1: internal compiler error: in lower_stmt, at
gimple-lower-bitint.cc:5533
5 | foo(V v)
  | ^~~
0xd8d6b3 lower_stmt
/repo/gcc-trunk/gcc/gimple-lower-bitint.cc:5533
0x27235b9 gimple_lower_bitint
/repo/gcc-trunk/gcc/gimple-lower-bitint.cc:6719
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-9161-20240224001742-g4d9da4199d1-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-9161-20240224001742-g4d9da4199d1-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.1 20240224 (experimental) (GCC)

[Bug target/114094] New: Assembler messages: Error: junk `nop' after expression with -fprofile -fPIE -mno-direct-extern-access -masm=intel

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

Bug ID: 114094
   Summary: Assembler messages: Error: junk `nop' after expression
with -fprofile -fPIE -mno-direct-extern-access
-masm=intel
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: assemble-failure
  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

Compiler output:
$ echo 'void foo(void) {}' > testcase.c
$ x86_64-pc-linux-gnu-gcc -fprofile -fPIE -mno-direct-extern-access -masm=intel
testcase.c
/tmp/ccu6XIRH.s: Assembler messages:
/tmp/ccu6XIRH.s:14: Error: junk `nop' after expression

The offending line is:
...
1:  call[QWORD PTR mcount@GOTPCREL[rip]]nop
...

There is probably missing a newline somewhere.


$ 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-9161-20240224001742-g4d9da4199d1-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-9161-20240224001742-g4d9da4199d1-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.1 20240224 (experimental) (GCC)

[Bug tree-optimization/114084] New: ICE: SIGSEGV: infinite recursion in fold_build2_loc / fold_binary_loc with _BitInt(127)

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

Bug ID: 114084
   Summary: ICE: SIGSEGV: infinite recursion in fold_build2_loc /
fold_binary_loc with _BitInt(127)
   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 57518
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57518=edit
reduced testcase

Compiler output:
$ x86_64-pc-linux-gnu-gcc testcase.c -wrapper gdb,-q,--args
Reading symbols from
/repo/gcc-trunk/binary-trunk-r14-9151-20240223113818-g22121546e03-checking-yes-rtl-df-extra-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/14.0.1/cc1...
(gdb) r
Starting program:
/repo/gcc-trunk/binary-trunk-r14-9151-20240223113818-g22121546e03-checking-yes-rtl-df-extra-amd64/libexec/gcc/x86_64-pc-linux-gnu/14.0.1/cc1
-quiet -iprefix
/repo/gcc-trunk/binary-trunk-r14-9151-20240223113818-g22121546e03-checking-yes-rtl-df-extra-amd64/bin/../lib/gcc/x86_64-pc-linux-gnu/14.0.1/
testcase.c -quiet -dumpdir a- -dumpbase testcase.c -dumpbase-ext .c
-mtune=generic -march=x86-64 -o /tmp/ccRiFgDu.s
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".

Program received signal SIGSEGV, Segmentation fault.
wi::fits_to_tree_p > > > (x=..., type=type@entry=0x775b15e8) at
/repo/gcc-trunk/gcc/tree.h:6620
6620return known_eq (x, zext (x, TYPE_PRECISION (type)));
(gdb) bt
#0  wi::fits_to_tree_p > > > (x=...,
type=type@entry=0x775b15e8) at /repo/gcc-trunk/gcc/tree.h:6620
#1  0x01846c63 in force_fit_type (type=0x775b15e8, cst=...,
overflowable=1, overflowed=) at /repo/gcc-trunk/gcc/tree.cc:1563
#2  0x010f2f3a in fold_convert_const_int_from_int (type=0x775b15e8,
arg1=0x775ad7c0) at /repo/gcc-trunk/gcc/fold-const.cc:2173
#3  fold_convert_const (code=, type=0x775b15e8,
arg1=0x775ad7c0) at /repo/gcc-trunk/gcc/fold-const.cc:2467
#4  0x01109095 in fold_unary_loc (loc=2147483656, code=NOP_EXPR,
type=0x775b15e8, op0=0x775ad7c0) at
/repo/gcc-trunk/gcc/fold-const.cc:9489
#5  0x0110b80a in fold_build1_loc (loc=loc@entry=2147483656,
code=code@entry=NOP_EXPR, type=0x775b15e8, op0=0x775ad7c0) at
/repo/gcc-trunk/gcc/fold-const.cc:14110
#6  0x01d76ec2 in generic_simplify_93 (loc=loc@entry=2147483656,
type=type@entry=0x775b1540, _p0=_p0@entry=0x7656d900,
_p1=_p1@entry=0x775ad7c0, 
captures=captures@entry=0x7bfff670, bitop=bitop@entry=BIT_IOR_EXPR) at
generic-match-5.cc:561
#7  0x01da2de5 in generic_simplify_BIT_IOR_EXPR (loc=2147483656,
code=, type=0x775b1540, _p0=0x7656d900,
_p1=0x775ad7c0) at generic-match-6.cc:5599
#8  0x01100576 in fold_binary_loc (loc=2147483656, code=BIT_IOR_EXPR,
type=0x775b1540, op0=0x7656d900, op1=0x775ad7c0) at
/repo/gcc-trunk/gcc/fold-const.cc:11292
#9  0x0110810b in fold_build2_loc (loc=2147483656, code=BIT_IOR_EXPR,
type=0x775b1540, op0=0x7656d900, op1=0x775ad7c0) at
/repo/gcc-trunk/gcc/fold-const.cc:14156
#10 0x0110157d in fold_binary_loc (loc=,
code=BIT_IOR_EXPR, type=0x775b1540, op0=, op1=) at /repo/gcc-trunk/gcc/fold-const.cc:11836
#11 0x0110810b in fold_build2_loc (loc=2147483656, code=BIT_IOR_EXPR,
type=0x775b1540, op0=0x775afc58, op1=0x7656d8c0) at
/repo/gcc-trunk/gcc/fold-const.cc:14156
#12 0x01101626 in fold_binary_loc (loc=, code=, type=0x775b1540, op0=, op1=)
at /repo/gcc-trunk/gcc/fold-const.cc:11868
#13 0x0110810b in fold_build2_loc (loc=2147483656, code=BIT_IOR_EXPR,
type=0x775b1540, op0=0x775afc58, op1=0x7656d840) at
/repo/gcc-trunk/gcc/fold-const.cc:14156
#14 0x01101626 in fold_binary_loc (loc=, code=, type=0x775b1540, op0=, op1=)
at /repo/gcc-trunk/gcc/fold-const.cc:11868
...


$ 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-9151-20240223113818-g22121546e03-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-9

[Bug tree-optimization/114040] wrong code with __builtin_sub_overflow_p() and _BitInt() at -O2 and above

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

--- Comment #3 from Zdenek Sojka  ---
Created attachment 57496
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57496=edit
probaly related testcase

$ x86_64-pc-linux-gnu-gcc -O2 testcase2.c
$ ./a.out 
Aborted

[Bug rtl-optimization/114054] New: ICE: in reduce_to_bit_field_precision, at expr.cc:12658 with -Og -fwhole-program -fno-tree-ccp -fprofile-use -fno-tree-copy-prop and _BitInt()

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

Bug ID: 114054
   Summary: ICE: in reduce_to_bit_field_precision, at
expr.cc:12658 with -Og -fwhole-program -fno-tree-ccp
-fprofile-use -fno-tree-copy-prop and _BitInt()
   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
CC: jakub at gcc dot gnu.org
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu

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

Compiler output:
$ x86_64-pc-linux-gnu-gcc -Og -fwhole-program -fno-tree-ccp -fprofile-use
-fno-tree-copy-prop testcase.c
testcase.c: In function 'main':
testcase.c:13:1: warning: '.../a-testcase.gcda' profile count data file not
found [-Wmissing-profile]
   13 | }
  | ^
during RTL pass: expand
testcase.c: In function 'foo.constprop':
testcase.c:6:7: internal compiler error: in reduce_to_bit_field_precision, at
expr.cc:12658
6 |   x = __builtin_mul_overflow_p ((unsigned _BitInt(1)) u, i,
(_BitInt(33)) 0);
  |   ^~~~
0x763136 reduce_to_bit_field_precision
/repo/gcc-trunk/gcc/expr.cc:12658
0x10bf96a expand_expr_real_2(separate_ops*, rtx_def*, machine_mode,
expand_modifier)
/repo/gcc-trunk/gcc/expr.cc:10267
0x11fb10c expand_arith_overflow
/repo/gcc-trunk/gcc/internal-fn.cc:2722
0xf83d8f expand_call_stmt
/repo/gcc-trunk/gcc/cfgexpand.cc:2771
0xf83d8f expand_gimple_stmt_1
/repo/gcc-trunk/gcc/cfgexpand.cc:3932
0xf83d8f expand_gimple_stmt
/repo/gcc-trunk/gcc/cfgexpand.cc:4077
0xf8a2fe expand_gimple_basic_block
/repo/gcc-trunk/gcc/cfgexpand.cc:6133
0xf8bfd7 execute
/repo/gcc-trunk/gcc/cfgexpand.cc:6872
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-9117-20240221083607-g5772ea772d1-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-9117-20240221083607-g5772ea772d1-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.1 20240221 (experimental) (GCC)

[Bug lto/114043] New: ICE: in write_symbol, at lto-streamer-out.cc:3015 with -O -fstrict-enums -fprofile-generate -flto --param=max-early-inliner-iterations=0

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

Bug ID: 114043
   Summary: ICE: in write_symbol, at lto-streamer-out.cc:3015 with
-O -fstrict-enums -fprofile-generate -flto
--param=max-early-inliner-iterations=0
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: lto
  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 57488
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57488=edit
auto-reduced testcase

Compiler output:
$ x86_64-pc-linux-gnu-gcc -O -fstrict-enums -fprofile-generate -flto
--param=max-early-inliner-iterations=0 script_tile.ii
during IPA pass: modref
script_tile.ii:31:1: internal compiler error: in write_symbol, at
lto-streamer-out.cc:3015
   31 | }
  | ^
0x8aa345 write_symbol
/repo/gcc-trunk/gcc/lto-streamer-out.cc:3015
0x163b3c4 produce_symtab
/repo/gcc-trunk/gcc/lto-streamer-out.cc:3115
0x163b3c4 produce_asm_for_decls()
/repo/gcc-trunk/gcc/lto-streamer-out.cc:3373
0x16cd612 write_lto
/repo/gcc-trunk/gcc/passes.cc:2782
0x16cd612 ipa_write_summaries_1
/repo/gcc-trunk/gcc/passes.cc:2843
0x16cd612 ipa_write_summaries()
/repo/gcc-trunk/gcc/passes.cc:2899
0x12ccbf2 ipa_passes
/repo/gcc-trunk/gcc/cgraphunit.cc:2262
0x12ccbf2 symbol_table::compile()
/repo/gcc-trunk/gcc/cgraphunit.cc:2335
0x12cf3c7 symbol_table::compile()
/repo/gcc-trunk/gcc/cgraphunit.cc:2315
0x12cf3c7 symbol_table::finalize_compilation_unit()
/repo/gcc-trunk/gcc/cgraphunit.cc:2587
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/114041] New: wrong code with _BitInt() and -O -fgraphite-identity

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

Bug ID: 114041
   Summary: wrong code with _BitInt() and -O -fgraphite-identity
   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 57486
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57486=edit
reduced testcase

Output:
$ x86_64-pc-linux-gnu-gcc -O -fgraphite-identity 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-9117-20240221083607-g5772ea772d1-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-9117-20240221083607-g5772ea772d1-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.1 20240221 (experimental) (GCC)

[Bug c/114042] New: diagnostics about __builtin_stdc_bit_ceil() mentions __builtin_clzg()

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

Bug ID: 114042
   Summary: diagnostics about __builtin_stdc_bit_ceil() mentions
__builtin_clzg()
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: diagnostic
  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 57487
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57487=edit
reduced testcase

Compiler output:
$ gcc-14 bc.c 
bc.c: In function ‘foo’:
bc.c:4:36: error: argument 1 in call to function ‘__builtin_clzg’ has signed
type
4 | return __builtin_stdc_bit_ceil(i);
  |^


but it should talk about __builtin_stdc_bit_ceil()

[Bug rtl-optimization/114044] New: ICE: in expand_fn_using_insn, at internal-fn.cc:208 with _BitInt() and -O -fno-tree-dce

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

Bug ID: 114044
   Summary: ICE: in expand_fn_using_insn, at internal-fn.cc:208
with _BitInt() and -O -fno-tree-dce
   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
CC: jakub at gcc dot gnu.org
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu

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

Compiler output:
$ x86_64-pc-linux-gnu-gcc -O -fno-tree-dce testcase.c 
during RTL pass: expand
testcase.c: In function 'foo':
testcase.c:5:7: internal compiler error: in expand_fn_using_insn, at
internal-fn.cc:208
5 |   5 | __builtin_stdc_bit_floor(ub256_0) & 4;
  |   ^
0x79b2a7 expand_fn_using_insn
/repo/gcc-trunk/gcc/internal-fn.cc:208
0xf83d8f expand_call_stmt
/repo/gcc-trunk/gcc/cfgexpand.cc:2771
0xf83d8f expand_gimple_stmt_1
/repo/gcc-trunk/gcc/cfgexpand.cc:3932
0xf83d8f expand_gimple_stmt
/repo/gcc-trunk/gcc/cfgexpand.cc:4077
0xf8a2fe expand_gimple_basic_block
/repo/gcc-trunk/gcc/cfgexpand.cc:6133
0xf8bfd7 execute
/repo/gcc-trunk/gcc/cfgexpand.cc:6872
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-9117-20240221083607-g5772ea772d1-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-9117-20240221083607-g5772ea772d1-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.1 20240221 (experimental) (GCC)

[Bug tree-optimization/114040] New: wrong code with __builtin_sub_overflow_p() and _BitInt() at -O2 and above

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

Bug ID: 114040
   Summary: wrong code with __builtin_sub_overflow_p() and
_BitInt() at -O2 and above
   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 57485
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57485=edit
reduced testcase

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-9117-20240221083607-g5772ea772d1-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-9117-20240221083607-g5772ea772d1-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.1 20240221 (experimental) (GCC)

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

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

Bug ID: 114038
   Summary: wrong code with __builtin_mul_overflow_p() 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 57481
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57481=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-9091-20240220194451-g0a6a5f8656c-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-9091-20240220194451-g0a6a5f8656c-checking-yes-rtl-df-extra-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.1 20240221 (experimental) (GCC)

[Bug target/114016] New: ICE: in AT_unsigned, at dwarf2out.cc:4592 with -march=armv9-a -gbtf or -gctf

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

Bug ID: 114016
   Summary: ICE: in AT_unsigned, at dwarf2out.cc:4592 with
-march=armv9-a -gbtf or -gctf
   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 57473
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57473=edit
reduced testcase

Compiler output:
$ aarch64-unknown-linux-gnu-gcc -march=armv9-a -gbtf testcase.c 
testcase.c:2:1: internal compiler error: in AT_unsigned, at dwarf2out.cc:4592
2 | void fn_f64x4(svfloat64x4_t) {}
  | ^~~~
0x7a2627 AT_unsigned(dw_attr_struct*)
/repo/gcc-trunk/gcc/dwarf2out.cc:4592
0x7a433d AT_unsigned(dw_attr_struct*)
/repo/gcc-trunk/gcc/dwarf2out.cc:4591
0xe43aee ctf_die_bitsize
/repo/gcc-trunk/gcc/dwarf2ctf.cc:211
0xe4463e gen_ctf_sou_type
/repo/gcc-trunk/gcc/dwarf2ctf.cc:526
0xe43f07 gen_ctf_type
/repo/gcc-trunk/gcc/dwarf2ctf.cc:892
0xe43cc7 gen_ctf_function_type
/repo/gcc-trunk/gcc/dwarf2ctf.cc:718
0xe44b53 gen_ctf_function
/repo/gcc-trunk/gcc/dwarf2ctf.cc:853
0xe44b53 ctf_do_die(die_struct*)
/repo/gcc-trunk/gcc/dwarf2ctf.cc:974
0xe99183 ctf_debug_do_cu
/repo/gcc-trunk/gcc/dwarf2out.cc:33018
0xe99183 ctf_debug_do_cu
/repo/gcc-trunk/gcc/dwarf2out.cc:33011
0xe99183 dwarf2out_early_finish
/repo/gcc-trunk/gcc/dwarf2out.cc:33147
0xdf680f symbol_table::finalize_compilation_unit()
/repo/gcc-trunk/gcc/cgraphunit.cc:2580
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-9077-20240220001758-g52490278466-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-9077-20240220001758-g52490278466-checking-yes-rtl-df-extra-aarch64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.1 20240220 (experimental) (GCC)

[Bug debug/114015] New: ICE: in build_abbrev_table, at dwarf2out.cc:9266 with -g -fvar-tracking-assignments -fdebug-types-section

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

Bug ID: 114015
   Summary: ICE: in build_abbrev_table, at dwarf2out.cc:9266 with
-g -fvar-tracking-assignments -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: x86_64-pc-linux-gnu

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

Compiler output:
$ x86_64-pc-linux-gnu-gcc -g -fvar-tracking-assignments -fdebug-types-section
testcase.c -w
testcase.c:1:35: internal compiler error: in build_abbrev_table, at
dwarf2out.cc:9266
1 | int barfoo(_BitInt(236) n, struct {char a[n];}) {}
  |   ^
0x7463b2 build_abbrev_table
/repo/gcc-trunk/gcc/dwarf2out.cc:9266
0x1046418 build_abbrev_table
/repo/gcc-trunk/gcc/dwarf2out.cc:9323
0x1046418 build_abbrev_table
/repo/gcc-trunk/gcc/dwarf2out.cc:9323
0x1046871 output_comdat_type_unit
/repo/gcc-trunk/gcc/dwarf2out.cc:11473
0x1070e1a dwarf2out_finish
/repo/gcc-trunk/gcc/dwarf2out.cc:32565
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-9077-20240220001758-g52490278466-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-9077-20240220001758-g52490278466-checking-yes-rtl-df-extra-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.1 20240220 (experimental) (GCC)

[Bug debug/114014] New: ICE: 'verify_type' failed: 'TYPE_CANONICAL' is not compatible with -gbtf or -gctf on gcc.dg/gnu23-tag-1.c

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

Bug ID: 114014
   Summary: ICE: 'verify_type' failed: 'TYPE_CANONICAL' is not
compatible with -gbtf or -gctf on gcc.dg/gnu23-tag-1.c
   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 57471
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57471=edit
reduced, valid testcase (from gcc.dg/gnu23-tag-1.c)

Compiler output:
$ x86_64-pc-linux-gnu-gcc -std=gnu23 testcase.c -gbtf
testcase.c:8:1: error: 'TYPE_CANONICAL' is not compatible
8 | };
  | ^
 >
testcase.c:8:1: internal compiler error: 'verify_type' failed
0x185477e verify_type(tree_node const*)
/repo/gcc-trunk/gcc/tree.cc:14394
0x1053f24 gen_type_die_with_usage
/repo/gcc-trunk/gcc/dwarf2out.cc:26266
0x1050c38 gen_type_die
/repo/gcc-trunk/gcc/dwarf2out.cc:26497
0x1050c38 gen_decl_die
/repo/gcc-trunk/gcc/dwarf2out.cc:27137
0x1051f6b dwarf2out_decl
/repo/gcc-trunk/gcc/dwarf2out.cc:27695
0x10521c8 dwarf2out_type_decl
/repo/gcc-trunk/gcc/dwarf2out.cc:27413
0x10521c8 dwarf2out_type_decl
/repo/gcc-trunk/gcc/dwarf2out.cc:27408
0x13d07c4 rest_of_type_compilation(tree_node*, int)
/repo/gcc-trunk/gcc/passes.cc:339
0xe0e7e2 finish_struct(unsigned int, tree_node*, tree_node*, tree_node*,
c_struct_parse_info*, tree_node**)
/repo/gcc-trunk/gcc/c/c-decl.cc:9733
0xe6919d c_parser_struct_or_union_specifier
/repo/gcc-trunk/gcc/c/c-parser.cc:4090
0xe6919d 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
0xe7871c c_parser_declaration_or_fndef
/repo/gcc-trunk/gcc/c/c-parser.cc:2306
0xe848eb c_parser_external_declaration
/repo/gcc-trunk/gcc/c/c-parser.cc:2046
0xe852d5 c_parser_translation_unit
/repo/gcc-trunk/gcc/c/c-parser.cc:1900
0xe852d5 c_parse_file()
/repo/gcc-trunk/gcc/c/c-parser.cc:26816
0xefcaf1 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 <https://gcc.gnu.org/bugs/> for instructions.

$ x86_64-pc-linux-gnu-gcc -std=gnu23 testcase.c -gctf
testcase.c:8:1: error: 'TYPE_CANONICAL' is not compatible
8 | };
  | ^
 

[Bug target/114000] New: [11/12/13/14 Regression] ICE: in force_nonfallthru_and_redirect, at cfgrtl.cc:1556 with -O2 -freorder-blocks-and-partition -fPIC -mexplicit-relocs

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

Bug ID: 114000
   Summary: [11/12/13/14 Regression] ICE: in
force_nonfallthru_and_redirect, at cfgrtl.cc:1556 with
-O2 -freorder-blocks-and-partition -fPIC
-mexplicit-relocs
   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 57465
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57465=edit
reduced testcase

Compiler output:
$ riscv64-unknown-linux-gnu-gcc -O2 -freorder-blocks-and-partition -fPIC
-mexplicit-relocs testcase.c 
during RTL pass: pro_and_epilogue
testcase.c: In function 'foo':
testcase.c:11:1: internal compiler error: in force_nonfallthru_and_redirect, at
cfgrtl.cc:1556
   11 | }
  | ^
0xa05536 force_nonfallthru_and_redirect(edge_def*, basic_block_def*, rtx_def*)
/repo/gcc-trunk/gcc/cfgrtl.cc:1556
0x1193ce3 redirect_edge_and_branch_force(edge_def*, basic_block_def*)
/repo/gcc-trunk/gcc/cfghooks.cc:508
0x16d5bfa try_shrink_wrapping(edge_def**, rtx_insn*)
/repo/gcc-trunk/gcc/shrink-wrap.cc:1019
0x1349c4b thread_prologue_and_epilogue_insns()
/repo/gcc-trunk/gcc/function.cc:6057
0x134a5d2 rest_of_handle_thread_prologue_and_epilogue
/repo/gcc-trunk/gcc/function.cc:6565
0x134a5d2 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.

$ 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-9062-20240219114159-geb17bdc211a-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-9062-20240219114159-geb17bdc211a-checking-yes-rtl-df-extra-riscv64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.1 20240219 (experimental) (GCC)

[Bug analyzer/113999] New: [14 Regression] ICE: in string_cst_has_null_terminator, at analyzer/region-model.cc:3651 with -fanalyzer on gcc.dg/tree-ssa/strncpy-2.c

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

Bug ID: 113999
   Summary: [14 Regression] ICE: in
string_cst_has_null_terminator, at
analyzer/region-model.cc:3651 with -fanalyzer on
gcc.dg/tree-ssa/strncpy-2.c
   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 57464
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57464=edit
auto-reduced testcase

Maybe related to PR113998

Compiler output:
$ x86_64-pc-linux-gnu-gcc -fanalyzer gcc.dg/tree-ssa/strncpy-2.c
during IPA pass: analyzer
gcc.dg/tree-ssa/strncpy-2.c: In function 'main':
gcc.dg/tree-ssa/strncpy-2.c:24:15: internal compiler error: in
string_cst_has_null_terminator, at analyzer/region-model.cc:3651
   24 |   size_t n1 = __builtin_strlen (a);
  |   ^~~~
0x8c3351 string_cst_has_null_terminator
/repo/gcc-trunk/gcc/analyzer/region-model.cc:3651
0x195c069 svalue_byte_range_has_null_terminator_1
/repo/gcc-trunk/gcc/analyzer/region-model.cc:3712
0x195c069 svalue_byte_range_has_null_terminator
/repo/gcc-trunk/gcc/analyzer/region-model.cc:3809
0x195c3c8 svalue_byte_range_has_null_terminator_1
/repo/gcc-trunk/gcc/analyzer/region-model.cc:3774
0x195c3c8 svalue_byte_range_has_null_terminator
/repo/gcc-trunk/gcc/analyzer/region-model.cc:3809
0x1969838 ana::region_model::scan_for_null_terminator_1(ana::region const*,
tree_node*, ana::svalue const**, ana::region_model_context*) const
/repo/gcc-trunk/gcc/analyzer/region-model.cc:4066
0x196a67e
ana::region_model::check_for_null_terminated_string_arg(ana::call_details
const&, unsigned int, bool, ana::svalue const**) const
/repo/gcc-trunk/gcc/analyzer/region-model.cc:4337
0x1945766 ana::kf_strlen::impl_call_pre(ana::call_details const&) const
/repo/gcc-trunk/gcc/analyzer/kf.cc:1389
0x1961a57 ana::region_model::on_call_pre(gcall const*,
ana::region_model_context*)
/repo/gcc-trunk/gcc/analyzer/region-model.cc:1700
0x196600a ana::region_model::on_stmt_pre(gimple const*, bool*,
ana::region_model_context*)
/repo/gcc-trunk/gcc/analyzer/region-model.cc:1337
0x192cf70 ana::exploded_node::on_stmt(ana::exploded_graph&, ana::supernode
const*, gimple const*, ana::program_state*, ana::uncertainty_t*, bool*,
ana::path_context*)
/repo/gcc-trunk/gcc/analyzer/engine.cc:1512
0x192ff05 ana::exploded_graph::process_node(ana::exploded_node*)
/repo/gcc-trunk/gcc/analyzer/engine.cc:4124
0x1930e3a ana::exploded_graph::process_worklist()
/repo/gcc-trunk/gcc/analyzer/engine.cc:3515
0x19335a3 ana::impl_run_checkers(ana::logger*)
/repo/gcc-trunk/gcc/analyzer/engine.cc:6209
0x19344b6 ana::run_checkers()
/repo/gcc-trunk/gcc/analyzer/engine.cc:6300
0x1922e58 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-9062-20240219114159-geb17bdc211a-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-9062-20240219114159-geb17bdc211a-checking-yes-rtl-df-extra-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.1 20240219 (experimental) (GCC)

[Bug analyzer/113998] New: [14 Regression] ICE: in get_last_byte_offset, at analyzer/ranges.cc:171 with -fanalyzer and __builtin_strncpy()

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

Bug ID: 113998
   Summary: [14 Regression] ICE: in get_last_byte_offset, at
analyzer/ranges.cc:171 with -fanalyzer and
__builtin_strncpy()
   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 57463
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57463=edit
reduced testcase

Compiler output:
$ x86_64-pc-linux-gnu-gcc -fanalyzer testcase.c
during IPA pass: analyzer
testcase.c: In function 'main':
testcase.c:7:3: internal compiler error: in get_last_byte_offset, at
analyzer/ranges.cc:171
7 |   __builtin_strncpy (a, a, n);
  |   ^~~
0xdd3983
ana::symbolic_byte_range::get_last_byte_offset(ana::region_model_manager&)
const
/repo/gcc-trunk/gcc/analyzer/ranges.cc:171
0x29727b7 ana::symbolic_byte_range::intersection(ana::symbolic_byte_range
const&, ana::region_model const&) const
/repo/gcc-trunk/gcc/analyzer/ranges.cc:202
0x2948321 ana::call_details::complain_about_overlap(unsigned int, unsigned int,
ana::svalue const*) const
/repo/gcc-trunk/gcc/analyzer/call-details.cc:517
0x194238f update_model
/repo/gcc-trunk/gcc/analyzer/kf.cc:1545
0x193038a ana::exploded_graph::process_node(ana::exploded_node*)
/repo/gcc-trunk/gcc/analyzer/engine.cc:4240
0x1930e3a ana::exploded_graph::process_worklist()
/repo/gcc-trunk/gcc/analyzer/engine.cc:3515
0x19335a3 ana::impl_run_checkers(ana::logger*)
/repo/gcc-trunk/gcc/analyzer/engine.cc:6209
0x19344b6 ana::run_checkers()
/repo/gcc-trunk/gcc/analyzer/engine.cc:6300
0x1922e58 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-9062-20240219114159-geb17bdc211a-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-9062-20240219114159-geb17bdc211a-checking-yes-rtl-df-extra-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.1 20240219 (experimental) (GCC)

[Bug target/113995] New: ICE: in change_address_1, at emit-rtl.cc:2299 with [[arm::streaming_compatible]] and -march=armv9-a+sve -finstrument-functions -fstack-clash-protection

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

Bug ID: 113995
   Summary: ICE: in change_address_1, at emit-rtl.cc:2299 with
[[arm::streaming_compatible]] and -march=armv9-a+sve
-finstrument-functions -fstack-clash-protection
   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 57461
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57461=edit
reduced testcase (from gcc.target/aarch64/sve/acle/general-c/func_redef_5.c)

Compiler output:
$ aarch64-unknown-linux-gnu-gcc -march=armv9-a+sve -finstrument-functions
-fstack-clash-protection testcase.c 
during RTL pass: pro_and_epilogue
testcase.c: In function 'svadd_u8_x':
testcase.c:1:68: internal compiler error: in change_address_1, at
emit-rtl.cc:2299
1 | __SVUint8_t svadd_u8_x(__SVUint8_t) [[arm::streaming_compatible]] {}
  |^
0x7af34f change_address_1
/repo/gcc-trunk/gcc/emit-rtl.cc:2299
0xeee695 emit_move_insn(rtx_def*, rtx_def*)
/repo/gcc-trunk/gcc/expr.cc:4712
0x17207ee aarch64_save_callee_saves
/repo/gcc-trunk/gcc/config/aarch64/aarch64.cc:8573
0x172322d aarch64_expand_prologue()
/repo/gcc-trunk/gcc/config/aarch64/aarch64.cc:9626
0x1d615da gen_prologue()
/repo/gcc-trunk/gcc/config/aarch64/aarch64.md:1003
0x170c175 target_gen_prologue
/repo/gcc-trunk/gcc/config/aarch64/aarch64.md:8109
0xf6b3e7 make_prologue_seq
/repo/gcc-trunk/gcc/function.cc:5816
0xf6b583 thread_prologue_and_epilogue_insns()
/repo/gcc-trunk/gcc/function.cc:6051
0xf6bf22 rest_of_handle_thread_prologue_and_epilogue
/repo/gcc-trunk/gcc/function.cc:6565
0xf6bf22 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.

$ 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-9062-20240219114159-geb17bdc211a-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-9062-20240219114159-geb17bdc211a-checking-yes-rtl-df-extra-aarch64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.1 20240219 (experimental) (GCC)

  1   2   3   4   5   6   7   8   9   10   >