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

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

Bug ID: 114799
   Summary: [14 Regression] ICE: tree check: expected class
'type', have 'exceptional' (error_mark) in
useless_type_conversion_p, at gimple-expr.cc:85 with
-O2 -fno-tree-forwprop -fvect-cost-model=unlimited
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu

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

Compiler output:
$ x86_64-pc-linux-gnu-gcc -O2 -fno-tree-forwprop -fvect-cost-model=unlimited
testcase.c -Wno-psabi
during GIMPLE pass: slp
testcase.c: In function 'foo':
testcase.c:17:1: internal compiler error: tree check: expected class 'type',
have 'exceptional' (error_mark) in useless_type_conversion_p, at
gimple-expr.cc:85
   17 | foo (void)
  | ^~~
0x894e6f tree_class_check_failed(tree_node const*, tree_code_class, char
const*, int, char const*)
/repo/gcc-trunk/gcc/tree.cc:9006
0x77ef52 tree_class_check(tree_node*, tree_code_class, char const*, int, char
const*)
/repo/gcc-trunk/gcc/tree.h:3779
0x77ef52 useless_type_conversion_p(tree_node*, tree_node*)
/repo/gcc-trunk/gcc/gimple-expr.cc:85
0x155c516 verify_gimple_assign_single
/repo/gcc-trunk/gcc/tree-cfg.cc:4791
0x155c516 verify_gimple_assign
/repo/gcc-trunk/gcc/tree-cfg.cc:4843
0x155c516 verify_gimple_stmt
/repo/gcc-trunk/gcc/tree-cfg.cc:5108
0x155fd01 verify_gimple_in_cfg(function*, bool, bool)
/repo/gcc-trunk/gcc/tree-cfg.cc:5603
0x13ced14 execute_function_todo
/repo/gcc-trunk/gcc/passes.cc:2089
0x13cf26e execute_todo
/repo/gcc-trunk/gcc/passes.cc:2143
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

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

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

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

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

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

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

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

No warranty for code correctness.

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

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

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

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

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

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


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

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

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

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

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

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

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

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

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

Bug ID: 114696
   Summary: ICE: in extract_constrain_insn_cached, at
recog.cc:2725 insn does not satisfy its constraints:
{*anddi_1} with -mapxf -mx32
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu

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

Compiler output:
$ x86_64-pc-linux-gnu-gcc -mapxf -mx32 testcase.c 
testcase.c: In function 'foo':
testcase.c:8:1: error: insn does not satisfy its constraints:
8 | }
  | ^
(insn 43 42 44 2 (parallel [
(set (reg:DI 1 dx [+8 ])
(and:DI (mem/c:DI (plus:SI (reg:SI 4 si [110])
(const_int 8 [0x8])) [1 a+8 S8 A64 AS1])
(const_int 1 [0x1])))
(clobber (reg:CC 17 flags))
]) "testcase.c":7:7 613 {*anddi_1}
 (nil))
during RTL pass: shorten
testcase.c:8:1: internal compiler error: in extract_constrain_insn_cached, at
recog.cc:2725
0x808789 _fatal_insn(char const*, rtx_def const*, char const*, int, char
const*)
/repo/gcc-trunk/gcc/rtl-error.cc:108
0x808810 _fatal_insn_not_found(rtx_def const*, char const*, int, char const*)
/repo/gcc-trunk/gcc/rtl-error.cc:118
0x7f8fbf extract_constrain_insn_cached(rtx_insn*)
/repo/gcc-trunk/gcc/recog.cc:2725
0x1dce737 get_attr_modrm(rtx_insn*)
/repo/gcc-trunk/gcc/config/i386/i386.md:759
0x1dd2bb7 insn_default_length(rtx_insn*)
/repo/gcc-trunk/gcc/config/i386/i386.md:785
0x10e00ee shorten_branches(rtx_insn*)
/repo/gcc-trunk/gcc/final.cc:1089
0x10e022f rest_of_handle_shorten_branches
/repo/gcc-trunk/gcc/final.cc:4335
0x10e022f execute
/repo/gcc-trunk/gcc/final.cc:4364
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.


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

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

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

Bug ID: 114681
   Summary: ICE: in as_a, at is-a.h:255 with -O
-fnon-call-exceptions -fno-exceptions
-fcondition-coverage
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: ipa
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu

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

Compiler output:
$ x86_64-pc-linux-gnu-gcc -O -fnon-call-exceptions -fno-exceptions
-fcondition-coverage testcase.c
during IPA pass: inline
testcase.c: In function 'foo':
testcase.c:14:3: internal compiler error: in as_a, at is-a.h:255
   14 |   bar ();
  |   ^~
0x83b2a0 geh_filter const* as_a(gimple const*)
/repo/gcc-trunk/gcc/is-a.h:255
0x83ee63 gcond* as_a(gimple*)
/repo/gcc-trunk/gcc/hash-set.h:64
0x83ee63 copy_bb
/repo/gcc-trunk/gcc/tree-inline.cc:2096
0x15a31aa copy_cfg_body
/repo/gcc-trunk/gcc/tree-inline.cc:3087
0x15a31aa copy_body
/repo/gcc-trunk/gcc/tree-inline.cc:3340
0x15a810e expand_call_inline
/repo/gcc-trunk/gcc/tree-inline.cc:5143
0x15a9a49 gimple_expand_calls_inline
/repo/gcc-trunk/gcc/tree-inline.cc:5343
0x15a9a49 optimize_inline_calls(tree_node*)
/repo/gcc-trunk/gcc/tree-inline.cc:5515
0x12426bb inline_transform(cgraph_node*)
/repo/gcc-trunk/gcc/ipa-inline-transform.cc:792
0x13d14f6 execute_one_ipa_transform_pass
/repo/gcc-trunk/gcc/passes.cc:2334
0x13d14f6 execute_all_ipa_transforms(bool)
/repo/gcc-trunk/gcc/passes.cc:2397
0xfcea7d cgraph_node::expand()
/repo/gcc-trunk/gcc/cgraphunit.cc:1838
0xfcea7d cgraph_node::expand()
/repo/gcc-trunk/gcc/cgraphunit.cc:1798
0xfcfdfa expand_all_functions
/repo/gcc-trunk/gcc/cgraphunit.cc:2028
0xfcfdfa symbol_table::compile()
/repo/gcc-trunk/gcc/cgraphunit.cc:2404
0xfd2977 symbol_table::compile()
/repo/gcc-trunk/gcc/cgraphunit.cc:2315
0xfd2977 symbol_table::finalize_compilation_unit()
/repo/gcc-trunk/gcc/cgraphunit.cc:2589
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

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

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

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

Bug ID: 114672
   Summary: during GIMPLE pass: widening_mul ICE: verify_gimple
failed: type mismatch in 'widen_mult_plus_expr' at -O2
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: aarch64-unknown-linux-gnu

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

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

signed int
signed int

_8 = WIDEN_MULT_PLUS_EXPR <_11, _12, _1>;
during GIMPLE pass: widening_mul
testcase.c:9:1: internal compiler error: verify_gimple failed
0x1396f9d verify_gimple_in_cfg(function*, bool, bool)
/repo/gcc-trunk/gcc/tree-cfg.cc:5663
0x1202df4 execute_function_todo
/repo/gcc-trunk/gcc/passes.cc:2089
0x120334e execute_todo
/repo/gcc-trunk/gcc/passes.cc:2143
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

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

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

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

Bug ID: 114644
   Summary: wrong -Wrestrict on snprintf() of distinct struct
array members
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: diagnostic
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu

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

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


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

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

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

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

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

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

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

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

Compiler output:
$ x86_64-pc-linux-gnu-gcc -O -fpie testcase.c
testcase.c: In function 'foo':
testcase.c:8:1: error: unrecognizable insn:
8 | }
  | ^
(insn 6 5 7 2 (set (reg:DI 106)
(const:DI (plus:DI (unspec:DI [
(symbol_ref:DI ("b") [flags 0x2a] )
] UNSPEC_NTPOFF)
(const_int 34359738367 [0x7] "testcase.c":7:10 -1
 (nil))
during RTL pass: vregs
testcase.c:8:1: internal compiler error: in extract_insn, at recog.cc:2812
0x80873f _fatal_insn(char const*, rtx_def const*, char const*, int, char
const*)
/repo/gcc-trunk/gcc/rtl-error.cc:108
0x8087bc _fatal_insn_not_found(rtx_def const*, char const*, int, char const*)
/repo/gcc-trunk/gcc/rtl-error.cc:116
0x7f762b extract_insn(rtx_insn*)
/repo/gcc-trunk/gcc/recog.cc:2812
0x11329cd instantiate_virtual_regs_in_insn
/repo/gcc-trunk/gcc/function.cc:1612
0x11329cd instantiate_virtual_regs
/repo/gcc-trunk/gcc/function.cc:1995
0x11329cd execute
/repo/gcc-trunk/gcc/function.cc:2042
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

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

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

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

Bug ID: 114601
   Summary: ICE: SIGSEGV in hash_table_mod1 (hash-table.h:344)
with -fcondition-coverage -finstrument-functions-once
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: gcov-profile
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu

This happens also after the PR114599 fix.

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

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

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

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

Bug ID: 114599
   Summary: ICE: SIGSEGV in bitmap_set_bit(bitmap_head*, int)
(bitmap.cc:975) with -O2 -fcondition-coverage
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: ipa
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu

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

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

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

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

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

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

Compiler output:
$ x86_64-pc-linux-gnu-gcc -O -fno-tree-forwprop testcase2.c 
testcase2.c: In function 'foo':
testcase2.c:9:1: error: definition in block 14 does not dominate use in block
15
9 | foo(void)
  | ^~~
for SSA_NAME: _17 in statement:
_16 = PHI <_15(2), _17(15)>
PHI argument
_17
for PHI node
_16 = PHI <_15(2), _17(15)>
during GIMPLE pass: bitintlower
testcase2.c:9:1: internal compiler error: verify_ssa failed
0x177b02f verify_ssa(bool, bool)
/repo/gcc-trunk/gcc/tree-ssa.cc:1203
0x13cc2c5 execute_function_todo
/repo/gcc-trunk/gcc/passes.cc:2095
0x13cc72e execute_todo
/repo/gcc-trunk/gcc/passes.cc:2142
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See  for instructions.

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

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

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

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

Compiler output:
$ x86_64-pc-linux-gnu-gcc -O testcase.c 
testcase.c: In function 'foo':
testcase.c:10:1: error: definition in block 14 does not dominate use in block
15
   10 | foo (void)
  | ^~~
for SSA_NAME: _15 in statement:
_14 = PHI <_13(2), _15(15)>
PHI argument
_15
for PHI node
_14 = PHI <_13(2), _15(15)>
during GIMPLE pass: bitintlower
testcase.c:10:1: internal compiler error: verify_ssa failed
0x17913a0 verify_ssa(bool, bool)
/repo/gcc-trunk/gcc/tree-ssa.cc:1203
0x13d19e5 execute_function_todo
/repo/gcc-trunk/gcc/passes.cc:2095
0x13d1e4e execute_todo
/repo/gcc-trunk/gcc/passes.cc:2142
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

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

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

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

Bug ID: 114473
   Summary: [13/14 Regression] ICE: in deref_rvalue, at
analyzer/region-model.cc:2780 with -fanalyzer
-fanalyzer-call-summaries
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: analyzer
  Assignee: dmalcolm at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu

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

Compiler output:
$ x86_64-pc-linux-gnu-gcc -fanalyzer -fanalyzer-call-summaries testcase.c 
during IPA pass: analyzer
testcase.c: In function 'foo':
testcase.c:26:3: internal compiler error: in deref_rvalue, at
analyzer/region-model.cc:2780
   26 |   bar (q);
  |   ^~~
0x8c5153 ana::region_model::deref_rvalue(ana::svalue const*, tree_node*,
ana::region_model_context*, bool) const
/repo/gcc-trunk/gcc/analyzer/region-model.cc:2780
0x28c742a ana::call_summary_replay::convert_region_from_summary(ana::region
const*)
/repo/gcc-trunk/gcc/analyzer/call-summary.cc:553
0x19c44ca ana::store::replay_call_summary_cluster(ana::call_summary_replay&,
ana::store const&, ana::region const*)
/repo/gcc-trunk/gcc/analyzer/store.cc:3338
0x19c4734 ana::store::replay_call_summary(ana::call_summary_replay&, ana::store
const&)
/repo/gcc-trunk/gcc/analyzer/store.cc:3318
0x197463b ana::region_model::replay_call_summary(ana::call_summary_replay&,
ana::region_model const&)
/repo/gcc-trunk/gcc/analyzer/region-model.cc:5635
0x19552db ana::program_state::replay_call_summary(ana::call_summary_replay&,
ana::program_state const&)
/repo/gcc-trunk/gcc/analyzer/program-state.cc:1635
0x193b6f3 ana::call_summary_edge_info::update_state(ana::program_state*,
ana::exploded_edge const*, ana::region_model_context*) const
/repo/gcc-trunk/gcc/analyzer/engine.cc:1633
0x193397a ana::exploded_graph::process_node(ana::exploded_node*)
/repo/gcc-trunk/gcc/analyzer/engine.cc:4241
0x193442a ana::exploded_graph::process_worklist()
/repo/gcc-trunk/gcc/analyzer/engine.cc:3516
0x1936b9b ana::impl_run_checkers(ana::logger*)
/repo/gcc-trunk/gcc/analyzer/engine.cc:6210
0x1937b66 ana::run_checkers()
/repo/gcc-trunk/gcc/analyzer/engine.cc:6308
0x1926458 execute
/repo/gcc-trunk/gcc/analyzer/analyzer-pass.cc:87
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

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

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

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

Bug ID: 114472
   Summary: [14 Regression] ICE: in falls_short_of_p, at
analyzer/store.cc:365 (in exceeds_p, at
analyzer/store.cc:342) with -fanalyzer
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: analyzer
  Assignee: dmalcolm at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu

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

Compiler output:
$ x86_64-pc-linux-gnu-gcc -fanalyzer testcase.c 
during IPA pass: analyzer
testcase.c: In function 'bar':
testcase.c:13:3: internal compiler error: in falls_short_of_p, at
analyzer/store.cc:365
   13 |   __builtin_strncpy(,  - 3, -1);
  |   ^
0x8ca06b
ana::bit_range::falls_short_of_p(generic_wide_int
>, ana::bit_range*) const
/repo/gcc-trunk/gcc/analyzer/store.cc:365
0x28c0d6e ana::region_model::check_region_bounds(ana::region const*,
ana::access_direction, ana::svalue const*, ana::region_model_context*) const
/repo/gcc-trunk/gcc/analyzer/bounds-checking.cc:1438
0x19622b9 ana::region_model::check_region_access(ana::region const*,
ana::access_direction, ana::svalue const*, ana::region_model_context*) const
/repo/gcc-trunk/gcc/analyzer/region-model.cc:3095
0x19622b9 ana::region_model::check_region_access(ana::region const*,
ana::access_direction, ana::svalue const*, ana::region_model_context*) const
/repo/gcc-trunk/gcc/analyzer/region-model.cc:3084
0x19622b9 ana::region_model::check_region_for_read(ana::region const*,
ana::region_model_context*) const
/repo/gcc-trunk/gcc/analyzer/region-model.cc:3129
0x19622b9 ana::region_model::check_region_for_read(ana::region const*,
ana::region_model_context*) const
/repo/gcc-trunk/gcc/analyzer/region-model.cc:3126
0x19622b9 ana::region_model::get_store_value(ana::region const*,
ana::region_model_context*) const
/repo/gcc-trunk/gcc/analyzer/region-model.cc:2690
0x19688d2 ana::region_model::get_store_value(ana::region const*,
ana::region_model_context*) const
/repo/gcc-trunk/gcc/analyzer/region-model.cc:2686
0x19688d2 ana::region_model::read_bytes(ana::region const*, tree_node*,
ana::svalue const*, ana::region_model_context*) const
/repo/gcc-trunk/gcc/analyzer/region-model.cc:4462
0x19688d2 ana::region_model::read_bytes(ana::region const*, tree_node*,
ana::svalue const*, ana::region_model_context*) const
/repo/gcc-trunk/gcc/analyzer/region-model.cc:4453
0x1945a2a update_model
/repo/gcc-trunk/gcc/analyzer/kf.cc:1609
0x193397a ana::exploded_graph::process_node(ana::exploded_node*)
/repo/gcc-trunk/gcc/analyzer/engine.cc:4241
0x193442a ana::exploded_graph::process_worklist()
/repo/gcc-trunk/gcc/analyzer/engine.cc:3516
0x1936b9b ana::impl_run_checkers(ana::logger*)
/repo/gcc-trunk/gcc/analyzer/engine.cc:6210
0x1937b66 ana::run_checkers()
/repo/gcc-trunk/gcc/analyzer/engine.cc:6308
0x1926458 execute
/repo/gcc-trunk/gcc/analyzer/analyzer-pass.cc:87
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

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

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

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

Bug ID: 114442
   Summary: ICE: in riscv_sched_variable_issue, at
config/riscv/riscv.cc:8421 with -O2
-mtune=xiangshan-nanhu
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: riscv64-unknown-linux-gnu

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

Compiler output:
$ riscv64-unknown-linux-gnu-gcc -O2 -mtune=xiangshan-nanhu testcase.c 
during RTL pass: sched2
testcase.c: In function 'foo':
testcase.c:1:18: internal compiler error: in riscv_sched_variable_issue, at
config/riscv/riscv.cc:8421
1 | void foo (void) {}
  |  ^
0xb84f66 riscv_sched_variable_issue
/repo/gcc-trunk/gcc/config/riscv/riscv.cc:8421
0xb84f66 riscv_sched_variable_issue
/repo/gcc-trunk/gcc/config/riscv/riscv.cc:8401
0x2a4205e schedule_block(basic_block_def**, void*)
/repo/gcc-trunk/gcc/haifa-sched.cc:6912
0x16b4f74 schedule_region
/repo/gcc-trunk/gcc/sched-rgn.cc:3203
0x16b4f74 schedule_insns()
/repo/gcc-trunk/gcc/sched-rgn.cc:3525
0x16b540d schedule_insns()
/repo/gcc-trunk/gcc/sched-rgn.cc:3511
0x16b540d rest_of_handle_sched2
/repo/gcc-trunk/gcc/sched-rgn.cc:3749
0x16b540d execute
/repo/gcc-trunk/gcc/sched-rgn.cc:3888
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

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

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

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

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

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

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

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

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

Similar to PR114365

Compiler output:
$ x86_64-pc-linux-gnu-gcc -O testcase.c 
testcase.c: In function 'foo':
testcase.c:7:1: error: definition in block 9 does not dominate use in block 8
7 | foo()
  | ^~~
for SSA_NAME: _12 in statement:
_38 = _12 >> 31;
during GIMPLE pass: bitintlower
testcase.c:7:1: internal compiler error: verify_ssa failed
0x177a70f verify_ssa(bool, bool)
/repo/gcc-trunk/gcc/tree-ssa.cc:1203
0x13cbd45 execute_function_todo
/repo/gcc-trunk/gcc/passes.cc:2095
0x13cc1ae execute_todo
/repo/gcc-trunk/gcc/passes.cc:2142
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Bug ID: 114415
   Summary: wrong code with -Oz -fno-dce -fno-forward-propagate
-flive-range-shrinkage -fweb
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: wrong-code
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu

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

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


It seems the issue is in:


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

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

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

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


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

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

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

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

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

Compiler output:
$ x86_64-pc-linux-gnu-gcc -O testcase.c 
during GIMPLE pass: dom
testcase.c: In function 'foo':
testcase.c:6:1: internal compiler error: in min_value, at wide-int.cc:344
6 | foo ()
  | ^~~
0x8b5cef wi::min_value(unsigned int, signop)
/repo/gcc-trunk/gcc/wide-int.cc:344
0xe905c0 irange::set_varying(tree_node*)
/repo/gcc-trunk/gcc/value-range.h:1084
0x26a548d ranger_cache::get_global_range(vrange&, tree_node*) const
/repo/gcc-trunk/gcc/gimple-range-cache.cc:1019
0x26a548d ranger_cache::get_global_range(vrange&, tree_node*) const
/repo/gcc-trunk/gcc/gimple-range-cache.cc:1015
0x26a01eb gimple_ranger::range_of_expr(vrange&, tree_node*, gimple*)
/repo/gcc-trunk/gcc/gimple-range.cc:131
0x164a000 cprop_operand
/repo/gcc-trunk/gcc/tree-ssa-dom.cc:2038
0x164c402 cprop_into_stmt
/repo/gcc-trunk/gcc/tree-ssa-dom.cc:2115
0x164c402 dom_opt_dom_walker::optimize_stmt(basic_block_def*,
gimple_stmt_iterator*, bool*)
/repo/gcc-trunk/gcc/tree-ssa-dom.cc:2343
0x164dc97 dom_opt_dom_walker::before_dom_children(basic_block_def*)
/repo/gcc-trunk/gcc/tree-ssa-dom.cc:1748
0x263f7ae dom_walker::walk(basic_block_def*)
/repo/gcc-trunk/gcc/domwalk.cc:311
0x164e728 execute
/repo/gcc-trunk/gcc/tree-ssa-dom.cc:939
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

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

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

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

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

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

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

The result is 0 instead of -1.

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

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

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

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

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

Compiler output:
$ x86_64-pc-linux-gnu-gcc -O testcase.c
testcase.c: In function 'foo':
testcase.c:7:1: error: definition in block 4 does not dominate use in block 5
7 | foo(int a)
  | ^~~
for SSA_NAME: _33 in statement:
_36 = _33 << 33;
during GIMPLE pass: bitintlower
testcase.c:7:1: internal compiler error: verify_ssa failed
0x177d34f verify_ssa(bool, bool)
/repo/gcc-trunk/gcc/tree-ssa.cc:1203
0x13ceab5 execute_function_todo
/repo/gcc-trunk/gcc/passes.cc:2095
0x13cef1e execute_todo
/repo/gcc-trunk/gcc/passes.cc:2142
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.


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

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

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

Bug ID: 114334
   Summary: [14 Regression] ICE: in extract_insn, at recog.cc:2812
(unrecognizable insn and:HF?) with lroundf16() and
-ffast-math -mavx512fp16
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu

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

Compiler output:
$ x86_64-pc-linux-gnu-gcc -ffast-math -mavx512fp16 testcase.c  
testcase.c: In function 'foo':
testcase.c:5:1: error: unrecognizable insn:
5 | }
  | ^
(insn 10 9 11 2 (set (reg:HF 102)
(and:HF (reg:HF 104)
(reg:HF 101))) "testcase.c":4:10 -1
 (nil))
during RTL pass: vregs
testcase.c:5:1: internal compiler error: in extract_insn, at recog.cc:2812
0x8071a7 _fatal_insn(char const*, rtx_def const*, char const*, int, char
const*)
/repo/gcc-trunk/gcc/rtl-error.cc:108
0x807224 _fatal_insn_not_found(rtx_def const*, char const*, int, char const*)
/repo/gcc-trunk/gcc/rtl-error.cc:116
0x7f6093 extract_insn(rtx_insn*)
/repo/gcc-trunk/gcc/recog.cc:2812
0x113444d instantiate_virtual_regs_in_insn
/repo/gcc-trunk/gcc/function.cc:1611
0x113444d instantiate_virtual_regs
/repo/gcc-trunk/gcc/function.cc:1994
0x113444d execute
/repo/gcc-trunk/gcc/function.cc:2041
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

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

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

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

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

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

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


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

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

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

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

or for

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


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

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

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

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

Bug ID: 114329
   Summary: ICE: verify_gimple failed: 'bit_field_ref' of
non-mode-precision operand with bitfield _BitInt()
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu

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

Compiler output:
$ x86_64-pc-linux-gnu-gcc testcase.c
testcase.c: In function 'foo':
testcase.c:6:1: error: 'bit_field_ref' of non-mode-precision operand
6 | foo(void)
  | ^~~
# .MEM_20 = VDEF <.MEM_19>
BIT_FIELD_REF  = _9;
during GIMPLE pass: bitintlower0
testcase.c:6:1: internal compiler error: verify_gimple failed
0x155f56d verify_gimple_in_cfg(function*, bool, bool)
/repo/gcc-trunk/gcc/tree-cfg.cc:5663
0x13ce234 execute_function_todo
/repo/gcc-trunk/gcc/passes.cc:2088
0x13ce78e execute_todo
/repo/gcc-trunk/gcc/passes.cc:2142
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

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

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

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

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

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

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

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

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

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

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

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

Compiler output:
$ x86_64-pc-linux-gnu-gcc testcase.c
during GIMPLE pass: bitintlower0
testcase.c: In function 'foo':
testcase.c:8:1: internal compiler error: in limb_access_type, at
gimple-lower-bitint.cc:591
8 | foo (void)
  | ^~~
0xd748bf limb_access_type
/repo/gcc-trunk/gcc/gimple-lower-bitint.cc:591
0x264c8d4 limb_access_type
/repo/gcc-trunk/gcc/gimple-lower-bitint.cc:587
0x264c8d4 limb_access
/repo/gcc-trunk/gcc/gimple-lower-bitint.cc:606
0x265c659 handle_load
/repo/gcc-trunk/gcc/gimple-lower-bitint.cc:1857
0x265c659 handle_stmt
/repo/gcc-trunk/gcc/gimple-lower-bitint.cc:2066
0x265e1f4 lower_mergeable_stmt
/repo/gcc-trunk/gcc/gimple-lower-bitint.cc:2610
0x26625dc lower_stmt
/repo/gcc-trunk/gcc/gimple-lower-bitint.cc:5560
0x2665699 gimple_lower_bitint
/repo/gcc-trunk/gcc/gimple-lower-bitint.cc:6860
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

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

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

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

Bug ID: 114312
   Summary: ICE: SIGSEGV: infinite recursion in chrec_fold_plus_1
(tree-chrec.cc:336) at -O3 with _BitInt()
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: middle-end
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
CC: jakub at gcc dot gnu.org
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu

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

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

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

$ x86_64-pc-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=/repo/gcc-trunk/binary-latest-amd64/bin/x86_64-pc-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-r14-9425-2024032226-g119f5ae0455-checking-yes-rtl-df-extra-nobootstrap-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/14.0.1/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--disable-bootstrap --with-cloog --with-ppl --with-isl
--build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu
--tar

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

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

Bug ID: 114299
   Summary: ICE: SIGSEGV: in dyn_cast
(is-a.h:282) with -mgeneral-regs-only and __bf16
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: error-recovery
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu

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

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

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

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

Bug ID: 114293
   Summary: [14 Regression] ICE: in verify_range, at
value-range.cc:1132 at -O2
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu

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

Compiler output:
$ x86_64-pc-linux-gnu-gcc -O2 testcase.c
testcase.c: In function 'bar':
testcase.c:4:3: warning: '__builtin_memset' specified bound
18374966859414961920 exceeds maximum object size 9223372036854775807
[-Wstringop-overflow=]
4 |   __builtin_memset (, a, 0xFF00FF00FF00FF00);
  |   ^~~~
during GIMPLE pass: strlen
testcase.c: In function 'foo':
testcase.c:9:1: internal compiler error: in verify_range, at
value-range.cc:1132
9 | foo (void)
  | ^~~
0x8a195e irange::verify_range()
/repo/gcc-trunk/gcc/value-range.cc:1132
0x1853427 irange::set(tree_node*, generic_wide_int const&,
generic_wide_int const&, value_range_kind)
/repo/gcc-trunk/gcc/value-range.cc:1076
0x17394e8 int_range<2u, false>::int_range(tree_node*,
generic_wide_int const&, generic_wide_int
const&, value_range_kind)
/repo/gcc-trunk/gcc/value-range.h:1047
0x17394e8 set_strlen_range(tree_node*, generic_wide_int,
generic_wide_int, tree_node*)
/repo/gcc-trunk/gcc/tree-ssa-strlen.cc:1942
0x17455f8 strlen_pass::handle_builtin_strlen()
/repo/gcc-trunk/gcc/tree-ssa-strlen.cc:2344
0x1745ab5 strlen_pass::check_and_optimize_call(bool*)
/repo/gcc-trunk/gcc/tree-ssa-strlen.cc:5412
0x1746499 strlen_pass::check_and_optimize_stmt(bool*)
/repo/gcc-trunk/gcc/tree-ssa-strlen.cc:5670
0x17468d6 strlen_pass::before_dom_children(basic_block_def*)
/repo/gcc-trunk/gcc/tree-ssa-strlen.cc:5854
0x2615eae dom_walker::walk(basic_block_def*)
/repo/gcc-trunk/gcc/domwalk.cc:311
0x1746dd7 printf_strlen_execute
/repo/gcc-trunk/gcc/tree-ssa-strlen.cc:5913
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

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

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

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

Bug ID: 114286
   Summary: ICE: in deref_rvalue, at analyzer/region-model.cc:2762
with _Atomic _BitInt() and -fanalyzer
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: analyzer
  Assignee: dmalcolm at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
CC: jakub at gcc dot gnu.org
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu

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

Compiler output:
$ x86_64-pc-linux-gnu-gcc -fanalyzer testcase.c
during IPA pass: analyzer
testcase.c: In function 'foo':
testcase.c:5:3: internal compiler error: in deref_rvalue, at
analyzer/region-model.cc:2762
5 |   b;
  |   ^
0x8c81ff ana::region_model::deref_rvalue(ana::svalue const*, tree_node*,
ana::region_model_context*, bool) const
/repo/gcc-trunk/gcc/analyzer/region-model.cc:2762
0x192a209 ana::kf_atomic_load::impl_call_pre(ana::call_details const&) const
/repo/gcc-trunk/gcc/analyzer/kf.cc:289
0x19464f7 ana::region_model::on_call_pre(gcall const*,
ana::region_model_context*)
/repo/gcc-trunk/gcc/analyzer/region-model.cc:1700
0x194a31a ana::region_model::on_stmt_pre(gimple const*, bool*,
ana::region_model_context*)
/repo/gcc-trunk/gcc/analyzer/region-model.cc:1337
0x1912190 ana::exploded_node::on_stmt(ana::exploded_graph&, ana::supernode
const*, gimple const*, ana::program_state*, ana::uncertainty_t*, bool*,
ana::path_context*)
/repo/gcc-trunk/gcc/analyzer/engine.cc:1515
0x1914f2a ana::exploded_graph::process_node(ana::exploded_node*)
/repo/gcc-trunk/gcc/analyzer/engine.cc:4125
0x1915e9a ana::exploded_graph::process_worklist()
/repo/gcc-trunk/gcc/analyzer/engine.cc:3516
0x19185f5 ana::impl_run_checkers(ana::logger*)
/repo/gcc-trunk/gcc/analyzer/engine.cc:6210
0x1919506 ana::run_checkers()
/repo/gcc-trunk/gcc/analyzer/engine.cc:6301
0x1908158 execute
/repo/gcc-trunk/gcc/analyzer/analyzer-pass.cc:87
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

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

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

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

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

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

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

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

Bug ID: 114278
   Summary: ICE: in extract_bit_field_1, at expmed.cc:1838 with
memmove, _BitInt() and -O2 -fno-tree-dce -fno-tree-dse
-fno-tree-ccp -m32
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: rtl-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
CC: jakub at gcc dot gnu.org
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: i686-pc-linux-gnu

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

Compiler output:
$ x86_64-pc-linux-gnu-gcc -O2 -fno-tree-dce -fno-tree-dse -fno-tree-ccp -m32
testcase.c -Wall -W
during RTL pass: expand
testcase.c: In function 'foo':
testcase.c:4:37: internal compiler error: in extract_bit_field_1, at
expmed.cc:1838
4 |   _BitInt(128) b = *(_BitInt(128) *)__builtin_memmove(, p, 16);
  | ^~~~
0x758082 extract_bit_field_1
/repo/gcc-trunk/gcc/expmed.cc:1838
0x10a868c extract_bit_field(rtx_def*, poly_int<1u, unsigned long>, poly_int<1u,
unsigned long>, int, rtx_def*, machine_mode, machine_mode, bool, rtx_def**)
/repo/gcc-trunk/gcc/expmed.cc:2151
0x10c7654 expand_expr_real_1(tree_node*, rtx_def*, machine_mode,
expand_modifier, rtx_def**, bool)
/repo/gcc-trunk/gcc/expr.cc:12456
0x10d323d store_expr(tree_node*, rtx_def*, int, bool, bool)
/repo/gcc-trunk/gcc/expr.cc:6740
0x10d5e6f expand_assignment(tree_node*, tree_node*, bool)
/repo/gcc-trunk/gcc/expr.cc:6461
0x10d5e6f expand_assignment(tree_node*, tree_node*, bool)
/repo/gcc-trunk/gcc/expr.cc:5946
0xf8cfe9 expand_gimple_stmt_1
/repo/gcc-trunk/gcc/cfgexpand.cc:3998
0xf8cfe9 expand_gimple_stmt
/repo/gcc-trunk/gcc/cfgexpand.cc:4077
0xf8e677 expand_gimple_basic_block
/repo/gcc-trunk/gcc/cfgexpand.cc:6133
0xf90cfe execute
/repo/gcc-trunk/gcc/cfgexpand.cc:6872
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.


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

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

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

Bug ID: 114274
   Summary: ICE: tree check: expected block, have ggc_freed in
inlining_chain_to_json, at optinfo-emit-json.cc:284
with -fsave-optimization-record
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: ipa
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu

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

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

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

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

Zdenek Sojka  changed:

   What|Removed |Added

 CC||zsojka at seznam dot cz

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

$ x86_64-pc-linux-gnu-gcc -O2 -fno-vect-cost-model -mavx2 -fno-strict-overflow
testcase.c 
during GIMPLE pass: slp
testcase.c: In function 'foo':
testcase.c:4:1: internal compiler error: tree check: expected class 'type',
have 'exceptional' (error_mark) in useless_type_conversion_p, at
gimple-expr.cc:85
4 | foo (long e)
  | ^~~
0x892abf tree_class_check_failed(tree_node const*, tree_code_class, char
const*, int, char const*)
/repo/gcc-trunk/gcc/tree.cc:9005
0x77dab4 tree_class_check(tree_node*, tree_code_class, char const*, int, char
const*)
/repo/gcc-trunk/gcc/tree.h:3767
0x77dab4 useless_type_conversion_p(tree_node*, tree_node*)
/repo/gcc-trunk/gcc/gimple-expr.cc:85
0x154c759 verify_gimple_assign_binary
/repo/gcc-trunk/gcc/tree-cfg.cc:4305
0x155e9b1 verify_gimple_in_cfg(function*, bool, bool)
/repo/gcc-trunk/gcc/tree-cfg.cc:5599
0x13cde04 execute_function_todo
/repo/gcc-trunk/gcc/passes.cc:2088
0x13ce35e execute_todo
/repo/gcc-trunk/gcc/passes.cc:2142
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

[Bug tree-optimization/114246] New: [11/12/13/14 Regression] ICE: verify_gimple failed: invalid argument to gimple call with __builtin_memcpy()

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

Bug ID: 114246
   Summary: [11/12/13/14 Regression] ICE: verify_gimple failed:
invalid argument to gimple call with
__builtin_memcpy()
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu

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

Compiler output:
$ x86_64-pc-linux-gnu-gcc -O testcase.c 
testcase.c: In function 'foo':
testcase.c:8:1: error: invalid argument to gimple call
8 | }
  | ^
(char *) 
# .MEM_3 = VDEF <.MEM_2(D)>
__builtin_memcpy (  [(void *) + 1B], (char *) , 1);
during GIMPLE pass: dse
testcase.c:8:1: internal compiler error: verify_gimple failed
0x155f0bd verify_gimple_in_cfg(function*, bool, bool)
/repo/gcc-trunk/gcc/tree-cfg.cc:5663
0x13cde04 execute_function_todo
/repo/gcc-trunk/gcc/passes.cc:2088
0x13ce35e execute_todo
/repo/gcc-trunk/gcc/passes.cc:2142
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

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

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

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

Bug ID: 114211
   Summary: [13/14 Regression] wrong code with -O
-fno-tree-coalesce-vars
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: wrong-code
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu

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

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


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

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

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

Bug ID: 114209
   Summary: ICE: verify_gimple failed: incorrect sharing of tree
nodes at -O and above
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: middle-end
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
CC: jakub at gcc dot gnu.org
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: i686-pc-linux-gnu

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

Compiler output:
$ x86_64-pc-linux-gnu-gcc -O -m32 testcase.c 
testcase.c: In function 'foo':
testcase.c:7:1: error: incorrect sharing of tree nodes
7 | foo(void)
  | ^~~
MEM[(_BitInt(128) *)p.0_1]
# VUSE <.MEM_5(D)>
_8 = VIEW_CONVERT_EXPR(MEM[(_BitInt(128) *)p.0_1]);
during GIMPLE pass: bitintlower
testcase.c:7:1: internal compiler error: verify_gimple failed
0x155df5d verify_gimple_in_cfg(function*, bool, bool)
/repo/gcc-trunk/gcc/tree-cfg.cc:5663
0x13cccb4 execute_function_todo
/repo/gcc-trunk/gcc/passes.cc:2088
0x13cd20e execute_todo
/repo/gcc-trunk/gcc/passes.cc:2142
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

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

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

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

Bug ID: 114190
   Summary: wrong code with -O2 -fno-dce -fharden-compares
-mvpclmulqdq
--param=max-rtl-if-conversion-unpredictable-cost=136
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: wrong-code
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu

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

Output:
$ x86_64-pc-linux-gnu-gcc -O2 -fno-dce -fharden-compares -mvpclmulqdq
--param=max-rtl-if-conversion-unpredictable-cost=136 testcase.c -Wno-psabi
$ ./a.out 
Aborted

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

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

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

Bug ID: 114184
   Summary: ICE: in extract_insn, at recog.cc:2812 (unrecognizable
insn ) with -Og -mavx512f and __builtin_memmove()
_BitInt(256)
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
CC: jakub at gcc dot gnu.org
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu

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

Compiler output:
$ x86_64-pc-linux-gnu-gcc -Og -mavx512f testcase.c 
testcase.c: In function 'foo':
testcase.c:7:1: error: unrecognizable insn:
7 | }
  | ^
(insn 5 2 6 2 (set (reg/v:XF 98 [ d ])
(subreg:XF (const_vector:V32QI [
(const_int -107 [0xff95])
(const_int -120 [0xff88])
(const_int 89 [0x59])
(const_int 42 [0x2a])
(const_int 38 [0x26])
(const_int -16 [0xfff0])
(const_int -60 [0xffc4])
(const_int -62 [0xffc2])
(const_int 0 [0]) repeated x24
]) 0)) "testcase.c":6:3 -1
 (nil))
during RTL pass: vregs
testcase.c:7:1: internal compiler error: in extract_insn, at recog.cc:2812
0x807075 _fatal_insn(char const*, rtx_def const*, char const*, int, char
const*)
/repo/gcc-trunk/gcc/rtl-error.cc:108
0x8070f2 _fatal_insn_not_found(rtx_def const*, char const*, int, char const*)
/repo/gcc-trunk/gcc/rtl-error.cc:116
0x7f5f61 extract_insn(rtx_insn*)
/repo/gcc-trunk/gcc/recog.cc:2812
0x113331d instantiate_virtual_regs_in_insn
/repo/gcc-trunk/gcc/function.cc:1611
0x113331d instantiate_virtual_regs
/repo/gcc-trunk/gcc/function.cc:1994
0x113331d execute
/repo/gcc-trunk/gcc/function.cc:2041
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

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

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

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

Bug ID: 114159
   Summary: [13/14 Regression] ICE: in call_info, at
analyzer/call-info.cc:143 with -fanalyzer
-fanalyzer-call-summaries
--param=analyzer-max-svalue-depth=0
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: analyzer
  Assignee: dmalcolm at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu

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

Compiler output:
$ x86_64-pc-linux-gnu-gcc -fanalyzer -fanalyzer-call-summaries
--param=analyzer-max-svalue-depth=0 pr36690-2.i
during IPA pass: analyzer
pr36690-2.i: In function 'main':
pr36690-2.i:13:3: internal compiler error: in call_info, at
analyzer/call-info.cc:143
   13 |   foo();
  |   ^
0xdc029b ana::call_info::call_info(ana::call_details const&)
/repo/gcc-trunk/gcc/analyzer/call-info.cc:143
0xdc029b ana::call_info::call_info(ana::call_details const&)
/repo/gcc-trunk/gcc/analyzer/call-info.cc:139
0x190bf18 ana::call_summary_edge_info::call_summary_edge_info(ana::call_details
const&, function*, ana::call_summary*, ana::extrinsic_state const&)
/repo/gcc-trunk/gcc/analyzer/engine.cc:1619
0x190bf18 std::enable_if::value,
std::unique_ptr > >::type
make_unique(ana::call_details&,
function*&, ana::call_summary*&, ana::extrinsic_state const&)
/repo/gcc-trunk/gcc/make-unique.h:41
0x190bf18 ana::exploded_node::replay_call_summary(ana::exploded_graph&,
ana::supernode const*, gcall const*, ana::program_state*, ana::path_context*,
function*, ana::call_summary*, ana::region_model_context*)
/repo/gcc-trunk/gcc/analyzer/engine.cc:1734
0x190c0bd ana::exploded_node::replay_call_summaries(ana::exploded_graph&,
ana::supernode const*, gcall const*, ana::program_state*, ana::path_context*,
function*, ana::per_function_data*, ana::region_model_context*)
/repo/gcc-trunk/gcc/analyzer/engine.cc:1677
0x19119df ana::exploded_node::on_stmt(ana::exploded_graph&, ana::supernode
const*, gimple const*, ana::program_state*, ana::uncertainty_t*, bool*,
ana::path_context*)
/repo/gcc-trunk/gcc/analyzer/engine.cc:1499
0x19143ba ana::exploded_graph::process_node(ana::exploded_node*)
/repo/gcc-trunk/gcc/analyzer/engine.cc:4124
0x191532a ana::exploded_graph::process_worklist()
/repo/gcc-trunk/gcc/analyzer/engine.cc:3515
0x1917a85 ana::impl_run_checkers(ana::logger*)
/repo/gcc-trunk/gcc/analyzer/engine.cc:6209
0x1918996 ana::run_checkers()
/repo/gcc-trunk/gcc/analyzer/engine.cc:6300
0x19075f8 execute
/repo/gcc-trunk/gcc/analyzer/analyzer-pass.cc:87
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.


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

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

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

Bug ID: 114157
   Summary: during GIMPLE pass: bitintlower ICE: in lower_stmt, at
gimple-lower-bitint.cc:5561 with -O with _BitInt(256)
/ vector memmove
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: middle-end
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
CC: jakub at gcc dot gnu.org
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu

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

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

Compiler output:
$ x86_64-pc-linux-gnu-gcc -O testcase.c -Wno-psabi
during GIMPLE pass: bitintlower
testcase.c: In function 'foo':
testcase.c:4:1: internal compiler error: in lower_stmt, at
gimple-lower-bitint.cc:5561
4 | foo (__attribute__((__vector_size__ (64))) long s)
  | ^~~
0xd79d8e lower_stmt
/repo/gcc-trunk/gcc/gimple-lower-bitint.cc:5561
0x269e129 gimple_lower_bitint
/repo/gcc-trunk/gcc/gimple-lower-bitint.cc:6759
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

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

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

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

Bug ID: 114156
   Summary: during GIMPLE pass: bitintlower ICE: in lower_stmt, at
gimple-lower-bitint.cc:5335 with -O -m32 and
_BitInt(128) __builtin_memmove()
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: middle-end
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
CC: jakub at gcc dot gnu.org
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: i686-pc-linux-gnu

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

This happens even after the PR113988 fix.

Compiler output:
$ x86_64-pc-linux-gnu-gcc -O -m32 testcase.c
during GIMPLE pass: bitintlower
testcase.c: In function 'foo':
testcase.c:4:1: internal compiler error: in lower_stmt, at
gimple-lower-bitint.cc:5335
4 | foo(void)
  | ^~~
0xd79caa lower_stmt
/repo/gcc-trunk/gcc/gimple-lower-bitint.cc:5335
0x269e129 gimple_lower_bitint
/repo/gcc-trunk/gcc/gimple-lower-bitint.cc:6759
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

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

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

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

Bug ID: 114139
   Summary: ICE: RTL check: expected code 'const_int', have 'reg'
in riscv_macro_fusion_pair_p, at
config/riscv/riscv.cc:8438 with -O2 -fpic
-mexplicit-relocs -mcpu=sifive-p450
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: riscv64-unknown-linux-gnu

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

This might need RTL checking enabled to reproduce.

Compiler output:
$ riscv64-unknown-linux-gnu-gcc -O2 -fpic -mexplicit-relocs -mcpu=sifive-p450
testcase.c
during RTL pass: sched2
testcase.c: In function 'foo':
testcase.c:15:1: internal compiler error: RTL check: expected code 'const_int',
have 'reg' in riscv_macro_fusion_pair_p, at config/riscv/riscv.cc:8438
   15 | }
  | ^
0xad7f4d rtl_check_failed_code1(rtx_def const*, rtx_code, char const*, int,
char const*)
/repo/gcc-trunk/gcc/rtl.cc:770
0xb8ccd4 riscv_macro_fusion_pair_p
/repo/gcc-trunk/gcc/config/riscv/riscv.cc:8438
0x2b11634 sched_macro_fuse_insns
/repo/gcc-trunk/gcc/sched-deps.cc:2859
0x2b11634 sched_analyze_insn
/repo/gcc-trunk/gcc/sched-deps.cc:2898
0x2b12329 deps_analyze_insn(deps_desc*, rtx_insn*)
/repo/gcc-trunk/gcc/sched-deps.cc:3690
0x2b1541a sched_analyze(deps_desc*, rtx_insn*, rtx_insn*)
/repo/gcc-trunk/gcc/sched-deps.cc:3843
0x16b24a8 compute_block_dependences
/repo/gcc-trunk/gcc/sched-rgn.cc:2738
0x16b24a8 sched_rgn_compute_dependencies(int)
/repo/gcc-trunk/gcc/sched-rgn.cc:3367
0x16b4d48 schedule_region
/repo/gcc-trunk/gcc/sched-rgn.cc:3139
0x16b4d48 schedule_insns()
/repo/gcc-trunk/gcc/sched-rgn.cc:3525
0x16b53ed schedule_insns()
/repo/gcc-trunk/gcc/sched-rgn.cc:3511
0x16b53ed rest_of_handle_sched2
/repo/gcc-trunk/gcc/sched-rgn.cc:3749
0x16b53ed execute
/repo/gcc-trunk/gcc/sched-rgn.cc:3888
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

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

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

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

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

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

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

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

This testcase does not need -mavx512f, but -m32 instead:
$ x86_64-pc-linux-gnu-gcc -O -m32 testcase32.c
during GIMPLE pass: bitintlower
testcase32.c: In function 'foo':
testcase32.c:6:1: internal compiler error: in handle_cast, at
gimple-lower-bitint.cc:1559
6 | foo(void)
  | ^~~
0xd784d7 handle_cast
/repo/gcc-trunk/gcc/gimple-lower-bitint.cc:1559
0x2697a04 lower_mergeable_stmt
/repo/gcc-trunk/gcc/gimple-lower-bitint.cc:2525
0x269bdec lower_stmt
/repo/gcc-trunk/gcc/gimple-lower-bitint.cc:5459
0x269ed49 gimple_lower_bitint
/repo/gcc-trunk/gcc/gimple-lower-bitint.cc:6759
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See  for instructions.

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

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

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

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

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

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

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

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

Zdenek Sojka  changed:

   What|Removed |Added

 CC||zsojka at seznam dot cz

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

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

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

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

depending on which of the functions is compiled

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

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

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

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

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

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

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

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

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

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

Bug ID: 114096
   Summary: ICE: in lower_stmt, at gimple-lower-bitint.cc:5533 on
vector -> _BitInt() cast
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---

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

Compiler output:
$ x86_64-pc-linux-gnu-gcc testcase.c -Wno-psabi
during GIMPLE pass: bitintlower0
testcase.c: In function 'foo':
testcase.c:5:1: internal compiler error: in lower_stmt, at
gimple-lower-bitint.cc:5533
5 | foo(V v)
  | ^~~
0xd8d6b3 lower_stmt
/repo/gcc-trunk/gcc/gimple-lower-bitint.cc:5533
0x27235b9 gimple_lower_bitint
/repo/gcc-trunk/gcc/gimple-lower-bitint.cc:6719
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

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

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

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

Bug ID: 114094
   Summary: Assembler messages: Error: junk `nop' after expression
with -fprofile -fPIE -mno-direct-extern-access
-masm=intel
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: assemble-failure
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu

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

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

There is probably missing a newline somewhere.


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

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

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

Bug ID: 114084
   Summary: ICE: SIGSEGV: infinite recursion in fold_build2_loc /
fold_binary_loc with _BitInt(127)
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
CC: jakub at gcc dot gnu.org
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu

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

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

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


$ x86_64-pc-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=/repo/gcc-trunk/binary-latest-amd64/bin/x86_64-pc-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-r14-9151-20240223113818-g22121546e03-checking-yes-rtl-df-extra-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/14.0.1/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--with-cloog --with-ppl --with-isl --build=x86_64-pc-linux-gnu
--host=x86_64-pc-linux-gnu --target=x86_64-pc-linux-gnu
--with-ld=/usr/bin/x86_64-pc-linux-gnu-ld
--with-as=/usr/bin/x86_64-pc-linux-gnu-as --disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r14-9

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

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

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

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

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

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

Bug ID: 114054
   Summary: ICE: in reduce_to_bit_field_precision, at
expr.cc:12658 with -Og -fwhole-program -fno-tree-ccp
-fprofile-use -fno-tree-copy-prop and _BitInt()
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: rtl-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
CC: jakub at gcc dot gnu.org
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu

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

Compiler output:
$ x86_64-pc-linux-gnu-gcc -Og -fwhole-program -fno-tree-ccp -fprofile-use
-fno-tree-copy-prop testcase.c
testcase.c: In function 'main':
testcase.c:13:1: warning: '.../a-testcase.gcda' profile count data file not
found [-Wmissing-profile]
   13 | }
  | ^
during RTL pass: expand
testcase.c: In function 'foo.constprop':
testcase.c:6:7: internal compiler error: in reduce_to_bit_field_precision, at
expr.cc:12658
6 |   x = __builtin_mul_overflow_p ((unsigned _BitInt(1)) u, i,
(_BitInt(33)) 0);
  |   ^~~~
0x763136 reduce_to_bit_field_precision
/repo/gcc-trunk/gcc/expr.cc:12658
0x10bf96a expand_expr_real_2(separate_ops*, rtx_def*, machine_mode,
expand_modifier)
/repo/gcc-trunk/gcc/expr.cc:10267
0x11fb10c expand_arith_overflow
/repo/gcc-trunk/gcc/internal-fn.cc:2722
0xf83d8f expand_call_stmt
/repo/gcc-trunk/gcc/cfgexpand.cc:2771
0xf83d8f expand_gimple_stmt_1
/repo/gcc-trunk/gcc/cfgexpand.cc:3932
0xf83d8f expand_gimple_stmt
/repo/gcc-trunk/gcc/cfgexpand.cc:4077
0xf8a2fe expand_gimple_basic_block
/repo/gcc-trunk/gcc/cfgexpand.cc:6133
0xf8bfd7 execute
/repo/gcc-trunk/gcc/cfgexpand.cc:6872
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

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

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

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

Bug ID: 114043
   Summary: ICE: in write_symbol, at lto-streamer-out.cc:3015 with
-O -fstrict-enums -fprofile-generate -flto
--param=max-early-inliner-iterations=0
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: lto
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu

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

Compiler output:
$ x86_64-pc-linux-gnu-gcc -O -fstrict-enums -fprofile-generate -flto
--param=max-early-inliner-iterations=0 script_tile.ii
during IPA pass: modref
script_tile.ii:31:1: internal compiler error: in write_symbol, at
lto-streamer-out.cc:3015
   31 | }
  | ^
0x8aa345 write_symbol
/repo/gcc-trunk/gcc/lto-streamer-out.cc:3015
0x163b3c4 produce_symtab
/repo/gcc-trunk/gcc/lto-streamer-out.cc:3115
0x163b3c4 produce_asm_for_decls()
/repo/gcc-trunk/gcc/lto-streamer-out.cc:3373
0x16cd612 write_lto
/repo/gcc-trunk/gcc/passes.cc:2782
0x16cd612 ipa_write_summaries_1
/repo/gcc-trunk/gcc/passes.cc:2843
0x16cd612 ipa_write_summaries()
/repo/gcc-trunk/gcc/passes.cc:2899
0x12ccbf2 ipa_passes
/repo/gcc-trunk/gcc/cgraphunit.cc:2262
0x12ccbf2 symbol_table::compile()
/repo/gcc-trunk/gcc/cgraphunit.cc:2335
0x12cf3c7 symbol_table::compile()
/repo/gcc-trunk/gcc/cgraphunit.cc:2315
0x12cf3c7 symbol_table::finalize_compilation_unit()
/repo/gcc-trunk/gcc/cgraphunit.cc:2587
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

[Bug tree-optimization/114041] New: wrong code with _BitInt() and -O -fgraphite-identity

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

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

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

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

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

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

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

Bug ID: 114042
   Summary: diagnostics about __builtin_stdc_bit_ceil() mentions
__builtin_clzg()
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: diagnostic
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu

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

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


but it should talk about __builtin_stdc_bit_ceil()

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

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

Bug ID: 114044
   Summary: ICE: in expand_fn_using_insn, at internal-fn.cc:208
with _BitInt() and -O -fno-tree-dce
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: rtl-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
CC: jakub at gcc dot gnu.org
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu

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

Compiler output:
$ x86_64-pc-linux-gnu-gcc -O -fno-tree-dce testcase.c 
during RTL pass: expand
testcase.c: In function 'foo':
testcase.c:5:7: internal compiler error: in expand_fn_using_insn, at
internal-fn.cc:208
5 |   5 | __builtin_stdc_bit_floor(ub256_0) & 4;
  |   ^
0x79b2a7 expand_fn_using_insn
/repo/gcc-trunk/gcc/internal-fn.cc:208
0xf83d8f expand_call_stmt
/repo/gcc-trunk/gcc/cfgexpand.cc:2771
0xf83d8f expand_gimple_stmt_1
/repo/gcc-trunk/gcc/cfgexpand.cc:3932
0xf83d8f expand_gimple_stmt
/repo/gcc-trunk/gcc/cfgexpand.cc:4077
0xf8a2fe expand_gimple_basic_block
/repo/gcc-trunk/gcc/cfgexpand.cc:6133
0xf8bfd7 execute
/repo/gcc-trunk/gcc/cfgexpand.cc:6872
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Bug ID: 114016
   Summary: ICE: in AT_unsigned, at dwarf2out.cc:4592 with
-march=armv9-a -gbtf or -gctf
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: aarch64-unknown-linux-gnu

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

Compiler output:
$ aarch64-unknown-linux-gnu-gcc -march=armv9-a -gbtf testcase.c 
testcase.c:2:1: internal compiler error: in AT_unsigned, at dwarf2out.cc:4592
2 | void fn_f64x4(svfloat64x4_t) {}
  | ^~~~
0x7a2627 AT_unsigned(dw_attr_struct*)
/repo/gcc-trunk/gcc/dwarf2out.cc:4592
0x7a433d AT_unsigned(dw_attr_struct*)
/repo/gcc-trunk/gcc/dwarf2out.cc:4591
0xe43aee ctf_die_bitsize
/repo/gcc-trunk/gcc/dwarf2ctf.cc:211
0xe4463e gen_ctf_sou_type
/repo/gcc-trunk/gcc/dwarf2ctf.cc:526
0xe43f07 gen_ctf_type
/repo/gcc-trunk/gcc/dwarf2ctf.cc:892
0xe43cc7 gen_ctf_function_type
/repo/gcc-trunk/gcc/dwarf2ctf.cc:718
0xe44b53 gen_ctf_function
/repo/gcc-trunk/gcc/dwarf2ctf.cc:853
0xe44b53 ctf_do_die(die_struct*)
/repo/gcc-trunk/gcc/dwarf2ctf.cc:974
0xe99183 ctf_debug_do_cu
/repo/gcc-trunk/gcc/dwarf2out.cc:33018
0xe99183 ctf_debug_do_cu
/repo/gcc-trunk/gcc/dwarf2out.cc:33011
0xe99183 dwarf2out_early_finish
/repo/gcc-trunk/gcc/dwarf2out.cc:33147
0xdf680f symbol_table::finalize_compilation_unit()
/repo/gcc-trunk/gcc/cgraphunit.cc:2580
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

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

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

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

Bug ID: 114015
   Summary: ICE: in build_abbrev_table, at dwarf2out.cc:9266 with
-g -fvar-tracking-assignments -fdebug-types-section
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: debug
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu

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

Compiler output:
$ x86_64-pc-linux-gnu-gcc -g -fvar-tracking-assignments -fdebug-types-section
testcase.c -w
testcase.c:1:35: internal compiler error: in build_abbrev_table, at
dwarf2out.cc:9266
1 | int barfoo(_BitInt(236) n, struct {char a[n];}) {}
  |   ^
0x7463b2 build_abbrev_table
/repo/gcc-trunk/gcc/dwarf2out.cc:9266
0x1046418 build_abbrev_table
/repo/gcc-trunk/gcc/dwarf2out.cc:9323
0x1046418 build_abbrev_table
/repo/gcc-trunk/gcc/dwarf2out.cc:9323
0x1046871 output_comdat_type_unit
/repo/gcc-trunk/gcc/dwarf2out.cc:11473
0x1070e1a dwarf2out_finish
/repo/gcc-trunk/gcc/dwarf2out.cc:32565
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

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

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

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

Bug ID: 114014
   Summary: ICE: 'verify_type' failed: 'TYPE_CANONICAL' is not
compatible with -gbtf or -gctf on gcc.dg/gnu23-tag-1.c
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: debug
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu

Created attachment 57471
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57471=edit
reduced, valid testcase (from gcc.dg/gnu23-tag-1.c)

Compiler output:
$ x86_64-pc-linux-gnu-gcc -std=gnu23 testcase.c -gbtf
testcase.c:8:1: error: 'TYPE_CANONICAL' is not compatible
8 | };
  | ^
 >
testcase.c:8:1: internal compiler error: 'verify_type' failed
0x185477e verify_type(tree_node const*)
/repo/gcc-trunk/gcc/tree.cc:14394
0x1053f24 gen_type_die_with_usage
/repo/gcc-trunk/gcc/dwarf2out.cc:26266
0x1050c38 gen_type_die
/repo/gcc-trunk/gcc/dwarf2out.cc:26497
0x1050c38 gen_decl_die
/repo/gcc-trunk/gcc/dwarf2out.cc:27137
0x1051f6b dwarf2out_decl
/repo/gcc-trunk/gcc/dwarf2out.cc:27695
0x10521c8 dwarf2out_type_decl
/repo/gcc-trunk/gcc/dwarf2out.cc:27413
0x10521c8 dwarf2out_type_decl
/repo/gcc-trunk/gcc/dwarf2out.cc:27408
0x13d07c4 rest_of_type_compilation(tree_node*, int)
/repo/gcc-trunk/gcc/passes.cc:339
0xe0e7e2 finish_struct(unsigned int, tree_node*, tree_node*, tree_node*,
c_struct_parse_info*, tree_node**)
/repo/gcc-trunk/gcc/c/c-decl.cc:9733
0xe6919d c_parser_struct_or_union_specifier
/repo/gcc-trunk/gcc/c/c-parser.cc:4090
0xe6919d c_parser_declspecs(c_parser*, c_declspecs*, bool, bool, bool, bool,
bool, bool, bool, c_lookahead_kind)
/repo/gcc-trunk/gcc/c/c-parser.cc:3494
0xe7871c c_parser_declaration_or_fndef
/repo/gcc-trunk/gcc/c/c-parser.cc:2306
0xe848eb c_parser_external_declaration
/repo/gcc-trunk/gcc/c/c-parser.cc:2046
0xe852d5 c_parser_translation_unit
/repo/gcc-trunk/gcc/c/c-parser.cc:1900
0xe852d5 c_parse_file()
/repo/gcc-trunk/gcc/c/c-parser.cc:26816
0xefcaf1 c_common_parse_file()
/repo/gcc-trunk/gcc/c-family/c-opts.cc:1311
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

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

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

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

Bug ID: 114000
   Summary: [11/12/13/14 Regression] ICE: in
force_nonfallthru_and_redirect, at cfgrtl.cc:1556 with
-O2 -freorder-blocks-and-partition -fPIC
-mexplicit-relocs
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: riscv64-unknown-linux-gnu

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

Compiler output:
$ riscv64-unknown-linux-gnu-gcc -O2 -freorder-blocks-and-partition -fPIC
-mexplicit-relocs testcase.c 
during RTL pass: pro_and_epilogue
testcase.c: In function 'foo':
testcase.c:11:1: internal compiler error: in force_nonfallthru_and_redirect, at
cfgrtl.cc:1556
   11 | }
  | ^
0xa05536 force_nonfallthru_and_redirect(edge_def*, basic_block_def*, rtx_def*)
/repo/gcc-trunk/gcc/cfgrtl.cc:1556
0x1193ce3 redirect_edge_and_branch_force(edge_def*, basic_block_def*)
/repo/gcc-trunk/gcc/cfghooks.cc:508
0x16d5bfa try_shrink_wrapping(edge_def**, rtx_insn*)
/repo/gcc-trunk/gcc/shrink-wrap.cc:1019
0x1349c4b thread_prologue_and_epilogue_insns()
/repo/gcc-trunk/gcc/function.cc:6057
0x134a5d2 rest_of_handle_thread_prologue_and_epilogue
/repo/gcc-trunk/gcc/function.cc:6565
0x134a5d2 execute
/repo/gcc-trunk/gcc/function.cc:6651
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

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

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

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

Bug ID: 113999
   Summary: [14 Regression] ICE: in
string_cst_has_null_terminator, at
analyzer/region-model.cc:3651 with -fanalyzer on
gcc.dg/tree-ssa/strncpy-2.c
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: analyzer
  Assignee: dmalcolm at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu

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

Maybe related to PR113998

Compiler output:
$ x86_64-pc-linux-gnu-gcc -fanalyzer gcc.dg/tree-ssa/strncpy-2.c
during IPA pass: analyzer
gcc.dg/tree-ssa/strncpy-2.c: In function 'main':
gcc.dg/tree-ssa/strncpy-2.c:24:15: internal compiler error: in
string_cst_has_null_terminator, at analyzer/region-model.cc:3651
   24 |   size_t n1 = __builtin_strlen (a);
  |   ^~~~
0x8c3351 string_cst_has_null_terminator
/repo/gcc-trunk/gcc/analyzer/region-model.cc:3651
0x195c069 svalue_byte_range_has_null_terminator_1
/repo/gcc-trunk/gcc/analyzer/region-model.cc:3712
0x195c069 svalue_byte_range_has_null_terminator
/repo/gcc-trunk/gcc/analyzer/region-model.cc:3809
0x195c3c8 svalue_byte_range_has_null_terminator_1
/repo/gcc-trunk/gcc/analyzer/region-model.cc:3774
0x195c3c8 svalue_byte_range_has_null_terminator
/repo/gcc-trunk/gcc/analyzer/region-model.cc:3809
0x1969838 ana::region_model::scan_for_null_terminator_1(ana::region const*,
tree_node*, ana::svalue const**, ana::region_model_context*) const
/repo/gcc-trunk/gcc/analyzer/region-model.cc:4066
0x196a67e
ana::region_model::check_for_null_terminated_string_arg(ana::call_details
const&, unsigned int, bool, ana::svalue const**) const
/repo/gcc-trunk/gcc/analyzer/region-model.cc:4337
0x1945766 ana::kf_strlen::impl_call_pre(ana::call_details const&) const
/repo/gcc-trunk/gcc/analyzer/kf.cc:1389
0x1961a57 ana::region_model::on_call_pre(gcall const*,
ana::region_model_context*)
/repo/gcc-trunk/gcc/analyzer/region-model.cc:1700
0x196600a ana::region_model::on_stmt_pre(gimple const*, bool*,
ana::region_model_context*)
/repo/gcc-trunk/gcc/analyzer/region-model.cc:1337
0x192cf70 ana::exploded_node::on_stmt(ana::exploded_graph&, ana::supernode
const*, gimple const*, ana::program_state*, ana::uncertainty_t*, bool*,
ana::path_context*)
/repo/gcc-trunk/gcc/analyzer/engine.cc:1512
0x192ff05 ana::exploded_graph::process_node(ana::exploded_node*)
/repo/gcc-trunk/gcc/analyzer/engine.cc:4124
0x1930e3a ana::exploded_graph::process_worklist()
/repo/gcc-trunk/gcc/analyzer/engine.cc:3515
0x19335a3 ana::impl_run_checkers(ana::logger*)
/repo/gcc-trunk/gcc/analyzer/engine.cc:6209
0x19344b6 ana::run_checkers()
/repo/gcc-trunk/gcc/analyzer/engine.cc:6300
0x1922e58 execute
/repo/gcc-trunk/gcc/analyzer/analyzer-pass.cc:87
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

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

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

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

Bug ID: 113998
   Summary: [14 Regression] ICE: in get_last_byte_offset, at
analyzer/ranges.cc:171 with -fanalyzer and
__builtin_strncpy()
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: analyzer
  Assignee: dmalcolm at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu

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

Compiler output:
$ x86_64-pc-linux-gnu-gcc -fanalyzer testcase.c
during IPA pass: analyzer
testcase.c: In function 'main':
testcase.c:7:3: internal compiler error: in get_last_byte_offset, at
analyzer/ranges.cc:171
7 |   __builtin_strncpy (a, a, n);
  |   ^~~
0xdd3983
ana::symbolic_byte_range::get_last_byte_offset(ana::region_model_manager&)
const
/repo/gcc-trunk/gcc/analyzer/ranges.cc:171
0x29727b7 ana::symbolic_byte_range::intersection(ana::symbolic_byte_range
const&, ana::region_model const&) const
/repo/gcc-trunk/gcc/analyzer/ranges.cc:202
0x2948321 ana::call_details::complain_about_overlap(unsigned int, unsigned int,
ana::svalue const*) const
/repo/gcc-trunk/gcc/analyzer/call-details.cc:517
0x194238f update_model
/repo/gcc-trunk/gcc/analyzer/kf.cc:1545
0x193038a ana::exploded_graph::process_node(ana::exploded_node*)
/repo/gcc-trunk/gcc/analyzer/engine.cc:4240
0x1930e3a ana::exploded_graph::process_worklist()
/repo/gcc-trunk/gcc/analyzer/engine.cc:3515
0x19335a3 ana::impl_run_checkers(ana::logger*)
/repo/gcc-trunk/gcc/analyzer/engine.cc:6209
0x19344b6 ana::run_checkers()
/repo/gcc-trunk/gcc/analyzer/engine.cc:6300
0x1922e58 execute
/repo/gcc-trunk/gcc/analyzer/analyzer-pass.cc:87
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

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

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

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

Bug ID: 113995
   Summary: ICE: in change_address_1, at emit-rtl.cc:2299 with
[[arm::streaming_compatible]] and -march=armv9-a+sve
-finstrument-functions -fstack-clash-protection
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: aarch64-unknown-linux-gnu

Created attachment 57461
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57461=edit
reduced testcase (from gcc.target/aarch64/sve/acle/general-c/func_redef_5.c)

Compiler output:
$ aarch64-unknown-linux-gnu-gcc -march=armv9-a+sve -finstrument-functions
-fstack-clash-protection testcase.c 
during RTL pass: pro_and_epilogue
testcase.c: In function 'svadd_u8_x':
testcase.c:1:68: internal compiler error: in change_address_1, at
emit-rtl.cc:2299
1 | __SVUint8_t svadd_u8_x(__SVUint8_t) [[arm::streaming_compatible]] {}
  |^
0x7af34f change_address_1
/repo/gcc-trunk/gcc/emit-rtl.cc:2299
0xeee695 emit_move_insn(rtx_def*, rtx_def*)
/repo/gcc-trunk/gcc/expr.cc:4712
0x17207ee aarch64_save_callee_saves
/repo/gcc-trunk/gcc/config/aarch64/aarch64.cc:8573
0x172322d aarch64_expand_prologue()
/repo/gcc-trunk/gcc/config/aarch64/aarch64.cc:9626
0x1d615da gen_prologue()
/repo/gcc-trunk/gcc/config/aarch64/aarch64.md:1003
0x170c175 target_gen_prologue
/repo/gcc-trunk/gcc/config/aarch64/aarch64.md:8109
0xf6b3e7 make_prologue_seq
/repo/gcc-trunk/gcc/function.cc:5816
0xf6b583 thread_prologue_and_epilogue_insns()
/repo/gcc-trunk/gcc/function.cc:6051
0xf6bf22 rest_of_handle_thread_prologue_and_epilogue
/repo/gcc-trunk/gcc/function.cc:6565
0xf6bf22 execute
/repo/gcc-trunk/gcc/function.cc:6651
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

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

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

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

Bug ID: 113993
   Summary: ICE: in get_no_error_domain, at tree-call-cdce.cc:815
with __builtin_exp2f32x() at -O1 and above
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu

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

Compiler output:
$ x86_64-pc-linux-gnu-gcc -O testcase.c
during GIMPLE pass: cdce
testcase.c: In function 'foo':
testcase.c:2:1: internal compiler error: in get_no_error_domain, at
tree-call-cdce.cc:815
2 | foo (int i)
  | ^~~
0x82d40f get_no_error_domain
/repo/gcc-trunk/gcc/tree-call-cdce.cc:815
0x82d40f gen_shrink_wrap_conditions
/repo/gcc-trunk/gcc/tree-call-cdce.cc:852
0x1544693 shrink_wrap_one_built_in_call
/repo/gcc-trunk/gcc/tree-call-cdce.cc:1101
0x1544693 shrink_wrap_conditional_dead_built_in_calls
/repo/gcc-trunk/gcc/tree-call-cdce.cc:1213
0x1544693 execute
/repo/gcc-trunk/gcc/tree-call-cdce.cc:1292
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

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

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

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

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

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

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

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

Bug ID: 113983
   Summary: [14 Regression] ICE: tree check: expected integer_cst,
have vector_cst in
maybe_undo_optimize_bit_field_compare, at
analyzer/region-model-manager.cc:606 with -fanalyzer
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: analyzer
  Assignee: dmalcolm at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu

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

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

testcase.c:8:22: internal compiler error: Segmentation fault
0x151aef2 crash_signal
/repo/gcc-trunk/gcc/toplev.cc:317
0x2aec460 x86_64_fallback_frame_state
./md-unwind-support.h:63
0x2aec460 uw_frame_state_for
/repo/gcc-trunk/libgcc/unwind-dw2.c:1013
0x2aed79d _Unwind_Backtrace
/repo/gcc-trunk/libgcc/unwind.inc:303
0x2a97f89 backtrace_full
/repo/gcc-trunk/libbacktrace/backtrace.c:127
0x29ff2a6 diagnostic_context::action_after_output(diagnostic_t)
/repo/gcc-trunk/gcc/diagnostic.cc:781
0x29ff4bb diagnostic_action_after_output(diagnostic_context*, diagnostic_t)
/repo/gcc-trunk/gcc/diagnostic.h:1002
0x29ff4bb diagnostic_context::report_diagnostic(diagnostic_info*)
/repo/gcc-trunk/gcc/diagnostic.cc:1633
0x29ff838 diagnostic_impl
/repo/gcc-trunk/gcc/diagnostic.cc:1767
0x29fff06 internal_error(char const*, ...)
/repo/gcc-trunk/gcc/diagnostic.cc:2225
0x88ddd5 tree_check_failed(tree_node const*, char const*, int, char const*,
...)
/repo/gcc-trunk/gcc/tree.cc:8955
x86_64-pc-linux-gnu-gcc: internal compiler error: Segmentation fault signal
terminated program cc1
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
See <https://gcc.gnu.org/bugs/> for instructions.

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

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

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

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

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

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

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

Bug ID: 113969
   Summary: ICE: SIGSEGV in finish_enum_value_list (decl.cc:17143)
on invalid code
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: ice-on-invalid-code
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu

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

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

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

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

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

Bug ID: 113968
   Summary: ICE: in create_tmp_var, at gimple-expr.cc:488 with
-fcontracts and invalid member in contract
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: error-recovery, ice-on-invalid-code
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu

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

Compiler output:
$ x86_64-pc-linux-gnu-gcc -fcontracts testcase.C 
testcase.C:4:20: error: 'struct A' has no member named 'm'
4 | void f(A a)[[pre:a.m]] {}
  |^
testcase.C: In function 'void f(A)':
testcase.C:4:22: internal compiler error: in create_tmp_var, at
gimple-expr.cc:488
4 | void f(A a)[[pre:a.m]] {}
  |  ^
0x85aa24 create_tmp_var(tree_node*, char const*)
/repo/gcc-trunk/gcc/gimple-expr.cc:488
0x85aa24 create_tmp_var(tree_node*, char const*)
/repo/gcc-trunk/gcc/gimple-expr.cc:478
0x14b275a create_tmp_from_val
/repo/gcc-trunk/gcc/gimplify.cc:568
0x14b275a lookup_tmp_var
/repo/gcc-trunk/gcc/gimplify.cc:590
0x14b275a internal_get_tmp_var
/repo/gcc-trunk/gcc/gimplify.cc:645
0x14ad29f get_formal_tmp_var(tree_node*, gimple**)
/repo/gcc-trunk/gcc/gimplify.cc:673
0x14ad29f gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
/repo/gcc-trunk/gcc/gimplify.cc:18804
0x14c0011 gimplify_expr
/repo/gcc-trunk/gcc/gimplify.cc:18849
0x14c0011 gimplify_arg(tree_node**, gimple**, unsigned int, bool)
/repo/gcc-trunk/gcc/gimplify.cc:3751
0x14c06b3 gimplify_call_expr
/repo/gcc-trunk/gcc/gimplify.cc:4036
0x14adc56 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
/repo/gcc-trunk/gcc/gimplify.cc:17749
0x14c5b43 gimplify_cleanup_point_expr
/repo/gcc-trunk/gcc/gimplify.cc:7480
0x14adc37 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
/repo/gcc-trunk/gcc/gimplify.cc:18173
0x14c5195 gimplify_stmt(tree_node**, gimple**)
/repo/gcc-trunk/gcc/gimplify.cc:7480
0x14c5195 gimplify_body(tree_node*, bool)
/repo/gcc-trunk/gcc/gimplify.cc:19047
0x14c55dc gimplify_function_tree(tree_node*)
/repo/gcc-trunk/gcc/gimplify.cc:19246
0x12d2657 cgraph_node::analyze()
/repo/gcc-trunk/gcc/cgraphunit.cc:685
0x12d5277 analyze_functions
/repo/gcc-trunk/gcc/cgraphunit.cc:1249
0x12d61fd symbol_table::finalize_compilation_unit()
/repo/gcc-trunk/gcc/cgraphunit.cc:2556
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

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

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

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

Bug ID: 113967
   Summary: [14 Regression] ICE: in exact_div, at poly-int.h:2156
with -O -mavx512f
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu

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

Compiler output:
$ x86_64-pc-linux-gnu-gcc -O -mavx512f testcase.c
during GIMPLE pass: forwprop
testcase.c: In function 'bar3':
testcase.c:25:1: internal compiler error: in exact_div, at poly-int.h:2156
   25 | }
  | ^
0x8f2762 poly_int<1u, poly_result::is_poly>::type,
poly_coeff_pair_traits::is_poly>::type>::result_kind>::type>
exact_div<1u, unsigned long, unsigned long>(poly_int<1u, unsigned long> const&,
unsigned long)
/repo/gcc-trunk/gcc/poly-int.h:2156
0x8f2762 poly_int<1u, poly_result::is_poly>::type,
poly_coeff_pair_traits::is_poly>::type>::result_kind>::type>
exact_div<1u, unsigned long, unsigned long>(poly_int<1u, unsigned long> const&,
unsigned long)
/repo/gcc-trunk/gcc/poly-int.h:2150
0x8f2762 gimple_simplify_BIT_INSERT_EXPR(gimple_match_op*, gimple**, tree_node*
(*)(tree_node*), code_helper, tree_node*, tree_node*, tree_node*, tree_node*)
/repo/build-gcc-trunk-amd64/gcc/gimple-match-5.cc:16981
0x1cd5853 gimple_resimplify3
/repo/gcc-trunk/gcc/gimple-match-exports.cc:1107
0x1cd6a12 gimple_simplify(gimple*, gimple_match_op*, gimple**, tree_node*
(*)(tree_node*), tree_node* (*)(tree_node*))
/repo/gcc-trunk/gcc/gimple-match-exports.cc:898
0x116c817 fold_stmt_1
/repo/gcc-trunk/gcc/gimple-fold.cc:6359
0x166c5d5 execute
/repo/gcc-trunk/gcc/tree-ssa-forwprop.cc:3950
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

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

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

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

Bug ID: 113876
   Summary: ICE: in ix86_expand_epilogue, at
config/i386/i386.cc:10101 with -O
-mpreferred-stack-boundary=3 -finstrument-functions
-mapxf -mcmodel=large and _BitInt()
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu

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

Compiler output:
$ x86_64-pc-linux-gnu-gcc -O -mpreferred-stack-boundary=3
-finstrument-functions -mapxf -mcmodel=large testcase.c 
during RTL pass: pro_and_epilogue
testcase.c: In function 'bar':
testcase.c:1:21: internal compiler error: in ix86_expand_epilogue, at
config/i386/i386.cc:10101
1 | _BitInt(129) bar() {}
  | ^
0x8b8e63 ix86_expand_epilogue(int)
/repo/gcc-trunk/gcc/config/i386/i386.cc:10101
0x1fca31f gen_epilogue()
/repo/gcc-trunk/gcc/config/i386/i386.md:19238
0x18eb205 target_gen_epilogue
/repo/gcc-trunk/gcc/config/i386/i386.md:18734
0x113ac26 make_epilogue_seq
/repo/gcc-trunk/gcc/function.cc:5970
0x113acfb thread_prologue_and_epilogue_insns()
/repo/gcc-trunk/gcc/function.cc:6052
0x113b6a2 rest_of_handle_thread_prologue_and_epilogue
/repo/gcc-trunk/gcc/function.cc:6565
0x113b6a2 execute
/repo/gcc-trunk/gcc/function.cc:6651
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

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

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

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

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

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

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

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

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

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

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

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

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

Similar to PR113766

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

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

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

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

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

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

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

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

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

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

Bug ID: 113819
   Summary: ICE: RTL check: expected elt 3 type 'e' or 'u', have
'0' (rtx code_label) in PATTERN, at rtl.h:1511 with
-mstringop-strategy=loop and asm goto with impossible
constraint and _BitInt()
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu

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

This might need RTL checking enabled.

Compiler output:
$ x86_64-pc-linux-gnu-gcc -mstringop-strategy=loop testcase.c
during RTL pass: expand
testcase.c: In function 'test5_limit':
testcase.c:4:3: internal compiler error: RTL check: expected elt 3 type 'e' or
'u', have '0' (rtx code_label) in PATTERN, at rtl.h:1511
4 |   __asm__ goto("" : "=r"(addr) : : : t_err);
  |   ^~~
0x8072bd rtl_check_failed_type2(rtx_def const*, int, int, int, char const*,
int, char const*)
/repo/gcc-trunk/gcc/rtl.cc:761
0x72a1a4 PATTERN(rtx_def*)
/repo/gcc-trunk/gcc/rtl.h:1511
0x72cd2d PATTERN(rtx_def*)
/repo/gcc-trunk/gcc/rtl.h:1479
0x72cd2d expand_asm_stmt
/repo/gcc-trunk/gcc/cfgexpand.cc:3681
0xf845a9 expand_gimple_stmt_1
/repo/gcc-trunk/gcc/cfgexpand.cc:3923
0xf845a9 expand_gimple_stmt
/repo/gcc-trunk/gcc/cfgexpand.cc:4071
0xf8b3be expand_gimple_basic_block
/repo/gcc-trunk/gcc/cfgexpand.cc:6127
0xf8d097 execute
/repo/gcc-trunk/gcc/cfgexpand.cc:6866
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

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

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

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

Bug ID: 113818
   Summary: ICE: verify_gimple failed: missing 'PHI' def with -Os
-fnon-call-exceptions -finstrument-functions-once and
_BitInt()
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu

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

Compiler output:
$ x86_64-pc-linux-gnu-gcc -Os -fnon-call-exceptions -finstrument-functions-once
testcase.c 
testcase.c: In function 'foo':
testcase.c:9:1: error: missing 'PHI' def
9 | foo (void)
  | ^~~
testcase.c:9:1: error: missing 'PHI' def
testcase.c:9:1: error: missing 'PHI' def
finally_tmp.7_7 = PHI <0(5), 2(10), 1(9), (8), (6), (7)>
during GIMPLE pass: bitintlower
testcase.c:9:1: internal compiler error: verify_gimple failed
0x155b7cd verify_gimple_in_cfg(function*, bool, bool)
/repo/gcc-trunk/gcc/tree-cfg.cc:5666
0x13cac94 execute_function_todo
/repo/gcc-trunk/gcc/passes.cc:2088
0x13cb1ee execute_todo
/repo/gcc-trunk/gcc/passes.cc:2142
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

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

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

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

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

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

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

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

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

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

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

Compiler output:
$ x86_64-pc-linux-gnu-gcc -O -mavx512f testcase.c
during GIMPLE pass: bitintlower
testcase.c: In function 'foo':
testcase.c:2:1: internal compiler error: in lower_stmt, at
gimple-lower-bitint.cc:5455
2 | foo(void *p, _BitInt(246) x)
  | ^~~
0xd8cedf lower_stmt
/repo/gcc-trunk/gcc/gimple-lower-bitint.cc:5455
0x2721439 gimple_lower_bitint
/repo/gcc-trunk/gcc/gimple-lower-bitint.cc:6582
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

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

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

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

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

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

This might need RTL checking enabled.

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

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

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

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

Bug ID: 113777
   Summary: ICE: in add_child_die_after, at dwarf2out.cc:5785 with
-g -fsso-struct=big-endian and
__attribute__((__hardbool__))
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: debug
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu

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

Compiler output:
$ x86_64-pc-linux-gnu-gcc -g -fsso-struct=big-endian testcase.c 
testcase.c:5:1: internal compiler error: in add_child_die_after, at
dwarf2out.cc:5785
5 | };
  | ^
0x746e52 add_child_die_after
/repo/gcc-trunk/gcc/dwarf2out.cc:5785
0x746e52 add_child_die_after
/repo/gcc-trunk/gcc/dwarf2out.cc:5782
0x106c42d gen_enumeration_type_die
/repo/gcc-trunk/gcc/dwarf2out.cc:22868
0x105399a gen_tagged_type_die
/repo/gcc-trunk/gcc/dwarf2out.cc:26201
0x105399a gen_type_die_with_usage
/repo/gcc-trunk/gcc/dwarf2out.cc:26441
0x1056334 gen_type_die
/repo/gcc-trunk/gcc/dwarf2out.cc:26497
0x1056334 modified_type_die
/repo/gcc-trunk/gcc/dwarf2out.cc:13985
0x10573b6 add_type_attribute
/repo/gcc-trunk/gcc/dwarf2out.cc:22388
0x1053d35 gen_array_type_die
/repo/gcc-trunk/gcc/dwarf2out.cc:22655
0x1053d35 gen_type_die_with_usage
/repo/gcc-trunk/gcc/dwarf2out.cc:26434
0x10505ed gen_type_die
/repo/gcc-trunk/gcc/dwarf2out.cc:26497
0x10505ed gen_decl_die
/repo/gcc-trunk/gcc/dwarf2out.cc:27213
0x1052b96 gen_member_die
/repo/gcc-trunk/gcc/dwarf2out.cc:25949
0x1052b96 gen_struct_or_union_type_die
/repo/gcc-trunk/gcc/dwarf2out.cc:26045
0x1052b96 gen_tagged_type_die
/repo/gcc-trunk/gcc/dwarf2out.cc:26247
0x105399a gen_tagged_type_die
/repo/gcc-trunk/gcc/dwarf2out.cc:26201
0x105399a gen_type_die_with_usage
/repo/gcc-trunk/gcc/dwarf2out.cc:26441
0x10506e5 gen_type_die
/repo/gcc-trunk/gcc/dwarf2out.cc:26497
0x10506e5 gen_decl_die
/repo/gcc-trunk/gcc/dwarf2out.cc:27137
0x10516bb dwarf2out_decl
/repo/gcc-trunk/gcc/dwarf2out.cc:27695
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

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

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

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

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

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

This fails even with the PR113753 patch applied.

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

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

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

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

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

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

Compiler output:
$ riscv64-unknown-linux-gnu-gcc -march=rv64gv testcase.c 
during RTL pass: expand
testcase.c: In function 'foo':
testcase.c:6:3: internal compiler error: in generate_insn, at
config/riscv/riscv-vector-builtins.cc:4186
6 |   __riscv_vfredosum_tu();
  |   ^~
0xb9bd49 riscv_vector::function_expander::generate_insn(insn_code)
/repo/gcc-trunk/gcc/config/riscv/riscv-vector-builtins.cc:4186
0xb9bd49 riscv_vector::function_expander::generate_insn(insn_code)
/repo/gcc-trunk/gcc/config/riscv/riscv-vector-builtins.cc:4184
0x1bcd50d riscv_vector::function_expander::expand()
/repo/gcc-trunk/gcc/config/riscv/riscv-vector-builtins.h:582
0x1bcd50d riscv_vector::expand_builtin(unsigned int, tree_node*, rtx_def*)
/repo/gcc-trunk/gcc/config/riscv/riscv-vector-builtins.cc:4589
0x12ca5e3 expand_expr_real_1(tree_node*, rtx_def*, machine_mode,
expand_modifier, rtx_def**, bool)
/repo/gcc-trunk/gcc/expr.cc:12350
0x1187df8 expand_expr(tree_node*, rtx_def*, machine_mode, expand_modifier)
/repo/gcc-trunk/gcc/expr.h:316
0x1187df8 expand_call_stmt
/repo/gcc-trunk/gcc/cfgexpand.cc:2864
0x1187df8 expand_gimple_stmt_1
/repo/gcc-trunk/gcc/cfgexpand.cc:3926
0x1187df8 expand_gimple_stmt
/repo/gcc-trunk/gcc/cfgexpand.cc:4071
0x118e45e expand_gimple_basic_block
/repo/gcc-trunk/gcc/cfgexpand.cc:6127
0x1190067 execute
/repo/gcc-trunk/gcc/cfgexpand.cc:6866
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.


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

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

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

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

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

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

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

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

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

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

Bug ID: 113747
   Summary: ICE: SIGSEGV in non_type_check (tree.h:3822) with
-fopenacc --param=openacc-kernels=decompose on invalid
code
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: ice-on-invalid-code
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu

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

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

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

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

Bug ID: 113746
   Summary: [14 Regression] ICE: tree check: expected
enumeral_type, have error_mark in tsubst_expr, at
cp/pt.cc:21458 with missing typename
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: ice-on-invalid-code
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu

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

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

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

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

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

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

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

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

This might need RTL checking enabled.

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

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

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

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

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

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

Compiler output:
$ x86_64-pc-linux-gnu-gcc testcase.c 
testcase.c:3:1: internal compiler error: in build_bitint_type, at tree.cc:7178
3 | };
  | ^
0x89961c build_bitint_type(unsigned long, int)
/repo/gcc-trunk/gcc/tree.cc:7178
0xe0e96b finish_struct(unsigned int, tree_node*, tree_node*, tree_node*,
c_struct_parse_info*, tree_node**)
/repo/gcc-trunk/gcc/c/c-decl.cc:9560
0xe69d7d c_parser_struct_or_union_specifier
/repo/gcc-trunk/gcc/c/c-parser.cc:4090
0xe69d7d c_parser_declspecs(c_parser*, c_declspecs*, bool, bool, bool, bool,
bool, bool, bool, c_lookahead_kind)
/repo/gcc-trunk/gcc/c/c-parser.cc:3494
0xe792ec c_parser_declaration_or_fndef
/repo/gcc-trunk/gcc/c/c-parser.cc:2306
0xe854bb c_parser_external_declaration
/repo/gcc-trunk/gcc/c/c-parser.cc:2046
0xe85ea5 c_parser_translation_unit
/repo/gcc-trunk/gcc/c/c-parser.cc:1900
0xe85ea5 c_parse_file()
/repo/gcc-trunk/gcc/c/c-parser.cc:26815
0xefd681 c_common_parse_file()
/repo/gcc-trunk/gcc/c-family/c-opts.cc:1306
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

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

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

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

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

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

Compiler output:
$ riscv64-unknown-linux-gnu-gcc testcase.c 
testcase.c: In function 'foo':
testcase.c:4:1: internal compiler error: in riscv_hard_regno_nregs, at
config/riscv/riscv.cc:8072
4 | {
  | ^
0xb8742e riscv_hard_regno_nregs
/repo/gcc-trunk/gcc/config/riscv/riscv.cc:8072
0x166c5fa init_reg_modes_target()
/repo/gcc-trunk/gcc/reginfo.cc:471
0x128b5f3 init_emit_regs()
/repo/gcc-trunk/gcc/emit-rtl.cc:6237
0x171df76 target_reinit()
/repo/gcc-trunk/gcc/toplev.cc:1934
0x2b9c43a save_target_globals()
/repo/gcc-trunk/gcc/target-globals.cc:92
0x1aeb99d riscv_save_restore_target_globals(tree_node*)
/repo/gcc-trunk/gcc/config/riscv/riscv.cc:9081
0x1aeb99d riscv_save_restore_target_globals(tree_node*)
/repo/gcc-trunk/gcc/config/riscv/riscv.cc:9074
0x133c4f4 invoke_set_current_function_hook
/repo/gcc-trunk/gcc/function.cc:4689
0x1345917 invoke_set_current_function_hook
/repo/gcc-trunk/gcc/function.cc:4863
0x1345917 allocate_struct_function(tree_node*, bool)
/repo/gcc-trunk/gcc/function.cc:4812
0x100f6ed store_parm_decls()
/repo/gcc-trunk/gcc/c/c-decl.cc:11084
0x10780f2 c_parser_declaration_or_fndef
/repo/gcc-trunk/gcc/c/c-parser.cc:2975
0x1081f2b c_parser_external_declaration
/repo/gcc-trunk/gcc/c/c-parser.cc:2046
0x1082913 c_parser_translation_unit
/repo/gcc-trunk/gcc/c/c-parser.cc:1900
0x1082913 c_parse_file()
/repo/gcc-trunk/gcc/c/c-parser.cc:26815
0x10f83b1 c_common_parse_file()
/repo/gcc-trunk/gcc/c-family/c-opts.cc:1306
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

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

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

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

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

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

Compiler output:
$ riscv64-unknown-linux-gnu-gcc -O2 -march=rv64gcv testcase.c 
during RTL pass: rtl_dce
testcase.c: In function 'foo':
testcase.c:7:1: internal compiler error: in df_reg_chain_verify_unmarked, at
df-scan.cc:4001
7 | }
  | ^
0xa138ee df_reg_chain_verify_unmarked
/repo/gcc-trunk/gcc/df-scan.cc:4001
0xa15111 df_reg_chain_verify_unmarked
/repo/gcc-trunk/gcc/df-scan.cc:4218
0xa15111 df_scan_verify()
/repo/gcc-trunk/gcc/df-scan.cc:4264
0x11f06d1 df_verify()
/repo/gcc-trunk/gcc/df-core.cc:1834
0x11f06d1 df_analyze_1
/repo/gcc-trunk/gcc/df-core.cc:1221
0x29de3d5 init_dce
/repo/gcc-trunk/gcc/dce.cc:763
0x29e103d rest_of_handle_fast_dce
/repo/gcc-trunk/gcc/dce.cc:1193
0x29e103d execute
/repo/gcc-trunk/gcc/dce.cc:1290
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

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

  1   2   3   4   5   6   7   8   9   10   >