[Bug c++/116681] [12/13/14/15 Regression] ICE: in start, at timevar.cc:491 with -ftime-report -std=c++20

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

--- Comment #6 from Zdenek Sojka  ---
(In reply to Simon Martin from comment #5)
> Fixed on trunk.

Thank you for fixing this. The "Target Milestone: 12.5" does not match reality,
it's not fixed for 12.5.

[Bug target/116698] New: [12/13/14/15 Regression] ICE: in add_cfi_args_size, at dwarf2cfi.cc:501 with -O -finstrument-functions -fstack-check=generic -m32 -mrtd -maccumulate-outgoing-args

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

Bug ID: 116698
   Summary: [12/13/14/15 Regression] ICE: in add_cfi_args_size, at
dwarf2cfi.cc:501 with -O -finstrument-functions
-fstack-check=generic -m32 -mrtd
-maccumulate-outgoing-args
   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 59105
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=59105&action=edit
reduced testcase

Compiler output:
$ x86_64-pc-linux-gnu-gcc -O -finstrument-functions -fstack-check=generic -m32
-mrtd -maccumulate-outgoing-args testcase.C 
during RTL pass: dwarf2
testcase.C: In function 'void foo()':
testcase.C:19:1: internal compiler error: in add_cfi_args_size, at
dwarf2cfi.cc:501
   19 | }
  | ^
0x2f052fe internal_error(char const*, ...)
/repo/gcc-trunk/gcc/diagnostic-global-context.cc:517
0xf5564d fancy_abort(char const*, int, char const*)
/repo/gcc-trunk/gcc/diagnostic.cc:1657
0x850fdf add_cfi_args_size
/repo/gcc-trunk/gcc/dwarf2cfi.cc:501
0x850fdf add_cfi_args_size
/repo/gcc-trunk/gcc/dwarf2cfi.cc:492
0x850fdf connect_traces
/repo/gcc-trunk/gcc/dwarf2cfi.cc:3087
0x850fdf execute_dwarf2_frame
/repo/gcc-trunk/gcc/dwarf2cfi.cc:3310
0x850fdf execute
/repo/gcc-trunk/gcc/dwarf2cfi.cc:3797
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-3588-20240911155124-g670cfd5fe64-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-3588-20240911155124-g670cfd5fe64-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 15.0.0 20240911 (experimental) (GCC)

[Bug c++/116681] New: [12/13/14/15 Regression] ICE: in start, at timevar.cc:491 with -ftime-report -std=c++20

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

Bug ID: 116681
   Summary: [12/13/14/15 Regression] ICE: in start, at
timevar.cc:491 with -ftime-report -std=c++20
   Product: gcc
   Version: 15.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu

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

Compiler output:
$ x86_64-pc-linux-gnu-gcc -ftime-report -std=c++20 testcase.C 
testcase.C: In instantiation of 'struct reverse_iterator':
testcase.C:27:35:   required from here
   27 | for (set::reverse_iteratorINT iter;;)
  |   ^~~~
testcase.C:3:44: internal compiler error: in start, at timevar.cc:491
3 | concept default_initializable = requires { new _Tp; };
  |^~~
0x2ef1bbe internal_error(char const*, ...)
/repo/gcc-trunk/gcc/diagnostic-global-context.cc:517
0xf557d3 fancy_abort(char const*, int, char const*)
/repo/gcc-trunk/gcc/diagnostic.cc:1657
0x92fc85 timer::start(timevar_id_t)
/repo/gcc-trunk/gcc/timevar.cc:491
0x92fc85 timer::start(timevar_id_t)
/repo/gcc-trunk/gcc/timevar.cc:482
0x92fc85 timevar_start(timevar_id_t)
/repo/gcc-trunk/gcc/timevar.cc:476
0x10e4845 qualified_namespace_lookup
/repo/gcc-trunk/gcc/cp/name-lookup.cc:7424
0x10e599f lookup_qualified_name(tree_node*, tree_node*, LOOK_want, bool)
/repo/gcc-trunk/gcc/cp/name-lookup.cc:7387
0xf79b3e build_operator_new_call(tree_node*, vec**, tree_node**, tree_node**, tree_node*, tree_node*, tree_node**,
int)
/repo/gcc-trunk/gcc/cp/call.cc:5194
0x1069721 build_new_1
/repo/gcc-trunk/gcc/cp/init.cc:3465
0x106b8cc build_new(unsigned int, vec**,
tree_node*, tree_node*, vec**, int, int)
/repo/gcc-trunk/gcc/cp/init.cc:4068
0x117bece tsubst_expr(tree_node*, tree_node*, int, tree_node*)
/repo/gcc-trunk/gcc/cp/pt.cc:20767
0xfc20ad tsubst_valid_expression_requirement
/repo/gcc-trunk/gcc/cp/constraint.cc:1444
0xfc86f7 tsubst_simple_requirement
/repo/gcc-trunk/gcc/cp/constraint.cc:1478
0xfc86f7 tsubst_requirement
/repo/gcc-trunk/gcc/cp/constraint.cc:1693
0xfc86f7 tsubst_requires_expr
/repo/gcc-trunk/gcc/cp/constraint.cc:1833
0xfc8e2a tsubst_requires_expr(tree_node*, tree_node*, int, tree_node*)
/repo/gcc-trunk/gcc/cp/constraint.cc:1857
0x117ac05 tsubst_expr(tree_node*, tree_node*, int, tree_node*)
/repo/gcc-trunk/gcc/cp/pt.cc:21868
0xfca29b satisfy_atom
/repo/gcc-trunk/gcc/cp/constraint.cc:2523
0xfca29b satisfy_constraint_r
/repo/gcc-trunk/gcc/cp/constraint.cc:2588
0xfca6d3 satisfy_normalized_constraints
/repo/gcc-trunk/gcc/cp/constraint.cc:2613
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-3558-20240910125013-gc726a664312-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-3558-20240910125013-gc726a664312-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 15.0.0 20240910 (experimental) (GCC)

[Bug debug/116664] New: ICE: in force_decl_die, at dwarf2out.cc:26937 with -fno-emit-struct-debug-baseonly

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

Bug ID: 116664
   Summary: ICE: in force_decl_die, at dwarf2out.cc:26937 with
-fno-emit-struct-debug-baseonly
   Product: gcc
   Version: 15.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 59089
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=59089&action=edit
auto-reduced testcase

Compiler output:
$ x86_64-pc-linux-gnu-gcc -g -fno-emit-struct-debug-baseonly testcase.ii 
: In function 'void get_container()':
:22:1: internal compiler error: in force_decl_die, at dwarf2out.cc:26937
0x2ef1bbe internal_error(char const*, ...)
/repo/gcc-trunk/gcc/diagnostic-global-context.cc:517
0xf557d3 fancy_abort(char const*, int, char const*)
/repo/gcc-trunk/gcc/diagnostic.cc:1657
0x8581da force_decl_die
/repo/gcc-trunk/gcc/dwarf2out.cc:26937
0x13f131d force_decl_die
/repo/gcc-trunk/gcc/dwarf2out.cc:26888
0x13f131d dwarf2out_imported_module_or_decl_1
/repo/gcc-trunk/gcc/dwarf2out.cc:27565
0x140f3ff decls_for_scope
/repo/gcc-trunk/gcc/dwarf2out.cc:26756
0x13ed463 gen_subprogram_die
/repo/gcc-trunk/gcc/dwarf2out.cc:24228
0x13f2049 gen_decl_die
/repo/gcc-trunk/gcc/dwarf2out.cc:27193
0x13f2c9b dwarf2out_decl
/repo/gcc-trunk/gcc/dwarf2out.cc:27774
0x13f3116 dwarf2out_early_global_decl
/repo/gcc-trunk/gcc/dwarf2out.cc:27415
0x126c784 c_common_finalize_early_debug()
/repo/gcc-trunk/gcc/c-family/c-common.cc:9954
0x136fd62 symbol_table::finalize_compilation_unit()
/repo/gcc-trunk/gcc/cgraphunit.cc:2579
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

$ 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-3558-20240910125013-gc726a664312-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-3558-20240910125013-gc726a664312-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 15.0.0 20240910 (experimental) (GCC)

[Bug tree-optimization/116588] [14 Regression] wrong code with -O2 -fno-vect-cost-model -fno-tree-dominator-opts -fno-tree-fre --param=vrp-block-limit=0

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

--- Comment #6 from Zdenek Sojka  ---
Is the -DDEBUG in dg-options correct? I think the testcase won't fail at
runtime when -DDEBUG is used.

[Bug middle-end/116601] New: [15 Regression] during GIMPLE pass: fab ICE: verify_gimple failed: statement marked for throw, but doesn't with -O -fnon-call-exceptions

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

Bug ID: 116601
   Summary: [15 Regression] during GIMPLE pass: fab ICE:
verify_gimple failed: statement marked for throw, but
doesn't with -O -fnon-call-exceptions
   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 59050
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=59050&action=edit
auto-reduced testcase

Compiler output:
$ x86_64-pc-linux-gnu-gcc -O -fnon-call-exceptions testcase.C 
testcase.C: In function 'void ShowVehicleRefitWindow()':
testcase.C:22:6: error: statement marked for throw, but doesn't
   22 | void ShowVehicleRefitWindow() { new RefitWindow; }
  |  ^~
# .MEM_11 = VDEF <.MEM_10>
__trans_tmp_2 = {};
during GIMPLE pass: fab
testcase.C:22:6: internal compiler error: verify_gimple failed
0x2eeb08e internal_error(char const*, ...)
/repo/gcc-trunk/gcc/diagnostic-global-context.cc:492
0x18fcded verify_gimple_in_cfg(function*, bool, bool)
/repo/gcc-trunk/gcc/tree-cfg.cc:5681
0x176da14 execute_function_todo
/repo/gcc-trunk/gcc/passes.cc:2089
0x176df6e 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-3443-20240904104428-gda3a2985fff-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-3443-20240904104428-gda3a2985fff-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 15.0.0 20240903 (experimental) (GCC)

[Bug tree-optimization/116588] New: wrong code with -O2 -fno-vect-cost-model -fno-tree-dominator-opts -fno-tree-fre --param=vrp-block-limit=0

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

Bug ID: 116588
   Summary: wrong code with -O2 -fno-vect-cost-model
-fno-tree-dominator-opts -fno-tree-fre
--param=vrp-block-limit=0
   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 59046
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=59046&action=edit
reduced testcase

Output:
$ x86_64-pc-linux-gnu-gcc -O2 -fno-vect-cost-model -fno-tree-dominator-opts
-fno-tree-fre --param=vrp-block-limit=0 testcase.c -DDEBUG
$ ./a.out 
a07f87104000
$ ./a.out 
0f7f87104000
$ ./a.out 
b08159c7a27f87104000
$ ./a.out 
b0a1cc0ded7f87104000

$ valgrind -q --track-origins=yes ./a.out
==22934== Use of uninitialised value of size 8
==22934==at 0x48FCC79: _itoa_word (in /lib64/libc.so.6)
==22934==by 0x4906858: __printf_buffer (in /lib64/libc.so.6)
==22934==by 0x4908880: __vfprintf_internal (in /lib64/libc.so.6)
==22934==by 0x48FDC95: printf (in /lib64/libc.so.6)
==22934==by 0x4010B2: main (testcase.c:19)
==22934==  Uninitialised value was created by a stack allocation
==22934==at 0x4011C0: foo (testcase.c:6)
...

The output is different on each invocation.

$ x86_64-pc-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=/repo/gcc-trunk/binary-latest/bin/x86_64-pc-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-r15-3427-20240903182055-gf0ab3de6ec0-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-3427-20240903182055-gf0ab3de6ec0-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 15.0.0 20240903 (experimental) (GCC)

[Bug target/116587] New: ICE: in lra_split_hard_reg_for, at lra-assigns.cc:1868 (unable to find a register to spill) {*andndi3_doubleword_bmi} with custom flags

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

Bug ID: 116587
   Summary: ICE: in lra_split_hard_reg_for, at lra-assigns.cc:1868
(unable to find a register to spill)
{*andndi3_doubleword_bmi} with custom flags
   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 59045
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=59045&action=edit
reduced testcase

This needs a lot of custom flags to reproduce; this looks similar to PR113048,
so it might be useful to someone having a look at that PR:

$ x86_64-pc-linux-gnu-gcc -O2 -fPIC -mstackrealign -mavx512f
-fharden-control-flow-redundancy -fno-omit-frame-pointer -m32 -mbmi
-fkeep-gc-roots-live testcase.c
testcase.c: In function 'h':
testcase.c:24:1: error: unable to find a register to spill
   24 | }
  | ^
testcase.c:24:1: error: this is the insn:
(insn 281 402 438 5 (parallel [
(set (reg:DI 477 [360])
(and:DI (not:DI (reg/v:DI 368 [orig:227 d ] [227]))
(mem:DI (plus:SI (reg:SI 443)
(reg:SI 444 [orig:158 ivtmp.69 ] [158])) [2
MEM[(long long unsigned int *)i_16(D) + ivtmp.69_139 * 1]+0 S8 A32])))
(clobber (reg:CC 17 flags))
]) "testcase.c":11:8 806 {*andndi3_doubleword_bmi}
 (expr_list:REG_DEAD (reg:SI 443)
(expr_list:REG_DEAD (reg:SI 444 [orig:158 ivtmp.69 ] [158])
(expr_list:REG_DEAD (reg/v:DI 368 [orig:227 d ] [227])
(expr_list:REG_UNUSED (reg:CC 17 flags)
(nil))
during RTL pass: reload
testcase.c:24:1: internal compiler error: in lra_split_hard_reg_for, at
lra-assigns.cc:1868
0x2be6f8e internal_error(char const*, ...)
/repo/gcc-trunk/gcc/diagnostic-global-context.cc:492
0xe745d5 fancy_abort(char const*, int, char const*)
/repo/gcc-trunk/gcc/diagnostic.cc:1658
0x830947 _fatal_insn(char const*, rtx_def const*, char const*, int, char
const*)
/repo/gcc-trunk/gcc/rtl-error.cc:108
0x139bd2d lra_split_hard_reg_for()
/repo/gcc-trunk/gcc/lra-assigns.cc:1868
0x13953c8 lra(_IO_FILE*, int)
/repo/gcc-trunk/gcc/lra.cc:2521
0x134335f do_reload
/repo/gcc-trunk/gcc/ira.cc:5976
0x134335f execute
/repo/gcc-trunk/gcc/ira.cc:6164
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 target/116504] wrong code with -mcpu=sifive-x280

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

--- Comment #7 from Zdenek Sojka  ---
(In reply to Jeffrey A. Law from comment #4)
> It's not failing for me, either when using QEMU or when running the
> resultant binary on the BPI.
> 
> Zdenek, can you (privately) pass along the resulting binary you're testing. 
> It's pretty easy for me to run that on real hardware.

Thank you for trying this out!
I've attached the asm output I get to this PR, and also I've sent an email with
attached pr116504-elf.tar.xz to your at gcc dot gnu.org address (in case it
does not get through due to antivirus / antispam)

[Bug target/116504] wrong code with -mcpu=sifive-x280

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

--- Comment #6 from Zdenek Sojka  ---
Created attachment 59043
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=59043&action=edit
assembly output for the second testcase

[Bug target/116504] wrong code with -mcpu=sifive-x280

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

--- Comment #5 from Zdenek Sojka  ---
Created attachment 59042
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=59042&action=edit
assembly output for the first testcase

[Bug middle-end/116555] New: [15 Regression] ifcvt: ICE: verify_gimple failed: mismatching comparison operand types with -O2 -fno-tree-forwprop

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

Bug ID: 116555
   Summary: [15 Regression] ifcvt: ICE: verify_gimple failed:
mismatching comparison operand types with -O2
-fno-tree-forwprop
   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 59033
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=59033&action=edit
auto-reduced testcase

Compiler output:
$ x86_64-pc-linux-gnu-gcc -O2 -fno-tree-forwprop testcase.C 
testcase.C: In function 'void InputLoop()':
testcase.C:16:6: error: mismatching comparison operand types
   16 | void InputLoop() {
  |  ^
int
WindowClass
_15 = window_class.1_10 == 2;
testcase.C:16:6: error: mismatching comparison operand types
int
WindowClass
_16 = window_class.1_10 == 0;
during GIMPLE pass: ifcvt
testcase.C:16:6: internal compiler error: verify_gimple failed
0x2ee2c2e internal_error(char const*, ...)
/repo/gcc-trunk/gcc/diagnostic-global-context.cc:492
0x18fa13d verify_gimple_in_cfg(function*, bool, bool)
/repo/gcc-trunk/gcc/tree-cfg.cc:5681
0x176ad84 execute_function_todo
/repo/gcc-trunk/gcc/passes.cc:2089
0x176b2de 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/bin/x86_64-pc-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-r15-3345-20240831234259-g592a335de56-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-3345-20240831234259-g592a335de56-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 15.0.0 20240901 (experimental) (GCC)

[Bug lto/116526] New: [12/13/14/15 Regression] ICE: in get_partitioning_class, at symtab.cc:2190 with -O -fopenacc -fprofile-generate -flto

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

Bug ID: 116526
   Summary: [12/13/14/15 Regression] ICE: in
get_partitioning_class, at symtab.cc:2190 with -O
-fopenacc -fprofile-generate -flto
   Product: gcc
   Version: 15.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 59023
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=59023&action=edit
reduced testcase

Compiler output:
$ x86_64-pc-linux-gnu-gcc -O -fopenacc -fprofile-generate -flto testcase.c 
during IPA pass: modref
testcase.c:23:1: internal compiler error: in get_partitioning_class, at
symtab.cc:2190
   23 | }
  | ^
0x2cdcc3e internal_error(char const*, ...)
/repo/gcc-trunk/gcc/diagnostic-global-context.cc:492
0xe6c76f fancy_abort(char const*, int, char const*)
/repo/gcc-trunk/gcc/diagnostic.cc:1658
0x7565b9 symtab_node::get_partitioning_class()
/repo/gcc-trunk/gcc/symtab.cc:2190
0x13ea663 lto_output_varpool_node
/repo/gcc-trunk/gcc/lto-cgraph.cc:632
0x13ea663 output_symtab()
/repo/gcc-trunk/gcc/lto-cgraph.cc:1000
0x14006a2 lto_output()
/repo/gcc-trunk/gcc/lto-streamer-out.cc:2830
0x1499b39 write_lto
/repo/gcc-trunk/gcc/passes.cc:2780
0x1499b39 ipa_write_summaries_1
/repo/gcc-trunk/gcc/passes.cc:2844
0x1499b39 ipa_write_summaries()
/repo/gcc-trunk/gcc/passes.cc:2900
0x1070421 ipa_passes
/repo/gcc-trunk/gcc/cgraphunit.cc:2262
0x1070421 symbol_table::compile()
/repo/gcc-trunk/gcc/cgraphunit.cc:2337
0x10732b7 symbol_table::compile()
/repo/gcc-trunk/gcc/cgraphunit.cc:2315
0x10732b7 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/bin/x86_64-pc-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-r15-3242-20240828091318-g3cde331e959-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-3242-20240828091318-g3cde331e959-checking-yes-rtl-df-extra-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 15.0.0 20240828 (experimental) (GCC)

[Bug target/116504] wrong code with -mcpu=sifive-x280

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

--- Comment #3 from Zdenek Sojka  ---
(In reply to Richard Biener from comment #2)
> when using qemu please always specify the version used

Thank you for the feedback:
$ qemu-riscv64 --version
qemu-riscv64 version 9.0.2
Copyright (c) 2003-2024 Fabrice Bellard and the QEMU Project developers

I am not familiar with riscv vector extensions enough to tell if the code is OK
based on the assembly output.

[Bug target/116505] New: ICE: in gen_reg_rtx, at emit-rtl.cc:1177 with -O -fprofile-arcs -fprofile-values -flate-combine-instructions on powerpc64le with basic code

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

Bug ID: 116505
   Summary: ICE: in gen_reg_rtx, at emit-rtl.cc:1177 with -O
-fprofile-arcs -fprofile-values
-flate-combine-instructions on powerpc64le with basic
code
   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: powerpc64le-unknown-linux-gnu

Output:
$ cat testcase.c 
void foo() {}
$ powerpc64le-unknown-linux-gnu-gcc -O -fprofile-arcs -fprofile-values
-flate-combine-instructions testcase.c 
during RTL pass: split2
testcase.c: In function 'foo':
testcase.c:1:13: internal compiler error: in gen_reg_rtx, at emit-rtl.cc:1177
1 | void foo() {}
  | ^
0x1fd5e2e internal_error(char const*, ...)
/repo/gcc-trunk/gcc/diagnostic-global-context.cc:491
0x9dffc5 fancy_abort(char const*, int, char const*)
/repo/gcc-trunk/gcc/diagnostic.cc:1772
0x6ba3fa gen_reg_rtx(machine_mode)
/repo/gcc-trunk/gcc/emit-rtl.cc:1177
0x1b83879 gen_split_394(rtx_insn*, rtx_def**)
/repo/gcc-trunk/gcc/config/rs6000/rs6000.md:10773
0x1cc43ea split_17
/repo/gcc-trunk/gcc/config/rs6000/rs6000.md:490
0xc86ddd try_split(rtx_def*, rtx_insn*, int)
/repo/gcc-trunk/gcc/emit-rtl.cc:3941
0x1056558 split_insn
/repo/gcc-trunk/gcc/recog.cc:3475
0x105d625 split_all_insns()
/repo/gcc-trunk/gcc/recog.cc:3579
0x105d748 execute
/repo/gcc-trunk/gcc/recog.cc:4503
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.

$ powerpc64le-unknown-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=/repo/gcc-trunk/binary-latest-powerpc64le/bin/powerpc64le-unknown-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-r15-3187-20240826023505-g53b86cac7e7-checking-yes-rtl-df-extra-powerpc64le/bin/../libexec/gcc/powerpc64le-unknown-linux-gnu/15.0.0/lto-wrapper
Target: powerpc64le-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/powerpc64le-unknown-linux-gnu --build=x86_64-pc-linux-gnu
--host=x86_64-pc-linux-gnu --target=powerpc64le-unknown-linux-gnu
--with-ld=/usr/bin/powerpc64le-unknown-linux-gnu-ld
--with-as=/usr/bin/powerpc64le-unknown-linux-gnu-as --enable-libsanitizer
--disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r15-3187-20240826023505-g53b86cac7e7-checking-yes-rtl-df-extra-powerpc64le
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 15.0.0 20240826 (experimental) (GCC)

[Bug target/116504] wrong code with -mcpu=sifive-x280

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

--- Comment #1 from Zdenek Sojka  ---
Created attachment 59015
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=59015&action=edit
another reduced testcase

[Bug target/116504] New: wrong code with -mcpu=sifive-x280

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

Bug ID: 116504
   Summary: wrong code with -mcpu=sifive-x280
   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: riscv64-unknown-linux-gnu

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

I am using qemu-riscv64 userspace emulation; this might be an issue in the
emulator, or in the way how I am using it, and not in the gcc. I am unable to
tell where the issue is. I am having problems with -mcpu=sifive-x280 often, so
I welcome any feedback on this.

$ riscv64-unknown-linux-gnu-gcc -mcpu=sifive-x280 testcase.c -static
$ qemu-riscv64 -- ./a.out 
Aborted

$ 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-r15-3209-20240827075350-g103127cd939-checking-yes-rtl-df-extra-riscv64/bin/../libexec/gcc/riscv64-unknown-linux-gnu/15.0.0/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-r15-3209-20240827075350-g103127cd939-checking-yes-rtl-df-extra-riscv64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 15.0.0 20240826 (experimental) (GCC)

[Bug middle-end/116503] New: wrong code with -O -fnon-call-exceptions -finstrument-functions -floop-nest-optimize -fno-tree-scev-cprop

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

Bug ID: 116503
   Summary: wrong code with -O -fnon-call-exceptions
-finstrument-functions -floop-nest-optimize
-fno-tree-scev-cprop
   Product: gcc
   Version: 15.0
Status: UNCONFIRMED
  Keywords: wrong-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 59012
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=59012&action=edit
reduced testcase

Output:
$ x86_64-pc-linux-gnu-gcc -O -fnon-call-exceptions -finstrument-functions
-floop-nest-optimize -fno-tree-scev-cprop 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-3223-20240827072848-gee986126807-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-3223-20240827072848-gee986126807-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 15.0.0 20240826 (experimental) (GCC)

[Bug tree-optimization/116501] New: wrong code with __builtin_sub_overflow_p() and _BitInt() at -O1

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

Bug ID: 116501
   Summary: wrong code with __builtin_sub_overflow_p() and
_BitInt() at -O1
   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 59011
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=59011&action=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


$ 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-3187-20240826023505-g53b86cac7e7-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-3187-20240826023505-g53b86cac7e7-checking-yes-rtl-df-extra-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 15.0.0 20240826 (experimental) (GCC)

[Bug middle-end/116486] New: [15 Regression] wrong code with __builtin_stdc_first_leading_one() at -O2 -fno-tree-ccp

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

Bug ID: 116486
   Summary: [15 Regression] wrong code with
__builtin_stdc_first_leading_one() at -O2
-fno-tree-ccp
   Product: gcc
   Version: 15.0
Status: UNCONFIRMED
  Keywords: wrong-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 59002
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=59002&action=edit
reduced testcase

This happens even after the PR116480 fix.

Output:
$ x86_64-pc-linux-gnu-gcc -O2 -fno-tree-ccp 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-3187-20240826023505-g53b86cac7e7-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-3187-20240826023505-g53b86cac7e7-checking-yes-rtl-df-extra-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 15.0.0 20240826 (experimental) (GCC)

[Bug rtl-optimization/116480] New: [15 Regression] ICE: in operand_subword_force, at emit-rtl.cc:1824 at -O2 with __builtin_stdc_has_single_bit() and _BitInt() on aarch64

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

Bug ID: 116480
   Summary: [15 Regression] ICE: in operand_subword_force, at
emit-rtl.cc:1824 at -O2 with
__builtin_stdc_has_single_bit() and _BitInt() on
aarch64
   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: aarch64-unknown-linux-gnu

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

Compiler output:
$ aarch64-unknown-linux-gnu-gcc -O2 testcase.c 
during RTL pass: expand
testcase.c: In function 'foo':
testcase.c:4:10: internal compiler error: in operand_subword_force, at
emit-rtl.cc:1824
4 |   return __builtin_stdc_has_single_bit(b);
  |  ^~~~
0x25e580e internal_error(char const*, ...)
/repo/gcc-trunk/gcc/diagnostic-global-context.cc:491
0xc38337 fancy_abort(char const*, int, char const*)
/repo/gcc-trunk/gcc/diagnostic.cc:1772
0x7d8b86 operand_subword_force(rtx_def*, poly_int<2u, unsigned long>,
machine_mode)
/repo/gcc-trunk/gcc/emit-rtl.cc:1824
0x1208289 expand_binop(machine_mode, optab_tag, rtx_def*, rtx_def*, rtx_def*,
int, optab_methods)
/repo/gcc-trunk/gcc/optabs.cc:1750
0xf12335 emit_store_flag_int(rtx_def*, rtx_def*, rtx_code, rtx_def*, rtx_def*,
scalar_int_mode, int, int, rtx_def*)
/repo/gcc-trunk/gcc/expmed.cc:5851
0xf11f0e emit_store_flag(rtx_def*, rtx_code, rtx_def*, rtx_def*, machine_mode,
int, int)
/repo/gcc-trunk/gcc/expmed.cc:6196
0x1066732 expand_POPCOUNT(internal_fn, gcall*)
/repo/gcc-trunk/gcc/internal-fn.cc:5321
0x1066732 expand_POPCOUNT(internal_fn, gcall*)
/repo/gcc-trunk/gcc/internal-fn.cc:5293
0xde58c7 expand_call_stmt
/repo/gcc-trunk/gcc/cfgexpand.cc:2801
0xde58c7 expand_gimple_stmt_1
/repo/gcc-trunk/gcc/cfgexpand.cc:3962
0xde58c7 expand_gimple_stmt
/repo/gcc-trunk/gcc/cfgexpand.cc:4104
0xdebf9e expand_gimple_basic_block
/repo/gcc-trunk/gcc/cfgexpand.cc:6160
0xdeda66 execute
/repo/gcc-trunk/gcc/cfgexpand.cc:6899
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-3158-20240825101449-g91f549537ca-checking-yes-rtl-df-extra-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
--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-3158-20240825101449-g91f549537ca-checking-yes-rtl-df-extra-aarch64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 15.0.0 20240825 (experimental) (GCC)

[Bug rtl-optimization/116479] New: [15 Regression] wrong code with -O -funroll-loops -finline-stringops -fmodulo-sched --param=max-iterations-computation-cost=637924876 on aarch64

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

Bug ID: 116479
   Summary: [15 Regression] wrong code with -O -funroll-loops
-finline-stringops -fmodulo-sched
--param=max-iterations-computation-cost=637924876 on
aarch64
   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: aarch64-unknown-linux-gnu

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

Output:
$ arch64-unknown-linux-gnu-gcc -O -funroll-loops -finline-stringops
-fmodulo-sched --param=max-iterations-computation-cost=637924687 testcase.c
-static
$ qemu-aarch64 -- ./a.out 
qemu: uncaught target signal 11 (Segmentation fault) - core dumped
Segmentation fault

On the asm level:
...
foo:
...
mov x4, 695
mov x1, x3
.L2:
...
sub x4, x4, #8
cbnzx4, .L2
...
ret

x4 wraps over 0 (since 695%8 != 0), and the program crashes with:

x4 0xfffd7c0f  -164849

$ 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-3158-20240825101449-g91f549537ca-checking-yes-rtl-df-extra-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
--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-3158-20240825101449-g91f549537ca-checking-yes-rtl-df-extra-aarch64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 15.0.0 20240825 (experimental) (GCC)

[Bug target/116437] New: [15 Regression] ICE: RTL check: expected code 'reg', have 'subreg' in rhs_regno, at rtl.h:1934 with -O2 -march=emeraldrapids -fno-split-wide-types -m32

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

Bug ID: 116437
   Summary: [15 Regression] ICE: RTL check: expected code 'reg',
have 'subreg' in rhs_regno, at rtl.h:1934 with -O2
-march=emeraldrapids -fno-split-wide-types -m32
   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 58966
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=58966&action=edit
reduced testcase

Compiler output:
$ x86_64-pc-linux-gnu-gcc -O2 -march=emeraldrapids -fno-split-wide-types -m32
testcase.c 
during RTL pass: ext_dce
testcase.c: In function 'foo':
testcase.c:16:1: internal compiler error: RTL check: expected code 'reg', have
'subreg' in rhs_regno, at rtl.h:1934
   16 | }
  | ^
0x2b5bf5e internal_error(char const*, ...)
/repo/gcc-trunk/gcc/diagnostic-global-context.cc:491
0x821738 rtl_check_failed_code1(rtx_def const*, rtx_code, char const*, int,
char const*)
/repo/gcc-trunk/gcc/rtl.cc:770
0xe051c6 rhs_regno(rtx_def const*)
/repo/gcc-trunk/gcc/rtl.h:1934
0xe054de rhs_regno(rtx_def const*)
/repo/gcc-trunk/gcc/ext-dce.cc:405
0xe054de ext_dce_try_optimize_insn
/repo/gcc-trunk/gcc/ext-dce.cc:426
0xe054de ext_dce_process_uses
/repo/gcc-trunk/gcc/ext-dce.cc:679
0x28cce0f ext_dce_process_bb
/repo/gcc-trunk/gcc/ext-dce.cc:887
0x28cce0f ext_dce_rd_transfer_n
/repo/gcc-trunk/gcc/ext-dce.cc:1029
0x106bf8b df_worklist_propagate_backward
/repo/gcc-trunk/gcc/df-core.cc:970
0x106bf8b df_worklist_dataflow_doublequeue
/repo/gcc-trunk/gcc/df-core.cc:1054
0x106bf8b df_worklist_dataflow(dataflow*, bitmap_head*, int*, int)
/repo/gcc-trunk/gcc/df-core.cc:1132
0x28cd2f7 ext_dce_execute()
/repo/gcc-trunk/gcc/ext-dce.cc:1058
0x28cd658 execute
/repo/gcc-trunk/gcc/ext-dce.cc:1098
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-3013-20240819104043-g8d6c6fbc527-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-3013-20240819104043-g8d6c6fbc527-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 15.0.0 20240819 (experimental) (GCC)

[Bug rtl-optimization/116436] New: ICE: in cfg_layout_redirect_edge_and_branch_force, at cfgrtl.cc:4748 with -O2 -fmodulo-sched -fprofile-arcs -fgraphite-identity -fvpt -freorder-blocks-and-partition

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

Bug ID: 116436
   Summary: ICE: in cfg_layout_redirect_edge_and_branch_force, at
cfgrtl.cc:4748 with -O2 -fmodulo-sched -fprofile-arcs
-fgraphite-identity -fvpt
-freorder-blocks-and-partition
   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: aarch64-unknown-linux-gnu

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

Compiler output:
$ aarch64-unknown-linux-gnu-gcc -O2 -fmodulo-sched -fprofile-arcs
-fgraphite-identity -fvpt -freorder-blocks-and-partition testcase.c
during RTL pass: sms
testcase.c: In function 'foo0':
testcase.c:12:1: internal compiler error: in
cfg_layout_redirect_edge_and_branch_force, at cfgrtl.cc:4748
   12 | }
  | ^
0x25b932e internal_error(char const*, ...)
/repo/gcc-trunk/gcc/diagnostic-global-context.cc:491
0xc3809f fancy_abort(char const*, int, char const*)
/repo/gcc-trunk/gcc/diagnostic.cc:1772
0x7b6802 cfg_layout_redirect_edge_and_branch_force
/repo/gcc-trunk/gcc/cfgrtl.cc:4748
0x7b6802 cfg_layout_redirect_edge_and_branch_force
/repo/gcc-trunk/gcc/cfgrtl.cc:4744
0xdf1663 redirect_edge_and_branch_force(edge_def*, basic_block_def*)
/repo/gcc-trunk/gcc/cfghooks.cc:508
0xe0572c cfg_layout_split_edge
/repo/gcc-trunk/gcc/cfgrtl.cc:5008
0xdf199f split_edge(edge_def*)
/repo/gcc-trunk/gcc/cfghooks.cc:670
0x11629e2 split_edge_and_insert(edge_def*, rtx_insn*)
/repo/gcc-trunk/gcc/loop-unroll.cc:753
0x245cb52 generate_prolog_epilog
/repo/gcc-trunk/gcc/modulo-sched.cc:1169
0x245fc86 sms_schedule
/repo/gcc-trunk/gcc/modulo-sched.cc:1760
0x24606ff execute
/repo/gcc-trunk/gcc/modulo-sched.cc:3359
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-2981-20240818001013-g3ae8794665e-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-2981-20240818001013-g3ae8794665e-checking-yes-rtl-df-extra-nobootstrap-aarch64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 15.0.0 20240818 (experimental) (GCC)

[Bug middle-end/116408] New: wrong code due to missing sign extension of _BitInt() at -O0 / -O1

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

Bug ID: 116408
   Summary: wrong code due to missing sign extension of _BitInt()
at -O0 / -O1
   Product: gcc
   Version: 15.0
Status: UNCONFIRMED
  Keywords: wrong-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 58949
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=58949&action=edit
reduced testcase

Output:
$ x86_64-pc-linux-gnu-gcc testcase.c -O0
$ ./a.out 
Aborted # here, only 'y' is incorrect

$ x86_64-pc-linux-gnu-gcc testcase.c -O1
$ ./a.out 
Aborted # both x and y are incorrect

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

$ x86_64-pc-linux-gnu-gcc testcase.c -Wall -W -O2 -fno-strict-overflow
-fno-strict-aliasing
$ ./a.out 
# OK


$ 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-2981-20240818001013-g3ae8794665e-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-2981-20240818001013-g3ae8794665e-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 15.0.0 20240818 (experimental) (GCC)

[Bug tree-optimization/116406] New: [15 Regression] ICE: in add_to_value, at tree-ssa-pre.cc:695 with -Os -finstrument-functions-once -mfpmath=387

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

Bug ID: 116406
   Summary: [15 Regression] ICE: in add_to_value, at
tree-ssa-pre.cc:695 with -Os
-finstrument-functions-once -mfpmath=387
   Product: gcc
   Version: 15.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 58947
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=58947&action=edit
reduced testcase

Compiler output:
$ x86_64-pc-linux-gnu-gcc -Os -finstrument-functions-once -mfpmath=387
testcase.c
during GIMPLE pass: pre
testcase.c: In function 'foo':
testcase.c:8:1: internal compiler error: in add_to_value, at
tree-ssa-pre.cc:695
8 | foo (int c, U u)
  | ^~~
0x2b4e30e internal_error(char const*, ...)
/repo/gcc-trunk/gcc/diagnostic-global-context.cc:491
0xe51fd1 fancy_abort(char const*, int, char const*)
/repo/gcc-trunk/gcc/diagnostic.cc:1772
0x888c6b add_to_value
/repo/gcc-trunk/gcc/tree-ssa-pre.cc:695
0x1773a3a phi_translate_1
/repo/gcc-trunk/gcc/tree-ssa-pre.cc:1676
0x17744c9 phi_translate
/repo/gcc-trunk/gcc/tree-ssa-pre.cc:1743
0x17746ef phi_translate_set
/repo/gcc-trunk/gcc/tree-ssa-pre.cc:1788
0x1777b65 compute_antic_aux
/repo/gcc-trunk/gcc/tree-ssa-pre.cc:2137
0x1777b65 compute_antic
/repo/gcc-trunk/gcc/tree-ssa-pre.cc:2492
0x1777b65 execute
/repo/gcc-trunk/gcc/tree-ssa-pre.cc:4502
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-2962-20240817120017-ga11dcaff9fc-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-2962-20240817120017-ga11dcaff9fc-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 15.0.0 20240817 (experimental) (GCC)

[Bug target/116287] New: __builtin_ia32_bzhi_si() ignores side effects of its arguments

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

Bug ID: 116287
   Summary: __builtin_ia32_bzhi_si() ignores side effects of its
arguments
   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 58867
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=58867&action=edit
reduced testcase

Output:
$ x86_64-pc-linux-gnu-gcc -mbmi2 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-2753-20240806115235-gdf4062c54b0-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-2753-20240806115235-gdf4062c54b0-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 15.0.0 20240806 (experimental) (GCC)

[Bug tree-optimization/116224] wrong code with _BitInt() division at -O1 and above (breaks in ccp2?)

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

--- Comment #2 from Zdenek Sojka  ---
(In reply to Jakub Jelinek from comment #1)
> This needs to be
> signed char g;
> 
> int
> foo (signed char c, int i, _BitInt(65) b)
> {
>   __builtin_memmove (&g, &b, 1);
>   return b / i / c;
> }
> 
> int
> main ()
> {
>   int x = foo (-15, -15, 900);
>   if (x != 4)
> __builtin_abort ();
> }
> 
> because you are relying on the char being signed.

Thank you for reminding me of this; with the original testcase:
$ aarch64-unknown-linux-gnu-gcc testcase.c -static -O0 -fsigned-char && ./a.out 
$ aarch64-unknown-linux-gnu-gcc testcase.c -static -O0 -funsigned-char &&
./a.out 
qemu: uncaught target signal 6 (Aborted) - core dumped
Aborted
$ aarch64-unknown-linux-gnu-gcc testcase.c -static -O1 -fsigned-char && ./a.out 
qemu: uncaught target signal 6 (Aborted) - core dumped
Aborted
$ aarch64-unknown-linux-gnu-gcc testcase.c -static -O1 -funsigned-char &&
./a.out 
qemu: uncaught target signal 6 (Aborted) - core dumped
Aborted

it fails with -fsigned-char as well (and of course with your fixed testcase).

But I might have missed something again.

[Bug target/116229] New: wrong code at -Ofast aarch64 due to missing fneg to generate 0x8000000000000000

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

Bug ID: 116229
   Summary: wrong code at -Ofast aarch64 due to missing fneg to
generate 0x8000
   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: aarch64-unknown-linux-gnu

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

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

Diff from -O3 to -Ofast shows the 0x8000 constant is not generated
(as -0.0):

$ diff -u a-testcase.s-O3 a-testcase.s-Ofast 
--- a-testcase.s-O3 2024-08-04 20:07:06.417271286 +0200
+++ a-testcase.s-Ofast  2024-08-04 20:07:11.877241325 +0200
@@ -24,7 +24,7 @@
 main:
 .LFB1:
.cfi_startproc
-   moviv0.4s, 0
+   moviv0.2d, 0
stp x29, x30, [sp, -48]!
.cfi_def_cfa_offset 48
.cfi_offset 29, -48
@@ -35,7 +35,6 @@
.cfi_offset 20, -24
adrpx20, .LC0
add x19, sp, 40
-   fnegv0.2d, v0.2d
add x20, x20, :lo12:.LC0
bl  foo
str d0, [sp, 40]

$ 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-2709-20240804001730-g7cd71c88637-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-2709-20240804001730-g7cd71c88637-checking-yes-rtl-df-extra-nobootstrap-aarch64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 15.0.0 20240804 (experimental) (GCC)

[Bug tree-optimization/116224] New: wrong code with _BitInt() division at -O1 and above (breaks in ccp2?)

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

Bug ID: 116224
   Summary: wrong code with _BitInt() division at -O1 and above
(breaks in ccp2?)
   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 58819
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=58819&action=edit
reduced testcase

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

The .ccp2 dump shows:
...
Folded into: _8 = b.0_6 / -15;

Folding statement: _9 = -15;
Queued stmt for removal.  Folds to: -15
Folding statement: _10 = _8 / _9;
Queued stmt for removal.  Folds to: 0
...

$ 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-2706-20240803001855-gdb9834aead7-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-2706-20240803001855-gdb9834aead7-checking-yes-rtl-df-extra-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 15.0.0 20240803 (experimental) (GCC)

[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&action=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&action=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-23 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&action=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-23 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&action=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&action=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&action=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&action=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&action=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&action=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&action=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(&i, 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&action=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&action=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&action=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&action=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&action=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&action=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&action=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&action=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&action=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&action=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&action=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&action=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&action=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&action=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&action=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&action=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&action=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&action=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&action=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&action=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&action=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&action=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&action=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&action=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&action=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(&d, &s - 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&action=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&action=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&action=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&action=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&action=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&action=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&action=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&action=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&action=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&action=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&action=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&action=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-13 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&action=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&action=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&action=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&action=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&action=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-l

[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&action=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/cgra

[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&action=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 (&b, 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&action=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&action=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(&b, 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&action=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

[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&action=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&action=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 *) &b
# .MEM_3 = VDEF <.MEM_2(D)>
__builtin_memcpy (&MEM  [(void *)&a + 1B], (char *) &b, 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&action=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&action=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)

  1   2   3   4   5   6   7   8   9   10   >