[Bug target/103302] New: wrong code with -fharden-compares

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

Bug ID: 103302
   Summary: wrong code with -fharden-compares
   Product: gcc
   Version: 12.0
Status: UNCONFIRMED
  Keywords: wrong-code
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: riscv64-unknown-linux-gnu

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

Output:
$ riscv64-unknown-linux-gnu-gcc -Og -fharden-compares -fno-tree-dce
-fno-tree-fre testcase.c -static
$ qemu-riscv64 -- ./a.out 
Trace/breakpoint trap

Debugging shows one of the compares on the first statement probably goes wrong:

(gdb) 
0x000106ea  19u32_0 <= (v512u128) (v512u128_0 != u8_0);
(gdb) 
0x00010a48  24  }

I could find any other target where this testcase is failing.

$ 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-r12-5221-2023015125-g2f3d43a3515-checking-yes-rtl-df-extra-riscv64/bin/../libexec/gcc/riscv64-unknown-linux-gnu/12.0.0/lto-wrapper
Target: riscv64-unknown-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--with-cloog --with-ppl --with-isl
--with-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-r12-5221-2023015125-g2f3d43a3515-checking-yes-rtl-df-extra-riscv64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 12.0.0 2023 (experimental) (GCC)

[Bug tree-optimization/103181] New: [9/10/11/12 Regression] wrong code at -O1 due to conditional division by 0 being executed

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

Bug ID: 103181
   Summary: [9/10/11/12 Regression] wrong code at -O1 due to
conditional division by 0 being executed
   Product: gcc
   Version: 12.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

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

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

The right hand operand of || in
  v += __builtin_bswap16 (s) || (S) (a / ((U){3, 0}));
is executed, even though s != 0 and it may trap.

$ 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-r12-5136-2020203027-gabc2f01914d-checking-yes-rtl-df-extra-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/12.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--with-cloog --with-ppl --with-isl --build=x86_64-pc-linux-gnu
--host=x86_64-pc-linux-gnu --target=x86_64-pc-linux-gnu
--with-ld=/usr/bin/x86_64-pc-linux-gnu-ld
--with-as=/usr/bin/x86_64-pc-linux-gnu-as --disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r12-5136-2020203027-gabc2f01914d-checking-yes-rtl-df-extra-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 12.0.0 2020 (experimental) (GCC)

[Bug ipa/103107] New: [12 Regression] ICE: tree check: expected class 'expression', have 'exceptional' (constructor) in prepare_debug_expressions, at ipa-param-manipulation.c:1189

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

Bug ID: 103107
   Summary: [12 Regression] ICE: tree check: expected class
'expression', have 'exceptional' (constructor) in
prepare_debug_expressions, at
ipa-param-manipulation.c:1189
   Product: gcc
   Version: 12.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
CC: marxin at gcc dot gnu.org
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu

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

Compiler output:
$ x86_64-pc-linux-gnu-gcc -Og -g -fipa-sra -fno-tree-dce testcase.c
In function 'bar.isra':
cc1: internal compiler error: tree check: expected class 'expression', have
'exceptional' (constructor) in prepare_debug_expressions, at
ipa-param-manipulation.c:1189
0x7e2a2b tree_class_check_failed(tree_node const*, tree_code_class, char
const*, int, char const*)
/repo/gcc-trunk/gcc/tree.c:8739
0x7037bd expr_check(tree_node*, char const*, int, char const*)
/repo/gcc-trunk/gcc/tree.h:3602
0x7037bd ipa_param_body_adjustments::prepare_debug_expressions(tree_node*)
/repo/gcc-trunk/gcc/ipa-param-manipulation.c:1189
0x11162c2 ipa_param_body_adjustments::prepare_debug_expressions(tree_node*)
/repo/gcc-trunk/gcc/ipa-param-manipulation.c:1164
0x111725d ipa_param_body_adjustments::common_initialization(tree_node*,
tree_node**, vec*)
/repo/gcc-trunk/gcc/ipa-param-manipulation.c:1365
0x13dc391 tree_function_versioning(tree_node*, tree_node*,
vec*, ipa_param_adjustments*, bool,
bitmap_head*, basic_block_def*)
/repo/gcc-trunk/gcc/tree-inline.c:6307
0xe8dfcd cgraph_node::materialize_clone()
/repo/gcc-trunk/gcc/cgraphclones.c:1141
0xe7c7f5 cgraph_node::get_untransformed_body()
/repo/gcc-trunk/gcc/cgraph.c:3907
0xe87f0d cgraph_node::expand()
/repo/gcc-trunk/gcc/cgraphunit.c:1799
0xe87f0d cgraph_node::expand()
/repo/gcc-trunk/gcc/cgraphunit.c:1781
0xe89597 expand_all_functions
/repo/gcc-trunk/gcc/cgraphunit.c:1992
0xe89597 symbol_table::compile()
/repo/gcc-trunk/gcc/cgraphunit.c:2356
0xe8c067 symbol_table::compile()
/repo/gcc-trunk/gcc/cgraphunit.c:2269
0xe8c067 symbol_table::finalize_compilation_unit()
/repo/gcc-trunk/gcc/cgraphunit.c:2537
Please submit a full bug report,
with preprocessed source if appropriate.
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-r12-4968-20211106001624-g851dff042a2-checking-yes-rtl-df-extra-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/12.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--with-cloog --with-ppl --with-isl --build=x86_64-pc-linux-gnu
--host=x86_64-pc-linux-gnu --target=x86_64-pc-linux-gnu
--with-ld=/usr/bin/x86_64-pc-linux-gnu-ld
--with-as=/usr/bin/x86_64-pc-linux-gnu-as --disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r12-4968-20211106001624-g851dff042a2-checking-yes-rtl-df-extra-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 12.0.0 20211106 (experimental) (GCC)

[Bug middle-end/103064] New: ICE: verify_ssa failed: RESULT_DECL should be read only when DECL_BY_REFERENCE is set with -fharden-conditional-branches

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

Bug ID: 103064
   Summary: ICE: verify_ssa failed: RESULT_DECL should be read
only when DECL_BY_REFERENCE is set with
-fharden-conditional-branches
   Product: gcc
   Version: 12.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: middle-end
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu

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

Compiler output:
$ x86_64-pc-linux-gnu-gcc -O -fharden-conditional-branches -fno-tree-pta
testcase.C 
testcase.C: In function 'S f()':
testcase.C:14:3: error: RESULT_DECL should be read only when DECL_BY_REFERENCE
is set
   14 | S f() {
  |   ^
while verifying SSA_NAME s_7 in statement
__asm__("" : "=g" s_7 : "0" s_2(D));
during GIMPLE pass: hardcbr
testcase.C:14:3: internal compiler error: verify_ssa failed
0x184ac8f verify_ssa(bool, bool)
/repo/gcc-trunk/gcc/tree-ssa.c:1212
0x1517c3d execute_function_todo
/repo/gcc-trunk/gcc/passes.c:2049
0x151857b execute_todo
/repo/gcc-trunk/gcc/passes.c:2096
Please submit a full bug report,
with preprocessed source if appropriate.
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-r12-4872-20211103145922-g600dcd74b8e-checking-yes-rtl-df-extra-nobootstrap-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/12.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--disable-bootstrap --with-cloog --with-ppl --with-isl
--build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu
--target=x86_64-pc-linux-gnu --with-ld=/usr/bin/x86_64-pc-linux-gnu-ld
--with-as=/usr/bin/x86_64-pc-linux-gnu-as --disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r12-4872-20211103145922-g600dcd74b8e-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 12.0.0 20211103 (experimental) (GCC)

[Bug tree-optimization/103062] New: [12 Regression] ICE: SIGSEGV in gimple_simplify_CONVERT_EXPR with -O2 -fno-tree-forwprop

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

Bug ID: 103062
   Summary: [12 Regression] ICE: SIGSEGV in
gimple_simplify_CONVERT_EXPR with -O2
-fno-tree-forwprop
   Product: gcc
   Version: 12.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

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

Compiler output:
$ x86_64-pc-linux-gnu-gcc -O2 -fno-tree-forwprop testcase.c -wrapper
valgrind,-q
==10691== Conditional jump or move depends on uninitialised value(s)
==10691==at 0xE5364C: bitmap_clear_bit (sbitmap.h:153)
==10691==by 0xE5364C: verify_loop_structure() (cfgloop.c:1579)
==10691==by 0x115BDF4: checking_verify_loop_structure (cfgloop.h:646)
==10691==by 0x115BDF4: loop_optimizer_init(unsigned int) (loop-init.c:130)
==10691==by 0x161A109: execute_ranger_vrp(function*, bool)
(tree-vrp.c:4342)
==10691==by 0x124343C: execute_one_pass(opt_pass*) (passes.c:2567)
==10691==by 0x1243CAF: execute_pass_list_1(opt_pass*) (passes.c:2656)
==10691==by 0x1243CC1: execute_pass_list_1(opt_pass*) (passes.c:2657)
==10691==by 0x1243CE8: execute_pass_list(function*, opt_pass*)
(passes.c:2667)
==10691==by 0x124461C: do_per_function_toporder(void (*)(function*, void*),
void*) [clone .part.0] (passes.c:1773)
==10691==by 0x124481E: do_per_function_toporder (passes.c:1740)
==10691==by 0x124481E: execute_ipa_pass_list(opt_pass*) (passes.c:3001)
==10691==by 0xE86C6E: ipa_passes (cgraphunit.c:2154)
==10691==by 0xE86C6E: symbol_table::compile() [clone .part.0]
(cgraphunit.c:2289)
==10691==by 0xE89767: compile (cgraphunit.c:2269)
==10691==by 0xE89767: symbol_table::finalize_compilation_unit()
(cgraphunit.c:2537)
==10691==by 0x134CF4A: compile_file() (toplev.c:477)
==10691== 
==10691== Conditional jump or move depends on uninitialised value(s)
==10691==at 0xE53505: verify_loop_structure() (cfgloop.c:1600)
==10691==by 0x115BDF4: checking_verify_loop_structure (cfgloop.h:646)
==10691==by 0x115BDF4: loop_optimizer_init(unsigned int) (loop-init.c:130)
==10691==by 0x161A109: execute_ranger_vrp(function*, bool)
(tree-vrp.c:4342)
==10691==by 0x124343C: execute_one_pass(opt_pass*) (passes.c:2567)
==10691==by 0x1243CAF: execute_pass_list_1(opt_pass*) (passes.c:2656)
==10691==by 0x1243CC1: execute_pass_list_1(opt_pass*) (passes.c:2657)
==10691==by 0x1243CE8: execute_pass_list(function*, opt_pass*)
(passes.c:2667)
==10691==by 0x124461C: do_per_function_toporder(void (*)(function*, void*),
void*) [clone .part.0] (passes.c:1773)
==10691==by 0x124481E: do_per_function_toporder (passes.c:1740)
==10691==by 0x124481E: execute_ipa_pass_list(opt_pass*) (passes.c:3001)
==10691==by 0xE86C6E: ipa_passes (cgraphunit.c:2154)
==10691==by 0xE86C6E: symbol_table::compile() [clone .part.0]
(cgraphunit.c:2289)
==10691==by 0xE89767: compile (cgraphunit.c:2269)
==10691==by 0xE89767: symbol_table::finalize_compilation_unit()
(cgraphunit.c:2537)
==10691==by 0x134CF4A: compile_file() (toplev.c:477)
==10691== 
==10691== Invalid read of size 8
==10691==at 0x1653789: pointer_equiv_analyzer::get_equiv(tree_node*) const
(value-pointer-equiv.cc:151)
==10691==by 0x165381E: pta_valueize(tree_node*)
(value-pointer-equiv.cc:242)
==10691==by 0x185A185: do_valueize (gimple-match-head.c:1105)
==10691==by 0x185A185: do_valueize (gimple-match-head.c:1101)
==10691==by 0x185A185: gimple_simplify_CONVERT_EXPR(gimple_match_op*,
gimple**, tree_node* (*)(tree_node*), code_helper, tree_node*, tree_node*)
[clone .constprop.0] (gimple-match.c:29983)
==10691==by 0x17E6E92: gimple_resimplify1(gimple**, gimple_match_op*,
tree_node* (*)(tree_node*)) (gimple-match-head.c:244)
==10691==by 0x1011499: gimple_fold_stmt_to_constant_1(gimple*, tree_node*
(*)(tree_node*), tree_node* (*)(tree_node*)) (gimple-fold.c:7350)
==10691==by 0x1653930: pointer_equiv_analyzer::visit_stmt(gimple*)
(value-pointer-equiv.cc:269)
==10691==by 0x14FFD74:
substitute_and_fold_dom_walker::before_dom_children(basic_block_def*)
(tree-ssa-propagate.c:803)
==10691==by 0x21C3B87: dom_walker::walk(basic_block_def*) (domwalk.c:309)
==10691==by 0x14FEE95:
substitute_and_fold_engine::substitute_and_fold(basic_block_def*)
(tree-ssa-propagate.c:987)
==10691==by 0x161A17B: execute_ranger_vrp(function*, bool)
(tree-vrp.c:4349)
==10691==by 0x124343C: execute_one_pass(opt_pass*) (passes.c:2567)
==10691==by 0x1243CAF: execute_pass_list_1(opt_pass*) (passes.c:2656)
==10691==  Address 0x5581fa8 is 0 bytes after a block of size 72 alloc'd
==1

[Bug ipa/103055] New: [12 Regression] ICE: in get_ssa_name_flags, at ipa-modref.c:1660 with --param=modref-max-depth=0

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

Bug ID: 103055
   Summary: [12 Regression] ICE: in get_ssa_name_flags, at
ipa-modref.c:1660 with --param=modref-max-depth=0
   Product: gcc
   Version: 12.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
CC: marxin at gcc dot gnu.org
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu

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

Compiler output:
$ x86_64-pc-linux-gnu-gcc -fipa-modref --param=modref-max-depth=0 testcase.c
during IPA pass: modref
testcase.c: In function 'foo':
testcase.c:5:1: internal compiler error: in get_ssa_name_flags, at
ipa-modref.c:1660
5 | }
  | ^
0x6fdd23 get_ssa_name_flags
/repo/gcc-trunk/gcc/ipa-modref.c:1660
0x6fdd23 analyze_parms
/repo/gcc-trunk/gcc/ipa-modref.c:2179
0x6fdd23 analyze_function
/repo/gcc-trunk/gcc/ipa-modref.c:2351
0x10deaae modref_generate
/repo/gcc-trunk/gcc/ipa-modref.c:2444
0x123af82 execute_ipa_summary_passes(ipa_opt_pass_d*)
/repo/gcc-trunk/gcc/passes.c:2248
0xe801f0 ipa_passes
/repo/gcc-trunk/gcc/cgraphunit.c:2179
0xe801f0 symbol_table::compile()
/repo/gcc-trunk/gcc/cgraphunit.c:2289
0xe82887 symbol_table::compile()
/repo/gcc-trunk/gcc/cgraphunit.c:2269
0xe82887 symbol_table::finalize_compilation_unit()
/repo/gcc-trunk/gcc/cgraphunit.c:2537
Please submit a full bug report,
with preprocessed source if appropriate.
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-r12-4857-20211103014547-g62af7d9402f-checking-yes-rtl-df-extra-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/12.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--with-cloog --with-ppl --with-isl --build=x86_64-pc-linux-gnu
--host=x86_64-pc-linux-gnu --target=x86_64-pc-linux-gnu
--with-ld=/usr/bin/x86_64-pc-linux-gnu-ld
--with-as=/usr/bin/x86_64-pc-linux-gnu-as --disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r12-4857-20211103014547-g62af7d9402f-checking-yes-rtl-df-extra-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 12.0.0 20211103 (experimental) (GCC)

[Bug rtl-optimization/102986] New: [12 Regression] ICE: in expand_shift_1, at expmed.c:2671 with a negative shift of a vector

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

Bug ID: 102986
   Summary: [12 Regression] ICE: in expand_shift_1, at
expmed.c:2671 with a negative shift of a vector
   Product: gcc
   Version: 12.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: rtl-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu

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

Compiler output:
$ x86_64-pc-linux-gnu-gcc testcase.c 
testcase.c: In function 'foo':
testcase.c:8:5: warning: right shift count is negative [-Wshift-count-negative]
8 |   v >>= -1;
  | ^~~
during RTL pass: expand
testcase.c:8:5: internal compiler error: in expand_shift_1, at expmed.c:2671
8 |   v >>= -1;
  | ^~~
0x6b5040 expand_shift_1
/repo/gcc-trunk/gcc/expmed.c:2671
0xf62135 expand_variable_shift(tree_code, machine_mode, rtx_def*, tree_node*,
rtx_def*, int)
/repo/gcc-trunk/gcc/expmed.c:2712
0xf774cf expand_expr_real_2(separate_ops*, rtx_def*, machine_mode,
expand_modifier)
/repo/gcc-trunk/gcc/expr.c:9945
0xe4109f expand_gimple_stmt_1
/repo/gcc-trunk/gcc/cfgexpand.c:3979
0xe4109f expand_gimple_stmt
/repo/gcc-trunk/gcc/cfgexpand.c:4040
0xe46ed8 expand_gimple_basic_block
/repo/gcc-trunk/gcc/cfgexpand.c:6085
0xe490c7 execute
/repo/gcc-trunk/gcc/cfgexpand.c:6811
Please submit a full bug report,
with preprocessed source if appropriate.
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-r12-4764-20211028112842-ga84b9d5373c-checking-yes-rtl-df-extra-nobootstrap-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/12.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--disable-bootstrap --with-cloog --with-ppl --with-isl
--build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu
--target=x86_64-pc-linux-gnu --with-ld=/usr/bin/x86_64-pc-linux-gnu-ld
--with-as=/usr/bin/x86_64-pc-linux-gnu-as --disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r12-4764-20211028112842-ga84b9d5373c-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 12.0.0 20211028 (experimental) (GCC)

[Bug target/102798] New: [9/10/11/12 Regression] wrong code with -O3 -fno-tree-pta -mavx512f

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

Bug ID: 102798
   Summary: [9/10/11/12 Regression] wrong code with -O3
-fno-tree-pta -mavx512f
   Product: gcc
   Version: 12.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 51616
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=51616&action=edit
auto-reduced testcase (from OpenSSL sources)

$ x86_64-pc-linux-gnu-gcc -O3 -fno-tree-pta -mavx512f testcase.c
$ gdb ./a.out
...
(gdb) r
Starting program: /home/smatz/gcc-bug/58/a.out 

Program received signal SIGSEGV, Segmentation fault.
BUF_reverse (out=, out@entry=0x7fffda60 "", in=, in@entry=0x0, size=size@entry=40) at testcase.c:11
11  *out-- = *in++;
(gdb) disas
Dump of assembler code for function BUF_reverse:
...
   0x00401200 <+96>:and$0xffe0,%r9
   0x00401204 <+100>:   add%rcx,%r9
   0x00401207 <+103>:   nopw   0x0(%rax,%rax,1)
=> 0x00401210 <+112>:   vmovdqu (%rdx),%ymm2
   0x00401214 <+116>:   add$0x20,%rdx
   0x00401218 <+120>:   sub$0x20,%rdi
   0x0040121c <+124>:   vperm2i128 $0x1,%ymm2,%ymm2,%ymm0
...
(gdb) info reg
rax0x2840
rbx0x4013d04199376
rcx0x0 0
rdx0x0 0
...

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

[Bug target/102477] [12 Regression] ICE: in emit_move_insn, at expr.c:4026 at -Og and -O

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

--- Comment #4 from Zdenek Sojka  ---
Created attachment 51557
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=51557&action=edit
another testcase, failing at -O

$ x86_64-pc-linux-gnu-gcc -O testcase.c
during RTL pass: expand
testcase.c: In function 'foo':
testcase.c:7:8: internal compiler error: in emit_move_insn, at expr.c:4026
7 |   v *= -(v >> 4 * 8 - 1);
  |^
0x6b91fa emit_move_insn(rtx_def*, rtx_def*)
/repo/gcc-trunk/gcc/expr.c:4026
0xe38a03 expand_gimple_stmt_1
/repo/gcc-trunk/gcc/cfgexpand.c:4006
0xe38a03 expand_gimple_stmt
/repo/gcc-trunk/gcc/cfgexpand.c:4040
0xe3eaff expand_gimple_basic_block
/repo/gcc-trunk/gcc/cfgexpand.c:6082
0xe406ce execute
/repo/gcc-trunk/gcc/cfgexpand.c:6808
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See  for instructions.

[Bug target/85730] complex code for modifying lowest byte in a 4-byte vector

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

--- Comment #3 from Zdenek Sojka  ---
(In reply to Gabriel Ravier from comment #2)
> Seems like they've all got identical code generation over here since GCC 7,
> and the GCC 6 code generation is just very bad for bar (although GCC 7 also
> changed bar and baz's code generation, which previously was as bar's is in
> the description)

I've got a different observation (using the branch HEADs, at -O3):
gcc-6 - ICEs
gcc-7, gcc-8, gcc-9 - the same code generated as in comment #1
gcc-10, gcc-11, gcc-12 - all functions are the same, bar() now has the same
assembly as foo() and baz() - but is that the optimal form?

[Bug tree-optimization/102565] ICE: in upper_bound, at value-range.h:531 under -O2

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

--- Comment #1 from Zdenek Sojka  ---
I can reproduce this with r12-4090, but not with r12-4097. Might be the same as
PR102563.

[Bug target/102477] ICE: in emit_move_insn, at expr.c:4026 at -Og with __builtin_shufflevector()

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

--- Comment #3 from Zdenek Sojka  ---
Created attachment 51517
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=51517&action=edit
different testcase failing at -O without __builtin_shufflevector()

$ x86_64-pc-linux-gnu-gcc -O testcase.c 
during RTL pass: expand
testcase.c: In function 'foo':
testcase.c:7:9: internal compiler error: in emit_move_insn, at expr.c:4026
7 |   V v = -(g >> sizeof (g) - 1);
  | ^~
0x6b8206 emit_move_insn(rtx_def*, rtx_def*)
/repo/gcc-trunk/gcc/expr.c:4026
0xe36893 expand_gimple_stmt_1
/repo/gcc-trunk/gcc/cfgexpand.c:4006
0xe36893 expand_gimple_stmt
/repo/gcc-trunk/gcc/cfgexpand.c:4040
0xe3c98f expand_gimple_basic_block
/repo/gcc-trunk/gcc/cfgexpand.c:6082
0xe3e55e execute
/repo/gcc-trunk/gcc/cfgexpand.c:6808
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See  for instructions.

[Bug target/102478] New: [9/10/11/12 Regression] during RTL pass: ce3: ICE: in gen_reg_rtx, at emit-rtl.c:1167 with -O2 -fno-if-conversion

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

Bug ID: 102478
   Summary: [9/10/11/12 Regression] during RTL pass: ce3: ICE: in
gen_reg_rtx, at emit-rtl.c:1167 with -O2
-fno-if-conversion
   Product: gcc
   Version: 12.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: powerpc64le-unknown-linux-gnu

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

Compiler output:
$ powerpc64le-unknown-linux-gnu-gcc -O2 -fno-if-conversion testcase.c 
testcase.c: In function 'foo':
testcase.c:6:45: warning: division by zero [-Wdiv-by-zero]
6 |   c |= __builtin_expect (65535 / a, 0) && 0 / 0;
  | ^
during RTL pass: ce3
testcase.c:8:1: internal compiler error: in gen_reg_rtx, at emit-rtl.c:1167
8 | }
  | ^
0x63b466 gen_reg_rtx(machine_mode)
/repo/gcc-trunk/gcc/emit-rtl.c:1167
0xba8069 force_reg(machine_mode, rtx_def*)
/repo/gcc-trunk/gcc/explow.c:676
0xe48e63 prepare_cmp_insn
/repo/gcc-trunk/gcc/optabs.c:4396
0xe4a09f gen_cond_trap(rtx_code, rtx_def*, rtx_def*, rtx_def*)
/repo/gcc-trunk/gcc/optabs.c:5851
0x19548e7 find_cond_trap
/repo/gcc-trunk/gcc/ifcvt.c:4721
0x19548e7 find_if_header
/repo/gcc-trunk/gcc/ifcvt.c:4346
0x19548e7 if_convert
/repo/gcc-trunk/gcc/ifcvt.c:5475
0x195565d execute
/repo/gcc-trunk/gcc/ifcvt.c:5628
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

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

[Bug target/102477] New: ICE: in emit_move_insn, at expr.c:4026 at -Og with __builtin_shufflevector()

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

Bug ID: 102477
   Summary: ICE: in emit_move_insn, at expr.c:4026 at -Og with
__builtin_shufflevector()
   Product: gcc
   Version: 12.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 51507
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=51507&action=edit
reduced testcase

Compiler output:
$ x86_64-pc-linux-gnu-gcc -Og testcase.c 
testcase.c: In function 'foo':
testcase.c:10:1: warning: AVX512F vector return without AVX512F enabled changes
the ABI [-Wpsabi]
   10 | {
  | ^
during RTL pass: expand
testcase.c:9:1: internal compiler error: in emit_move_insn, at expr.c:4026
9 | foo (void)
  | ^~~
0x6be049 emit_move_insn(rtx_def*, rtx_def*)
/repo/gcc-trunk/gcc/expr.c:4026
0xe3f43a expand_gimple_stmt_1
/repo/gcc-trunk/gcc/cfgexpand.c:4006
0xe3f43a expand_gimple_stmt
/repo/gcc-trunk/gcc/cfgexpand.c:4040
0xe4555a expand_gimple_basic_block
/repo/gcc-trunk/gcc/cfgexpand.c:6082
0xe47207 execute
/repo/gcc-trunk/gcc/cfgexpand.c:6808
Please submit a full bug report,
with preprocessed source if appropriate.
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-r12-3878-20210924101619-g710c6ab4ad5-checking-yes-rtl-df-extra-nobootstrap-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/12.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--disable-bootstrap --with-cloog --with-ppl --with-isl
--build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu
--target=x86_64-pc-linux-gnu --with-ld=/usr/bin/x86_64-pc-linux-gnu-ld
--with-as=/usr/bin/x86_64-pc-linux-gnu-as --disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r12-3878-20210924101619-g710c6ab4ad5-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 12.0.0 20210924 (experimental) (GCC)

[Bug ipa/60865] ICE: verify_cgraph_node failed: comdat-local function called by outside its comdat with -fdeclone-ctor-dtor

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

Zdenek Sojka  changed:

   What|Removed |Added

  Known to work||5.5.0, 6.5.0, 7.5.0, 8.5.0

--- Comment #4 from Zdenek Sojka  ---
I can't reproduce this any more on gcc-5.5.0 or newer, even with enabled
checking:

$ x86_64-pc-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=/repo/gcc-5-branch/binary-latest-amd64/bin/x86_64-pc-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/repo/gcc-5-branch/binary-5-branch-20171010081101-g926d9947847-checking-yes-rtl-df-nographite-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/5.5.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /repo/gcc-5-branch//configure --enable-languages=c,c++
--disable-nls --enable-checking=yes,rtl,df --without-cloog --without-ppl
--without-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-libsanitizer
--disable-libstdcxx-pch
--prefix=/repo/gcc-5-branch//binary-5-branch-20171010081101-g926d9947847-checking-yes-rtl-df-nographite-amd64
Thread model: posix
gcc version 5.5.0 (GCC) 

$ x86_64-pc-linux-gnu-gcc -O3 -fdeclone-ctor-dtor
--param=ipa-cp-eval-threshold=1 testcase.C -c
(no output)

[Bug tree-optimization/102207] New: [12 Regression] wrong code with __builtin_sub_overflow() at -O1 and above with uint128

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

Bug ID: 102207
   Summary: [12 Regression] wrong code with
__builtin_sub_overflow() at -O1 and above with uint128
   Product: gcc
   Version: 12.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

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

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

The value is 128bit 0xfffe instead of
0xfffe.

$ 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-r12-3354-20210904001638-g7b7395409c7-checking-yes-rtl-df-extra-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/12.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--with-cloog --with-ppl --with-isl --build=x86_64-pc-linux-gnu
--host=x86_64-pc-linux-gnu --target=x86_64-pc-linux-gnu
--with-ld=/usr/bin/x86_64-pc-linux-gnu-ld
--with-as=/usr/bin/x86_64-pc-linux-gnu-as --disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r12-3354-20210904001638-g7b7395409c7-checking-yes-rtl-df-extra-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 12.0.0 20210904 (experimental) (GCC)

[Bug tree-optimization/102141] New: [12 Regression] ICE: verify_ssa failed during GIMPLE pass: bswap at -O2

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

Bug ID: 102141
   Summary: [12 Regression] ICE: verify_ssa failed during GIMPLE
pass: bswap at -O2
   Product: gcc
   Version: 12.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

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

Compiler output:
$ x86_64-pc-linux-gnu-gcc -O2 testcase.c
testcase.c: In function 'foo':
testcase.c:4:1: error: definition in block 2 follows the use
4 | foo (unsigned long x)
  | ^~~
for SSA_NAME: bswapdst_14 in statement:
_15 = (unsigned int) bswapdst_14;
during GIMPLE pass: bswap
testcase.c:4:1: internal compiler error: verify_ssa failed
0x14f5bb1 verify_ssa(bool, bool)
/repo/gcc-trunk/gcc/tree-ssa.c:1214
0x11b7d85 execute_function_todo
/repo/gcc-trunk/gcc/passes.c:2049
0x11b8af3 do_per_function
/repo/gcc-trunk/gcc/passes.c:1687
0x11b8af3 execute_todo
/repo/gcc-trunk/gcc/passes.c:2096
Please submit a full bug report,
with preprocessed source if appropriate.
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-r12-3244-20210831062827-gaba800615e1-checking-yes-rtl-df-extra-nobootstrap-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/12.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--disable-bootstrap --with-cloog --with-ppl --with-isl
--build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu
--target=x86_64-pc-linux-gnu --with-ld=/usr/bin/x86_64-pc-linux-gnu-ld
--with-as=/usr/bin/x86_64-pc-linux-gnu-as --disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r12-3244-20210831062827-gaba800615e1-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 12.0.0 20210831 (experimental) (GCC)

[Bug target/102140] New: [12 Regression] ICE: in extract_constrain_insn, at recog.c:2670 (insn does not satisfy its constraints) with -Og -fipa-cp -fno-tree-ccp -fno-tree-ter

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

Bug ID: 102140
   Summary: [12 Regression] ICE: in extract_constrain_insn, at
recog.c:2670 (insn does not satisfy its constraints)
with -Og -fipa-cp -fno-tree-ccp -fno-tree-ter
   Product: gcc
   Version: 12.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: powerpc64le-unknown-linux-gnu

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

Compiler output:
$ powerpc64le-unknown-linux-gnu-gcc -Og -fipa-cp -fno-tree-ccp -fno-tree-ter
testcase.c
testcase.c: In function 'foo':
testcase.c:23:15: warning: integer constant is so large that it is unsigned
   23 |   bar (1, (V){9223372036854775808 << 64});
  |   ^~~
testcase.c: In function 'bar':
testcase.c:7:1: warning: GCC vector passed by reference: non-standard ABI
extension with no compatibility guarantee [-Wpsabi]
7 | bar (char c, V v)
  | ^~~
testcase.c: In function 'bar.constprop':
testcase.c:18:1: error: insn does not satisfy its constraints:
   18 | }
  | ^
(insn 16 14 17 2 (set (reg:V4SI 65 1 [orig:120 _14 ] [120])
(const_vector:V4SI [
(const_int 0 [0]) repeated x3
(const_int -2147483648 [0x8000])
])) 1163 {vsx_movv4si_64bit}
 (expr_list:REG_EQUIV (const_vector:V4SI [
(const_int 0 [0]) repeated x3
(const_int -2147483648 [0x8000])
])
(nil)))
during RTL pass: reload
testcase.c:18:1: internal compiler error: in extract_constrain_insn, at
recog.c:2670
0x6defa8 _fatal_insn(char const*, rtx_def const*, char const*, int, char
const*)
/repo/gcc-trunk/gcc/rtl-error.c:108
0x6df035 _fatal_insn_not_found(rtx_def const*, char const*, int, char const*)
/repo/gcc-trunk/gcc/rtl-error.c:118
0x6cfb93 extract_constrain_insn(rtx_insn*)
/repo/gcc-trunk/gcc/recog.c:2670
0xdad094 check_rtl
/repo/gcc-trunk/gcc/lra.c:2087
0xdb20bc lra(_IO_FILE*)
/repo/gcc-trunk/gcc/lra.c:2505
0xd63f59 do_reload
/repo/gcc-trunk/gcc/ira.c:5932
0xd63f59 execute
/repo/gcc-trunk/gcc/ira.c:6118
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

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

[Bug tree-optimization/102134] New: [12 Regression] wrong code at -O1

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

Bug ID: 102134
   Summary: [12 Regression] wrong code at -O1
   Product: gcc
   Version: 12.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

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

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

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

[Bug tree-optimization/102046] New: [12 Regression] ICE: tree check: expected class 'type', have 'exceptional' (error_mark) in useless_type_conversion_p, at gimple-expr.c:87 with -O3 -march=btver2

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

Bug ID: 102046
   Summary: [12 Regression] ICE: tree check: expected class
'type', have 'exceptional' (error_mark) in
useless_type_conversion_p, at gimple-expr.c:87 with
-O3 -march=btver2
   Product: gcc
   Version: 12.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

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

Compiler output:
$ x86_64-pc-linux-gnu-gcc -O3 -march=btver2 testcase.c 
during GIMPLE pass: slp
testcase.c: In function 'foo':
testcase.c:9:1: internal compiler error: tree check: expected class 'type',
have 'exceptional' (error_mark) in useless_type_conversion_p, at
gimple-expr.c:87
9 | foo (struct S *o)
  | ^~~
0x7b5b32 tree_class_check_failed(tree_node const*, tree_code_class, char
const*, int, char const*)
/repo/gcc-trunk/gcc/tree.c:8738
0x6a48da tree_class_check(tree_node*, tree_code_class, char const*, int, char
const*)
/repo/gcc-trunk/gcc/tree.h:3514
0x6a48da useless_type_conversion_p(tree_node*, tree_node*)
/repo/gcc-trunk/gcc/gimple-expr.c:87
0x1101c23 verify_gimple_assign_single
/repo/gcc-trunk/gcc/tree-cfg.c:4647
0x1101c23 verify_gimple_assign
/repo/gcc-trunk/gcc/tree-cfg.c:4716
0x1101c23 verify_gimple_stmt
/repo/gcc-trunk/gcc/tree-cfg.c:4981
0x1105a19 verify_gimple_in_cfg(function*, bool)
/repo/gcc-trunk/gcc/tree-cfg.c:5467
0xfb1a37 execute_function_todo
/repo/gcc-trunk/gcc/passes.c:2042
0xfb244e execute_todo
/repo/gcc-trunk/gcc/passes.c:2096
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

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

[Bug target/101863] New: ICE: in expand_vec_perm_broadcast_1, at config/i386/i386-expand.c:20485 with -mavx512f

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

Bug ID: 101863
   Summary: ICE: in expand_vec_perm_broadcast_1, at
config/i386/i386-expand.c:20485 with -mavx512f
   Product: gcc
   Version: 12.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 51288
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=51288&action=edit
reduced testcase

Compiler output:
$ x86_64-pc-linux-gnu-gcc -O -mavx512f testcase.c 
during GIMPLE pass: forwprop
testcase.c: In function 'foo':
testcase.c:5:1: internal compiler error: in expand_vec_perm_broadcast_1, at
config/i386/i386-expand.c:20485
5 | foo (V v)
  | ^~~
0x7ec0af expand_vec_perm_broadcast_1
/repo/gcc-trunk/gcc/config/i386/i386-expand.c:20485
0x14e662f expand_vec_perm_broadcast
/repo/gcc-trunk/gcc/config/i386/i386-expand.c:20505
0x14e662f ix86_expand_vec_perm_const_1
/repo/gcc-trunk/gcc/config/i386/i386-expand.c:20716
0x14e662f ix86_expand_vec_perm_const_1
/repo/gcc-trunk/gcc/config/i386/i386-expand.c:20699
0x150e3de ix86_vectorize_vec_perm_const(machine_mode, rtx_def*, rtx_def*,
rtx_def*, vec_perm_indices const&)
/repo/gcc-trunk/gcc/config/i386/i386-expand.c:21002
0x11e68b4 simplify_vector_constructor
/repo/gcc-trunk/gcc/tree-ssa-forwprop.c:2670
0x11e68b4 execute
/repo/gcc-trunk/gcc/tree-ssa-forwprop.c:3405
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

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

[Bug target/101845] New: wrong code at -O1 on aarch64 with __builtin_shufflevector()

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

Bug ID: 101845
   Summary: wrong code at -O1 on aarch64 with
__builtin_shufflevector()
   Product: gcc
   Version: 12.0
Status: UNCONFIRMED
  Keywords: wrong-code
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: aarch64-unknown-linux-gnu

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

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

foo:
mvniv0.2s, 0
ret

just 0x is returned


$ 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-r12-2833-20210810162020-gc318f8e42b3-checking-yes-rtl-df-extra-aarch64/bin/../libexec/gcc/aarch64-unknown-linux-gnu/12.0.0/lto-wrapper
Target: aarch64-unknown-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--with-cloog --with-ppl --with-isl
--with-sysroot=/usr/aarch64-unknown-linux-gnu --build=x86_64-pc-linux-gnu
--host=x86_64-pc-linux-gnu --target=aarch64-unknown-linux-gnu
--with-ld=/usr/bin/aarch64-unknown-linux-gnu-ld
--with-as=/usr/bin/aarch64-unknown-linux-gnu-as --disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r12-2833-20210810162020-gc318f8e42b3-checking-yes-rtl-df-extra-aarch64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 12.0.0 20210810 (experimental) (GCC)

[Bug middle-end/101642] [12 Regression] ice in decompose, at wide-int.h:984

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

--- Comment #8 from Zdenek Sojka  ---
(In reply to Jakub Jelinek from comment #7)
> I think better testcase would be
> int x;
> 
> unsigned short
> foo (void)
> {
>   return __builtin_bswap16 (x) ? : x;
> }
> because otherwise you're asking for it to be DCEd.
> 

Indeed, but when I tried this, it didn't ICE any more. (but I didn't explore
this any further)

[Bug middle-end/101642] [12 Regression] ice in decompose, at wide-int.h:984

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

Zdenek Sojka  changed:

   What|Removed |Added

 CC||zsojka at seznam dot cz

--- Comment #6 from Zdenek Sojka  ---
Even simpler testcase failing at -O1:
$ cat testcase.c
int x;

void
foo (void)
{
  __builtin_bswap16 (x) ? : x;
}
$ x86_64-pc-linux-gnu-gcc -O testcase.c 
during GIMPLE pass: fre
testcase.c: In function 'foo':
testcase.c:7:1: internal compiler error: in decompose, at wide-int.h:984
7 | }
  | ^
0x7f7b80 wi::int_traits >
>::decompose(long*, unsigned int, generic_wide_int > const&)
...

[Bug middle-end/101530] New: ICE: 'verify_gimple' failed: non-top-level 'bit_field_ref' with __builtin_shufflevector()[0]

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

Bug ID: 101530
   Summary: ICE: 'verify_gimple' failed: non-top-level
'bit_field_ref' with __builtin_shufflevector()[0]
   Product: gcc
   Version: 12.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: middle-end
  Assignee: unassigned at gcc dot gnu.org
      Reporter: zsojka at seznam dot cz
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu

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

Compiler output:
$ x86_64-pc-linux-gnu-gcc testcase.c 
testcase.c: In function 'foo':
testcase.c:4:1: error: non-top-level 'bit_field_ref'
4 | foo(V v, int i)
  | ^~~
_2 = VIEW_CONVERT_EXPR(BIT_FIELD_REF <_1, 32, 0>);
testcase.c:4:1: internal compiler error: 'verify_gimple' failed
0x10e0a2d verify_gimple_in_seq(gimple*)
/repo/gcc-trunk/gcc/tree-cfg.c:5188
0xdd0b46 gimplify_body(tree_node*, bool)
/repo/gcc-trunk/gcc/gimplify.c:15526
0xdd0ccd gimplify_function_tree(tree_node*)
/repo/gcc-trunk/gcc/gimplify.c:15597
0xbfa847 cgraph_node::analyze()
/repo/gcc-trunk/gcc/cgraphunit.c:670
0xbfd327 analyze_functions
/repo/gcc-trunk/gcc/cgraphunit.c:1234
0xbfdfcd symbol_table::finalize_compilation_unit()
/repo/gcc-trunk/gcc/cgraphunit.c:2508
Please submit a full bug report,
with preprocessed source if appropriate.
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-r12-2398-20210719103439-gf007a638a86-checking-yes-rtl-df-extra-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/12.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--with-cloog --with-ppl --with-isl --build=x86_64-pc-linux-gnu
--host=x86_64-pc-linux-gnu --target=x86_64-pc-linux-gnu
--with-ld=/usr/bin/x86_64-pc-linux-gnu-ld
--with-as=/usr/bin/x86_64-pc-linux-gnu-as --disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r12-2398-20210719103439-gf007a638a86-checking-yes-rtl-df-extra-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 12.0.0 20210719 (experimental) (GCC)

[Bug target/101529] New: wrong code with __builtin_convertvector() and __builtin_shufflevector() at -Og

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

Bug ID: 101529
   Summary: wrong code with __builtin_convertvector() and
__builtin_shufflevector() at -Og
   Product: gcc
   Version: 12.0
Status: UNCONFIRMED
  Keywords: wrong-code
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: aarch64-unknown-linux-gnu

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

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

The function just returns 0:

foo:
mov w0, 0   //,
ret

$ 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-r12-2414-20210720154202-g1ef9b135793-checking-yes-rtl-df-extra-aarch64/bin/../libexec/gcc/aarch64-unknown-linux-gnu/12.0.0/lto-wrapper
Target: aarch64-unknown-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--with-cloog --with-ppl --with-isl
--with-sysroot=/usr/aarch64-unknown-linux-gnu --build=x86_64-pc-linux-gnu
--host=x86_64-pc-linux-gnu --target=aarch64-unknown-linux-gnu
--with-ld=/usr/bin/aarch64-unknown-linux-gnu-ld
--with-as=/usr/bin/aarch64-unknown-linux-gnu-as --disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r12-2414-20210720154202-g1ef9b135793-checking-yes-rtl-df-extra-aarch64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 12.0.0 20210720 (experimental) (GCC)

[Bug target/101504] New: [12 Regression] ICE: in lra_assign, at lra-assigns.c:1649 with -O2 -march=broadwell

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

Bug ID: 101504
   Summary: [12 Regression] ICE: in lra_assign, at
lra-assigns.c:1649 with -O2 -march=broadwell
   Product: gcc
   Version: 12.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 51170
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=51170&action=edit
reduced testcase

Compiler output:
$ x86_64-pc-linux-gnu-gcc -O2 -march=broadwell testcase.c 
during RTL pass: reload
testcase.c: In function 'foo':
testcase.c:18:1: internal compiler error: in lra_assign, at lra-assigns.c:1649
   18 | }
  | ^
0xee2b8b lra_assign(bool&)
/repo/gcc-trunk/gcc/lra-assigns.c:1649
0xedce4c lra(_IO_FILE*)
/repo/gcc-trunk/gcc/lra.c:2387
0xe8ec59 do_reload
/repo/gcc-trunk/gcc/ira.c:5932
0xe8ec59 execute
/repo/gcc-trunk/gcc/ira.c:6118
Please submit a full bug report,
with preprocessed source if appropriate.
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-r12-2388-20210719001624-gbdea84c4b57-checking-yes-rtl-df-extra-nobootstrap-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/12.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--disable-bootstrap --with-cloog --with-ppl --with-isl
--build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu
--target=x86_64-pc-linux-gnu --with-ld=/usr/bin/x86_64-pc-linux-gnu-ld
--with-as=/usr/bin/x86_64-pc-linux-gnu-as --disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r12-2388-20210719001624-gbdea84c4b57-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 12.0.0 20210719 (experimental) (GCC)

[Bug tree-optimization/101403] [12 Regression] wrong code with __builtin_bswap16() at -O1 by r12-2137

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

--- Comment #5 from Zdenek Sojka  ---
(In reply to Jakub Jelinek from comment #4)
> Isn't the testcase UB? It reads uninitialized u (though it doesn't use the
> value for anything).

You are very right about that! The value is used, even though the use is
optimised out.
I am using -fsanitize=undefined when reducing testcases, but this one wasn't
caught. The only warning I see with -Wall -W is "warning: left-hand operand of
comma expression has no effect [-Wunused-value]". valgrind also doesn't
complain because, obviously, the uninitialised read is optimised out.

[Bug target/101403] New: [12 Regression] wrong code with __builtin_bswap16() at -O1

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

Bug ID: 101403
   Summary: [12 Regression] wrong code with __builtin_bswap16() at
-O1
   Product: gcc
   Version: 12.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 51129
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=51129&action=edit
reduced testcase

$ 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-r12-2234-20210709194853-g1798cac7a8b-checking-yes-rtl-df-extra-nobootstrap-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/12.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--disable-bootstrap --with-cloog --with-ppl --with-isl
--build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu
--target=x86_64-pc-linux-gnu --with-ld=/usr/bin/x86_64-pc-linux-gnu-ld
--with-as=/usr/bin/x86_64-pc-linux-gnu-as --disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r12-2234-20210709194853-g1798cac7a8b-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 12.0.0 20210710 (experimental) (GCC)

[Bug target/101384] New: wrong code at -Og and above with vector shift/multiply

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

Bug ID: 101384
   Summary: wrong code at -Og and above with vector shift/multiply
   Product: gcc
   Version: 12.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: powerpc64le-unknown-linux-gnu

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

Output:
$ powerpc64le-unknown-linux-gnu-gcc -Og testcase.c -Wno-psabi -static
$ qemu-ppc64le -- ./a.out 
qemu: uncaught target signal 6 (Aborted) - core dumped
Aborted

The vector is:
80808080808080808080808080808080
instead of
80ff80ff80ff80ff

 # testcase.c:13: }
vspltisw 0,-1# tmp121
vslb 0,0,0   # tmp121, tmp121, tmp121

looks strange, but simply replacing vslb->vslw doesn't help, as another operand
with 7s for the shift would be needed

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

[Bug target/101345] New: wrong code at -O1 with vector modulo

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

Bug ID: 101345
   Summary: wrong code at -O1 with vector modulo
   Product: gcc
   Version: 12.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: powerpc64le-unknown-linux-gnu

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

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

The value is 0x2828282828282828 instead of 0x1414141414141414
Already the computed value of "y" is wrong.

subfic 10,10,4   # tmp160, tmp159,

looks wrong, if replaced by

subfic 10,10,2   # tmp160, tmp159,

the code works correctly

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

[Bug target/101294] New: [12 Regression] ICE: in maybe_legitimize_operand, at optabs.c:7614 with -mavx

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

Bug ID: 101294
   Summary: [12 Regression] ICE: in maybe_legitimize_operand, at
optabs.c:7614 with -mavx
   Product: gcc
   Version: 12.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 51101
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=51101&action=edit
reduced testcase

Compiler output:
$ x86_64-pc-linux-gnu-gcc -mavx testcase.c 
during RTL pass: expand
testcase.c: In function 'foo':
testcase.c:7:3: internal compiler error: in maybe_legitimize_operand, at
optabs.c:7614
7 |   __builtin_shufflevector ((U){}, (V){}, 3);
  |   ^~~
0x6f80cd maybe_legitimize_operand
/repo/gcc-trunk/gcc/optabs.c:7614
0x6f80cd maybe_legitimize_operands(insn_code, unsigned int, unsigned int,
expand_operand*)
/repo/gcc-trunk/gcc/optabs.c:7751
0xf562c9 maybe_gen_insn(insn_code, unsigned int, expand_operand*)
/repo/gcc-trunk/gcc/optabs.c:7770
0xf63f68 maybe_expand_insn(insn_code, unsigned int, expand_operand*)
/repo/gcc-trunk/gcc/optabs.c:7813
0xf63f68 expand_insn(insn_code, unsigned int, expand_operand*)
/repo/gcc-trunk/gcc/optabs.c:7844
0xcfc2ab store_constructor
/repo/gcc-trunk/gcc/expr.c:7086
0xcfd995 expand_constructor
/repo/gcc-trunk/gcc/expr.c:8563
0xce9e8a expand_expr_real_1(tree_node*, rtx_def*, machine_mode,
expand_modifier, rtx_def**, bool)
/repo/gcc-trunk/gcc/expr.c:10748
0xcf71cc store_expr(tree_node*, rtx_def*, int, bool, bool)
/repo/gcc-trunk/gcc/expr.c:5994
0xcf898d expand_assignment(tree_node*, tree_node*, bool)
/repo/gcc-trunk/gcc/expr.c:5729
0xbb1377 expand_gimple_stmt_1
/repo/gcc-trunk/gcc/cfgexpand.c:3943
0xbb1377 expand_gimple_stmt
/repo/gcc-trunk/gcc/cfgexpand.c:4041
0xbb7b8b expand_gimple_basic_block
/repo/gcc-trunk/gcc/cfgexpand.c:6083
0xbb9ab7 execute
/repo/gcc-trunk/gcc/cfgexpand.c:6809
Please submit a full bug report,
with preprocessed source if appropriate.
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-r12-1975-20210702102426-g496e1d6a1f9-checking-yes-rtl-df-extra-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/12.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--with-cloog --with-ppl --with-isl --build=x86_64-pc-linux-gnu
--host=x86_64-pc-linux-gnu --target=x86_64-pc-linux-gnu
--with-ld=/usr/bin/x86_64-pc-linux-gnu-ld
--with-as=/usr/bin/x86_64-pc-linux-gnu-as --disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r12-1975-20210702102426-g496e1d6a1f9-checking-yes-rtl-df-extra-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 12.0.0 20210702 (experimental) (GCC)

[Bug target/101286] New: [12 Regression] ICE: in ix86_expand_vector_move, at config/i386/i386-expand.c:574 with -mavx2 and __int128 vector

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

Bug ID: 101286
   Summary: [12 Regression] ICE: in ix86_expand_vector_move, at
config/i386/i386-expand.c:574 with -mavx2 and __int128
vector
   Product: gcc
   Version: 12.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 51096
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=51096&action=edit
reduced testcase

Compiler output:
$ x86_64-pc-linux-gnu-gcc -mavx2 testcase.c 
during RTL pass: expand
testcase.c: In function 'foo':
testcase.c:6:6: internal compiler error: in ix86_expand_vector_move, at
config/i386/i386-expand.c:574
6 |   (V){(__int128) 1 << 64 | 1, (__int128) 1 << 64 | 1};
  |  ^
0x7f27cf ix86_expand_vector_move(machine_mode, rtx_def**)
/repo/gcc-trunk/gcc/config/i386/i386-expand.c:574
0x1898c88 gen_movv2ti(rtx_def*, rtx_def*)
/repo/gcc-trunk/gcc/config/i386/sse.md:1043
0xcf7da7 rtx_insn* insn_gen_fn::operator()(rtx_def*,
rtx_def*) const
/repo/gcc-trunk/gcc/recog.h:407
0xcf7da7 emit_move_insn_1(rtx_def*, rtx_def*)
/repo/gcc-trunk/gcc/expr.c:3865
0xcf81f5 emit_move_insn(rtx_def*, rtx_def*)
/repo/gcc-trunk/gcc/expr.c:4035
0xd01f88 store_expr(tree_node*, rtx_def*, int, bool, bool)
/repo/gcc-trunk/gcc/expr.c:6180
0xd02d8e expand_assignment(tree_node*, tree_node*, bool)
/repo/gcc-trunk/gcc/expr.c:5729
0xbb952b expand_gimple_stmt_1
/repo/gcc-trunk/gcc/cfgexpand.c:3943
0xbb952b expand_gimple_stmt
/repo/gcc-trunk/gcc/cfgexpand.c:4041
0xbbfcfa expand_gimple_basic_block
/repo/gcc-trunk/gcc/cfgexpand.c:6083
0xbc19a7 execute
/repo/gcc-trunk/gcc/cfgexpand.c:6809
Please submit a full bug report,
with preprocessed source if appropriate.
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-r12-1965-20210701145532-gb97486f465f-checking-yes-rtl-df-extra-nobootstrap-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/12.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--disable-bootstrap --with-cloog --with-ppl --with-isl
--build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu
--target=x86_64-pc-linux-gnu --with-ld=/usr/bin/x86_64-pc-linux-gnu-ld
--with-as=/usr/bin/x86_64-pc-linux-gnu-as --disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r12-1965-20210701145532-gb97486f465f-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 12.0.0 20210701 (experimental) (GCC)

[Bug tree-optimization/101161] New: [12 Regression] ICE: SIGSEGV in tree_class_check at -O3 during GIMPLE pass: slp

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

Bug ID: 101161
   Summary: [12 Regression] ICE: SIGSEGV in tree_class_check at
-O3 during GIMPLE pass: slp
   Product: gcc
   Version: 12.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

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

Compiler output:
$ x86_64-pc-linux-gnu-gcc -O3 testcase.c -wrapper valgrind,-q
==5080== Invalid read of size 2
==5080==at 0xDE26C2: tree_class_check (tree.h:3493)
==5080==by 0xDE26C2: direct_optab_supported_p(optab_tag,
std::pair, optimization_type) (internal-fn.c:3533)
==5080==by 0x1CCD7FE: vect_recog_popcount_pattern(vec_info*,
_stmt_vec_info*, tree_node**) (tree-vect-patterns.c:1388)
==5080==by 0x1CD088A: vect_pattern_recog_1(vec_info*, vect_recog_func*,
_stmt_vec_info*) (tree-vect-patterns.c:5584)
==5080==by 0x1CD7661: vect_pattern_recog(vec_info*)
(tree-vect-patterns.c:5742)
==5080==by 0x1340443: vect_slp_analyze_bb_1 (tree-vect-slp.c:5561)
==5080==by 0x1340443: vect_slp_region (tree-vect-slp.c:5669)
==5080==by 0x1340443: vect_slp_bbs(vec)
(tree-vect-slp.c:5819)
==5080==by 0x1342464: vect_slp_function(function*) (tree-vect-slp.c:5905)
==5080==by 0x1348982: (anonymous
namespace)::pass_slp_vectorize::execute(function*) (tree-vectorizer.c:1445)
==5080==by 0xF8EDC7: execute_one_pass(opt_pass*) (passes.c:2567)
==5080==by 0xF8F72F: execute_pass_list_1(opt_pass*) (passes.c:2656)
==5080==by 0xF8F741: execute_pass_list_1(opt_pass*) (passes.c:2657)
==5080==by 0xF8F741: execute_pass_list_1(opt_pass*) (passes.c:2657)
==5080==by 0xF8F768: execute_pass_list(function*, opt_pass*)
(passes.c:2667)
==5080==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==5080== 
during GIMPLE pass: slp
testcase.c: In function 'foo':
testcase.c:4:1: internal compiler error: Segmentation fault
4 | foo (__int128 i)
  | ^~~
0x108adbf crash_signal
/repo/gcc-trunk/gcc/toplev.c:327
0xde26c2 tree_class_check(tree_node*, tree_code_class, char const*, int, char
const*)
/repo/gcc-trunk/gcc/tree.h:3493
0xde26c2 direct_optab_supported_p
/repo/gcc-trunk/gcc/internal-fn.c:3533
0x1ccd7fe vect_recog_popcount_pattern
/repo/gcc-trunk/gcc/tree-vect-patterns.c:1388
0x1cd088a vect_pattern_recog_1
/repo/gcc-trunk/gcc/tree-vect-patterns.c:5584
0x1cd7661 vect_pattern_recog(vec_info*)
/repo/gcc-trunk/gcc/tree-vect-patterns.c:5742
0x1340443 vect_slp_analyze_bb_1
/repo/gcc-trunk/gcc/tree-vect-slp.c:5561
0x1340443 vect_slp_region
/repo/gcc-trunk/gcc/tree-vect-slp.c:5669
0x1340443 vect_slp_bbs
/repo/gcc-trunk/gcc/tree-vect-slp.c:5819
0x1342464 vect_slp_function(function*)
/repo/gcc-trunk/gcc/tree-vect-slp.c:5905
0x1348982 execute
/repo/gcc-trunk/gcc/tree-vectorizer.c:1445
Please submit a full bug report,
with preprocessed source if appropriate.
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-r12-1707-20210622104011-ge08a125b208-checking-yes-rtl-df-extra-nobootstrap-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/12.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--disable-bootstrap --with-cloog --with-ppl --with-isl
--build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu
--target=x86_64-pc-linux-gnu --with-ld=/usr/bin/x86_64-pc-linux-gnu-ld
--with-as=/usr/bin/x86_64-pc-linux-gnu-as --disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r12-1707-20210622104011-ge08a125b208-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 12.0.0 20210622 (experimental) (GCC)

[Bug rtl-optimization/101129] New: [11/12 Regression] wrong code at -O1

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

Bug ID: 101129
   Summary: [11/12 Regression] wrong code at -O1
   Product: gcc
   Version: 12.0
Status: UNCONFIRMED
  Keywords: wrong-code
  Severity: normal
  Priority: P3
 Component: rtl-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: powerpc64le-unknown-linux-gnu

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

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


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

[Bug target/101046] New: ICE: in gen_rtx_CONST_VECTOR, at emit-rtl.c:6031 with -mavx512vbmi -mavx512vl

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

Bug ID: 101046
   Summary: ICE: in gen_rtx_CONST_VECTOR, at emit-rtl.c:6031 with
-mavx512vbmi -mavx512vl
   Product: gcc
   Version: 12.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 50990
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=50990&action=edit
reduced testcase

Compiler output:
$ x86_64-pc-linux-gnu-gcc -ftree-ter -mavx512vbmi -mavx512vl testcase.c
during RTL pass: expand
testcase.c: In function 'foo':
testcase.c:6:10: internal compiler error: in gen_rtx_CONST_VECTOR, at
emit-rtl.c:6031
6 |   return __builtin_convertvector(
  |  ^~~~
7 |  __builtin_shufflevector((V){}, (W){}, 0, 0, 1, 0, 5, 5, 0, 2),
  |  ~~
8 |  U);
  |  ~~
0x672322 gen_rtx_CONST_VECTOR(machine_mode, rtvec_def*)
/repo/gcc-trunk/gcc/emit-rtl.c:6031
0x149c4b9 ix86_expand_vec_perm_vpermt2
/repo/gcc-trunk/gcc/config/i386/i386-expand.c:4669
0x14a64be expand_vec_perm_1
/repo/gcc-trunk/gcc/config/i386/i386-expand.c:17902
0x14a8d68 ix86_expand_vec_perm_const_1
/repo/gcc-trunk/gcc/config/i386/i386-expand.c:20202
0x14d18e5 ix86_vectorize_vec_perm_const(machine_mode, rtx_def*, rtx_def*,
rtx_def*, vec_perm_indices const&)
/repo/gcc-trunk/gcc/config/i386/i386-expand.c:20529
0xf55cea expand_vec_perm_const(machine_mode, rtx_def*, rtx_def*,
int_vector_builder > const&, machine_mode, rtx_def*)
/repo/gcc-trunk/gcc/optabs.c:6069
0xcdc158 expand_expr_real_2(separate_ops*, rtx_def*, machine_mode,
expand_modifier)
/repo/gcc-trunk/gcc/expr.c:10046
0xce083a expand_expr_real_1(tree_node*, rtx_def*, machine_mode,
expand_modifier, rtx_def**, bool)
/repo/gcc-trunk/gcc/expr.c:10399
0xceaf34 expand_expr
/repo/gcc-trunk/gcc/expr.h:301
0xceaf34 expand_operands(tree_node*, tree_node*, rtx_def*, rtx_def**,
rtx_def**, expand_modifier)
/repo/gcc-trunk/gcc/expr.c:8212
0xcd8dff expand_expr_real_2(separate_ops*, rtx_def*, machine_mode,
expand_modifier)
/repo/gcc-trunk/gcc/expr.c:10189
0xba6b4f expand_gimple_stmt_1
/repo/gcc-trunk/gcc/cfgexpand.c:3953
0xba6b4f expand_gimple_stmt
/repo/gcc-trunk/gcc/cfgexpand.c:4014
0xbacd3a expand_gimple_basic_block
/repo/gcc-trunk/gcc/cfgexpand.c:6056
0xbae9e7 execute
/repo/gcc-trunk/gcc/cfgexpand.c:6782
Please submit a full bug report,
with preprocessed source if appropriate.
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-r12-1408-20210613074654-gd554f43c98e-checking-yes-rtl-df-extra-nobootstrap-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/12.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--disable-bootstrap --with-cloog --with-ppl --with-isl
--build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu
--target=x86_64-pc-linux-gnu --with-ld=/usr/bin/x86_64-pc-linux-gnu-ld
--with-as=/usr/bin/x86_64-pc-linux-gnu-as --disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r12-1408-20210613074654-gd554f43c98e-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 12.0.0 20210613 (experimental) (GCC)

[Bug target/101023] [11/12 Regression] wrong code with -mstackrealign

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

--- Comment #5 from Zdenek Sojka  ---
(In reply to Jakub Jelinek from comment #3)
> Here it is:
> 

Thank you, I probably wouldn't be able to get back to this until next week.

[Bug target/101023] New: [11/12 Regression] wrong code with -mstackrealign

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

Bug ID: 101023
   Summary: [11/12 Regression] wrong code with -mstackrealign
   Product: gcc
   Version: 12.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 50981
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=50981&action=edit
auto-reduced testcase (from OpenTTD sources)

Compiler output:
$ x86_64-pc-linux-gnu-g++ -O2 -mtune=opteron -mstackrealign
--param=hot-bb-frequency-fraction=1 testcase.C -S

The offending code is:
.L8:
pushq   %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
movq%rsp, %rbp
.cfi_def_cfa_register 6
movq%r12, -8(%rbp)
pushq   %rax

the "push" overwrites r12 stored just one instruction above; when returning:
movq-8(%rbp), %r12
xorl%eax, %eax
leave
.cfi_def_cfa 7, 8
ret

the wrong data is restored to r12

I wasn't able yet to generate an executable testcase, but I can try to if
needed. (it shouldn't be that hard, just r12 needs to be used by the caller
during the call)

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

[Bug rtl-optimization/101008] New: ICE: in native_encode_rtx, at simplify-rtx.c:6594 with -O -g

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

Bug ID: 101008
   Summary: ICE: in native_encode_rtx, at simplify-rtx.c:6594 with
-O -g
   Product: gcc
   Version: 12.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: rtl-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu

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

Compiler output:
$ x86_64-pc-linux-gnu-gcc -O -g testcase.c 
during RTL pass: expand
testcase.c: In function 'foo':
testcase.c:9:1: internal compiler error: in native_encode_rtx, at
simplify-rtx.c:6594
9 | foo(void)
  | ^~~
0x723dc0 native_encode_rtx(machine_mode, rtx_def*, vec&, unsigned int, unsigned int)
/repo/gcc-trunk/gcc/simplify-rtx.c:6594
0x1065220 simplify_immed_subreg
/repo/gcc-trunk/gcc/simplify-rtx.c:7034
0x1065220 simplify_context::simplify_subreg(machine_mode, rtx_def*,
machine_mode, poly_int<1u, unsigned long>)
/repo/gcc-trunk/gcc/simplify-rtx.c:7110
0x1066499 simplify_context::simplify_gen_subreg(machine_mode, rtx_def*,
machine_mode, poly_int<1u, unsigned long>)
/repo/gcc-trunk/gcc/simplify-rtx.c:7334
0xba5f1a simplify_gen_subreg(machine_mode, rtx_def*, machine_mode, poly_int<1u,
unsigned long>)
/repo/gcc-trunk/gcc/rtl.h:3519
0xba5f1a expand_debug_expr
/repo/gcc-trunk/gcc/cfgexpand.c:4823
0xba3d49 expand_debug_expr
/repo/gcc-trunk/gcc/cfgexpand.c:5279
0xba3a54 expand_debug_expr
/repo/gcc-trunk/gcc/cfgexpand.c:5238
0xba75f9 expand_debug_locations
/repo/gcc-trunk/gcc/cfgexpand.c:5616
0xbafbdc execute
/repo/gcc-trunk/gcc/cfgexpand.c:6785
Please submit a full bug report,
with preprocessed source if appropriate.
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-r12-1353-20210609220850-gf8b067056ba-checking-yes-rtl-df-extra-nobootstrap-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/12.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--disable-bootstrap --with-cloog --with-ppl --with-isl
--build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu
--target=x86_64-pc-linux-gnu --with-ld=/usr/bin/x86_64-pc-linux-gnu-ld
--with-as=/usr/bin/x86_64-pc-linux-gnu-as --disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r12-1353-20210609220850-gf8b067056ba-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 12.0.0 20210610 (experimental) (GCC)

[Bug target/101007] New: ICE: in extract_insn, at recog.c:2770 (unrecognizable insn) with -mno-sse2

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

Bug ID: 101007
   Summary: ICE: in extract_insn, at recog.c:2770 (unrecognizable
insn) with -mno-sse2
   Product: gcc
   Version: 12.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 50974
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=50974&action=edit
reduced testcase

Compiler output:
$ x86_64-pc-linux-gnu-gcc -O -mno-sse2 testcase.c
testcase.c: In function 'foo':
testcase.c:10:1: error: unrecognizable insn:
   10 | }
  | ^
(insn 14 7 9 2 (set (reg:V4SI 89)
(vec_concat:V4SI (mem/c:V2SI (symbol_ref:DI ("v") [flags 0x2] ) [1 v+0 S8 A128])
(const_vector:V2SI [
(const_int 0 [0]) repeated x2
]))) "testcase.c":9:12 -1
 (nil))
during RTL pass: ira
testcase.c:10:1: internal compiler error: in extract_insn, at recog.c:2770
0x71519c _fatal_insn(char const*, rtx_def const*, char const*, int, char
const*)
/repo/gcc-trunk/gcc/rtl-error.c:108
0x71521f _fatal_insn_not_found(rtx_def const*, char const*, int, char const*)
/repo/gcc-trunk/gcc/rtl-error.c:116
0x70394a extract_insn(rtx_insn*)
/repo/gcc-trunk/gcc/recog.c:2770
0xe75c70 ira_remove_insn_scratches(rtx_insn*, bool, _IO_FILE*, rtx_def*
(*)(rtx_def*))
/repo/gcc-trunk/gcc/ira.c:5238
0xe789e5 remove_scratches
/repo/gcc-trunk/gcc/ira.c:5282
0xe789e5 ira
/repo/gcc-trunk/gcc/ira.c:5606
0xe789e5 execute
/repo/gcc-trunk/gcc/ira.c:5965
Please submit a full bug report,
with preprocessed source if appropriate.
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-r12-1353-20210609220850-gf8b067056ba-checking-yes-rtl-df-extra-nobootstrap-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/12.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--disable-bootstrap --with-cloog --with-ppl --with-isl
--build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu
--target=x86_64-pc-linux-gnu --with-ld=/usr/bin/x86_64-pc-linux-gnu-ld
--with-as=/usr/bin/x86_64-pc-linux-gnu-as --disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r12-1353-20210609220850-gf8b067056ba-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 12.0.0 20210610 (experimental) (GCC)

[Bug rtl-optimization/100978] New: [10/11/12 Regression] ICE: qsort checking failed: qsort comparator non-negative on sorted output: 1 with -O3 -frename-registers -fno-sched-critical-path-heuristic -f

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

Bug ID: 100978
   Summary: [10/11/12 Regression] ICE: qsort checking failed:
qsort comparator non-negative on sorted output: 1 with
-O3 -frename-registers
-fno-sched-critical-path-heuristic
-fsched2-use-superblocks
   Product: gcc
   Version: 12.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: rtl-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu

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

Compiler output:
$ x86_64-pc-linux-gnu-gcc -O3 -frename-registers
-fno-sched-critical-path-heuristic -fsched2-use-superblocks testcase.c 
testcase.c: In function 'foo':
testcase.c:21:1: error: qsort comparator non-negative on sorted output: 1
   21 | }
  | ^
during RTL pass: sched2
testcase.c:21:1: internal compiler error: qsort checking failed
0xa1bf87 qsort_chk_error
/repo/gcc-trunk/gcc/vec.c:214
0xa1c093 qsort_chk(void*, unsigned long, unsigned long, int (*)(void const*,
void const*, void*), void*)
/repo/gcc-trunk/gcc/vec.c:256
0x1d79fb5 gcc_qsort(void*, unsigned long, unsigned long, int (*)(void const*,
void const*))
/repo/gcc-trunk/gcc/sort.cc:270
0x1bd83c0 ready_sort_real
/repo/gcc-trunk/gcc/haifa-sched.c:3095
0x1be09c5 ready_sort
/repo/gcc-trunk/gcc/haifa-sched.c:3111
0x1be09c5 schedule_block(basic_block_def**, void*)
/repo/gcc-trunk/gcc/haifa-sched.c:6709
0x1cb32ab schedule_ebb(rtx_insn*, rtx_insn*, bool)
/repo/gcc-trunk/gcc/sched-ebb.c:536
0x1cb39d2 schedule_ebbs()
/repo/gcc-trunk/gcc/sched-ebb.c:655
0x1015b2c rest_of_handle_sched2
/repo/gcc-trunk/gcc/sched-rgn.c:3740
0x1015b2c execute
/repo/gcc-trunk/gcc/sched-rgn.c:3878
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

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

[Bug target/43526] ICE: in construct_container, at config/i386/i386.c:5733 with -m96bit-long-double at x86_64-linux

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

Zdenek Sojka  changed:

   What|Removed |Added

  Known to work||12.0
  Known to fail||

--- Comment #6 from Zdenek Sojka  ---
Since r12-94 (PR100041 fix), -m96bit-long-double is rejected for this target.

[Bug target/100941] wrong code with __builtin_shufflevector() with -mavx512f

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

--- Comment #3 from Zdenek Sojka  ---
(In reply to Zdenek Sojka from comment #2)
> (In reply to Hongtao.liu from comment #1)
> > The issue seems to be related to generic part, not target specific
> > 
> > 006t.gimple
> > 
> > U foo (V v, W w)
> > {
> >   U D.2852;
> > 
> >   _1 = {v, { 0, 0, 0, 0 }};
> >   _2 = BIT_INSERT_EXPR <_1, { 0, 0, 0, 0 }, 0>; <--- why bit position is 0
> > but not 256?
> >   D.2852 = BIT_FIELD_REF <_2, 64, 0>;
> >   return D.2852;
> > }
> 
> Thank you for having a look.
> I will re-check with the PR100887 fix applied.

No longer fails with r12-1256 , so perhaps fixed by the other PR100887 fix.

[Bug target/100941] wrong code with __builtin_shufflevector() with -mavx512f

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

--- Comment #2 from Zdenek Sojka  ---
(In reply to Hongtao.liu from comment #1)
> The issue seems to be related to generic part, not target specific
> 
> 006t.gimple
> 
> U foo (V v, W w)
> {
>   U D.2852;
> 
>   _1 = {v, { 0, 0, 0, 0 }};
>   _2 = BIT_INSERT_EXPR <_1, { 0, 0, 0, 0 }, 0>; <--- why bit position is 0
> but not 256?
>   D.2852 = BIT_FIELD_REF <_2, 64, 0>;
>   return D.2852;
> }

Thank you for having a look.
I will re-check with the PR100887 fix applied.

[Bug target/100941] New: wrong code with __builtin_shufflevector() with -mavx512f

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

Bug ID: 100941
   Summary: wrong code with __builtin_shufflevector() with
-mavx512f
   Product: gcc
   Version: 12.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 50957
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=50957&action=edit
reduced testcase

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

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

[Bug target/100887] [12 Regression] ICE: in ix86_expand_vector_init_concat, at config/i386/i386-expand.c:14178 with -mavx512f and __builtin_shufflevector()

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

--- Comment #6 from Zdenek Sojka  ---
(In reply to Jakub Jelinek from comment #5)
> Created attachment 50919 [details]
> gcc12-pr100887.patch
> 
> Untested fix.

Thank you for the patch. So the testcase from c#3 might be unrelated.

[Bug target/100887] [12 Regression] ICE: in ix86_expand_vector_init_concat, at config/i386/i386-expand.c:14178 with -mavx512f and __builtin_shufflevector()

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

--- Comment #4 from Zdenek Sojka  ---
(In reply to Jakub Jelinek from comment #1)
> ICEs since r12-1128-gef8176e0fac935c095cc39f4ecdfd43cdb8cb3f3

That is when __builtin_shufflevector() was introduced.

[Bug target/100887] [12 Regression] ICE: in ix86_expand_vector_init_concat, at config/i386/i386-expand.c:14178 with -mavx512f and __builtin_shufflevector()

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

--- Comment #3 from Zdenek Sojka  ---
Probably related issue:

$ cat testcase.c
typedef unsigned long long __attribute__((__vector_size__ (16))) U;
typedef unsigned long long __attribute__((__vector_size__ (32))) V;
typedef unsigned long long __attribute__((__vector_size__ (64))) W;

U
foo (V v)
{
  return __builtin_shufflevector ((W){}, v, 0, 8);
}

$ x86_64-pc-linux-gnu-gcc -mavx512f testcase.c 
testcase.c: In function 'foo':
testcase.c:6:1: error: not allowed type combination in 'bit_insert_expr'
6 | foo (V v)
  | ^~~
W
V
_2 = BIT_INSERT_EXPR <{ 0, 0, 0, 0, 0, 0, 0, 0 }, v, 64>;
testcase.c:6:1: internal compiler error: 'verify_gimple' failed
0x10b85ad verify_gimple_in_seq(gimple*)
/repo/gcc-trunk/gcc/tree-cfg.c:5161
0xdaf5e6 gimplify_body(tree_node*, bool)
/repo/gcc-trunk/gcc/gimplify.c:15404
0xdaf75d gimplify_function_tree(tree_node*)
/repo/gcc-trunk/gcc/gimplify.c:15475
0xbd9127 cgraph_node::analyze()
/repo/gcc-trunk/gcc/cgraphunit.c:670
0xbdbc57 analyze_functions
/repo/gcc-trunk/gcc/cgraphunit.c:1234
0xbdc8ed symbol_table::finalize_compilation_unit()
/repo/gcc-trunk/gcc/cgraphunit.c:2508
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See  for instructions.

[Bug target/100887] New: [12 Regression] ICE: in ix86_expand_vector_init_concat, at config/i386/i386-expand.c:14178 with -mavx512f and __builtin_shufflevector()

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

Bug ID: 100887
   Summary: [12 Regression] ICE: in
ix86_expand_vector_init_concat, at
config/i386/i386-expand.c:14178 with -mavx512f and
__builtin_shufflevector()
   Product: gcc
   Version: 12.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 50913
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=50913&action=edit
reduced testcase

Compiler output:
$ x86_64-pc-linux-gnu-gcc -mavx512f testcase.c 
during RTL pass: expand
testcase.c: In function 'foo':
testcase.c:6:3: internal compiler error: in ix86_expand_vector_init_concat, at
config/i386/i386-expand.c:14178
6 |   __builtin_shufflevector (u, v, 0);
  |   ^~~
0x7ddb42 ix86_expand_vector_init_concat
/repo/gcc-trunk/gcc/config/i386/i386-expand.c:14178
0x149cf87 ix86_expand_vector_init(bool, rtx_def*, rtx_def*)
/repo/gcc-trunk/gcc/config/i386/i386-expand.c:14622
0x18c32ee ???
/repo/gcc-trunk/gcc/config/i386/sse.md:22289
0xce0ba6 rtx_insn* insn_gen_fn::operator()(rtx_def*,
rtx_def*) const
/repo/gcc-trunk/gcc/recog.h:407
0xce0ba6 store_constructor
/repo/gcc-trunk/gcc/expr.c:7217
0xce2645 expand_constructor
/repo/gcc-trunk/gcc/expr.c:8555
0xccea3a expand_expr_real_1(tree_node*, rtx_def*, machine_mode,
expand_modifier, rtx_def**, bool)
/repo/gcc-trunk/gcc/expr.c:10738
0xcdbe6c store_expr(tree_node*, rtx_def*, int, bool, bool)
/repo/gcc-trunk/gcc/expr.c:5986
0xcdd62d expand_assignment(tree_node*, tree_node*, bool)
/repo/gcc-trunk/gcc/expr.c:5721
0xb97ef1 expand_gimple_stmt_1
/repo/gcc-trunk/gcc/cfgexpand.c:3916
0xb97ef1 expand_gimple_stmt
/repo/gcc-trunk/gcc/cfgexpand.c:4014
0xb9e79b expand_gimple_basic_block
/repo/gcc-trunk/gcc/cfgexpand.c:6056
0xba06c7 execute
/repo/gcc-trunk/gcc/cfgexpand.c:6782
Please submit a full bug report,
with preprocessed source if appropriate.
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-r12-1164-20210602094549-g659cc7d6320-checking-yes-rtl-df-extra-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/12.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--with-cloog --with-ppl --with-isl --build=x86_64-pc-linux-gnu
--host=x86_64-pc-linux-gnu --target=x86_64-pc-linux-gnu
--with-ld=/usr/bin/x86_64-pc-linux-gnu-ld
--with-as=/usr/bin/x86_64-pc-linux-gnu-as --disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r12-1164-20210602094549-g659cc7d6320-checking-yes-rtl-df-extra-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 12.0.0 20210602 (experimental) (GCC)

[Bug target/100885] New: [12 Regression] ICE: in extract_constrain_insn, at recog.c:2671: insn does not satisfy its constraints: {sse4_1_zero_extendv8qiv8hi2}

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

Bug ID: 100885
   Summary: [12 Regression] ICE: in extract_constrain_insn, at
recog.c:2671: insn does not satisfy its constraints:
{sse4_1_zero_extendv8qiv8hi2}
   Product: gcc
   Version: 12.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 50912
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=50912&action=edit
auto-reduced testcase (from OpenTTD sources)

Compiler output:
$ x86_64-pc-linux-gnu-gcc -O2 -mavx512vl testcase.C
testcase.C: In instantiation of 'void Blitter_32bppSSE4_Anim::Draw(const
Blitter::BlitterParams*, ZoomLevel) [with BlitterMode  =
BM_COLOUR_REMAP; Blitter_32bppSSE_Base::ReadMode  =
Blitter_32bppSSE_Base::RM_WITH_MARGIN; Blitter_32bppSSE_Base::BlockType
 = Blitter_32bppSSE_Base::BT_NONE; bool  = true; bool
 = false]':
testcase.C:154:62:   required from here
testcase.C:120:27: warning: cast to pointer from integer of different size
[-Wint-to-pointer-cast]
  120 |   Colour *src_rgba_line = (Colour *)sd->data;
  |   ^~
testcase.C:130:19: warning: cast to pointer from integer of different size
[-Wint-to-pointer-cast]
  130 |   int mvX2 = *(unsigned *)sd->infos[zoom], m = byte(mvX2);
  |   ^~~
testcase.C: In member function 'void Blitter_32bppSSE4_Anim::Draw(const
Blitter::BlitterParams*, ZoomLevel) [with BlitterMode  =
BM_COLOUR_REMAP; Blitter_32bppSSE_Base::ReadMode  =
Blitter_32bppSSE_Base::RM_WITH_MARGIN; Blitter_32bppSSE_Base::BlockType
 = Blitter_32bppSSE_Base::BT_NONE; bool  = true; bool
 = false]':
testcase.C:150:1: error: insn does not satisfy its constraints:
  150 | }
  | ^
(insn 295 221 134 12 (set (reg:V8HI 22 xmm2 [230])
(zero_extend:V8HI (vec_select:V8QI (reg:V16QI 52 xmm16 [orig:134
__trans_tmp_5 ] [134])
(parallel [
(const_int 0 [0])
(const_int 1 [0x1])
(const_int 2 [0x2])
(const_int 3 [0x3])
(const_int 4 [0x4])
(const_int 5 [0x5])
(const_int 6 [0x6])
(const_int 7 [0x7])
] "testcase.C":49:46 4653 {sse4_1_zero_extendv8qiv8hi2}
 (expr_list:REG_DEAD (reg:V16QI 52 xmm16 [orig:134 __trans_tmp_5 ] [134])
(nil)))
during RTL pass: cprop_hardreg
testcase.C:150:1: internal compiler error: in extract_constrain_insn, at
recog.c:2671
0x7ece3a _fatal_insn(char const*, rtx_def const*, char const*, int, char
const*)
/repo/gcc-trunk/gcc/rtl-error.c:108
0x7ecec7 _fatal_insn_not_found(rtx_def const*, char const*, int, char const*)
/repo/gcc-trunk/gcc/rtl-error.c:118
0x7dbaaf extract_constrain_insn(rtx_insn*)
/repo/gcc-trunk/gcc/recog.c:2671
0x1292534 copyprop_hardreg_forward_1
/repo/gcc-trunk/gcc/regcprop.c:825
0x129383e execute
/repo/gcc-trunk/gcc/regcprop.c:1390
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

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

[Bug debug/100852] New: [11/12 Regression] -fcompare-debug failure (length) with -Og -fif-conversion -fno-tree-ccp -fno-tree-copy-prop

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

Bug ID: 100852
   Summary: [11/12 Regression] -fcompare-debug failure (length)
with -Og -fif-conversion -fno-tree-ccp
-fno-tree-copy-prop
   Product: gcc
   Version: 12.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: debug
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
CC: aoliva at gcc dot gnu.org
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu

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

Compiler output:
$ x86_64-pc-linux-gnu-gcc -Og -fif-conversion -fno-tree-ccp -fno-tree-copy-prop
-fcompare-debug testcase.C -save-temps
x86_64-pc-linux-gnu-gcc: error: testcase.C: '-fcompare-debug' failure (length)

$ diff -u *gkd
--- a-testcase.C.gkd2021-06-01 12:41:23.194487854 +0200
+++ a-testcase.gk.C.gkd 2021-06-01 12:41:23.294487994 +0200
@@ -25,10 +25,11 @@
 (note # 0 0 NOTE_INSN_DELETED)
 (note # 0 0 NOTE_INSN_DELETED)
 (note # 0 0 NOTE_INSN_DELETED)
+(note # 0 0 NOTE_INSN_DELETED)
 (insn # 0 0 2 (set (reg:SI 4 si)
 (const_int 0 [0])) "testcase.C":17:10# {*movsi_internal}
  (nil))
-(insn # 0 0 2 (set (reg:DI 5 di [92])
+(insn # 0 0 2 (set (reg:DI 5 di [93])
 (plus:DI (reg/f:DI 7 sp)
 (const_int 15 [0xf]))) "testcase.C":17:10# {*leadi}
  (nil))

$ 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-r12-1138-20210601095814-g28daadc9809-checking-yes-rtl-df-extra-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/12.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--with-cloog --with-ppl --with-isl --build=x86_64-pc-linux-gnu
--host=x86_64-pc-linux-gnu --target=x86_64-pc-linux-gnu
--with-ld=/usr/bin/x86_64-pc-linux-gnu-ld
--with-as=/usr/bin/x86_64-pc-linux-gnu-as --disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r12-1138-20210601095814-g28daadc9809-checking-yes-rtl-df-extra-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 12.0.0 20210601 (experimental) (GCC)

[Bug target/100775] New: ICE: in df_exit_block_bitmap_verify, at df-scan.c:4164 with -mthumb -fzero-call-used-regs=used

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

Bug ID: 100775
   Summary: ICE: in df_exit_block_bitmap_verify, at df-scan.c:4164
with -mthumb -fzero-call-used-regs=used
   Product: gcc
   Version: 12.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: armv7a-hardfloat-linux-gnueabi

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

Compiler output:
$ armv7a-hardfloat-linux-gnueabi-gcc -mthumb -fzero-call-used-regs=used
testcase.c 
exit_block_uses =  0 [r0] 3 [r3] 7 [r7] 13 [sp] 14 [lr] 102 [sfp]
df->exit_block_uses =  0 [r0] 7 [r7] 13 [sp] 14 [lr] 102 [sfp]
during RTL pass: mach
testcase.c: In function 'foo':
testcase.c:5:1: internal compiler error: in df_exit_block_bitmap_verify, at
df-scan.c:4164
5 | }
  | ^
0xbb6462 df_exit_block_bitmap_verify
/repo/gcc-trunk/gcc/df-scan.c:4164
0xbb6462 df_scan_verify()
/repo/gcc-trunk/gcc/df-scan.c:4217
0xba0067 df_verify()
/repo/gcc-trunk/gcc/df-core.c:1818
0xba0067 df_analyze_1
/repo/gcc-trunk/gcc/df-core.c:1214
0x13b5a99 thumb2_reorg
/repo/gcc-trunk/gcc/config/arm/arm.c:18990
0x13b5a99 arm_reorg
/repo/gcc-trunk/gcc/config/arm/arm.c:19209
0xf96979 execute
/repo/gcc-trunk/gcc/reorg.c:3927
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

$ armv7a-hardfloat-linux-gnueabi-gcc -v
Using built-in specs.
COLLECT_GCC=/repo/gcc-trunk/binary-latest-armv7a-hardfloat/bin/armv7a-hardfloat-linux-gnueabi-gcc
COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-r12-1066-20210526112842-g95d67762171-checking-yes-rtl-df-extra-armv7a-hardfloat/bin/../libexec/gcc/armv7a-hardfloat-linux-gnueabi/12.0.0/lto-wrapper
Target: armv7a-hardfloat-linux-gnueabi
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-float=hard --with-fpu=vfpv4
--with-arch=armv7-a --with-sysroot=/usr/armv7a-hardfloat-linux-gnueabi
--build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu
--target=armv7a-hardfloat-linux-gnueabi
--with-ld=/usr/bin/armv7a-hardfloat-linux-gnueabi-ld
--with-as=/usr/bin/armv7a-hardfloat-linux-gnueabi-as --disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r12-1066-20210526112842-g95d67762171-checking-yes-rtl-df-extra-armv7a-hardfloat
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 12.0.0 20210526 (experimental) (GCC)

[Bug tree-optimization/100774] New: [12 Regression] -fcompare-debug failure (length) with -O2 -fno-tree-forwprop --param=evrp-mode=ranger-trace

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

Bug ID: 100774
   Summary: [12 Regression] -fcompare-debug failure (length) with
-O2 -fno-tree-forwprop --param=evrp-mode=ranger-trace
   Product: gcc
   Version: 12.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
CC: aoliva at gcc dot gnu.org
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu

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

Compiler output:
$ x86_64-pc-linux-gnu-g++ -O2 -fno-tree-forwprop --param=evrp-mode=ranger-trace
-fcompare-debug testcase.C
x86_64-pc-linux-gnu-g++: error: testcase.C: '-fcompare-debug' failure (length)
$ diff -u *gkd
--- a-testcase.C.gkd2021-05-26 17:07:09.776753885 +0200
+++ a-testcase.gk.C.gkd 2021-05-26 17:07:09.856753886 +0200
@@ -1,31 +1,15 @@

-Declarations used by foo, sorted by DECL_UID:
-0:   extern void error (void);

 ;; Function foo (_Z3foov, funcdef_no=1, cgraph_uid=2, symbol_order=2)
(executed once)

 (note # 0 0 NOTE_INSN_DELETED)
-(note # 0 0 [bb 2] NOTE_INSN_BASIC_BLOCK)
 (note # 0 0 NOTE_INSN_FUNCTION_BEG)
-(insn/f:TI # 0 0 2 (parallel [
-(set (reg/f:DI 7 sp)
-(plus:DI (reg/f:DI 7 sp)
-(const_int -8 [0xfff8])))
-(clobber (reg:CC 17 flags))
-(clobber (mem:BLK (scratch) [  A8]))
-]) "testcase.C":12:1# {pro_epilogue_adjust_stack_add_di}
- (expr_list:REG_UNUSED (reg:CC 17 flags)
-(expr_list:REG_CFA_ADJUST_CFA (set (reg/f:DI 7 sp)
-(plus:DI (reg/f:DI 7 sp)
-(const_int -8 [0xfff8])))
-(nil
 (note # 0 0 NOTE_INSN_PROLOGUE_END)
-(call_insn:TI # 0 0 2 (call (mem:QI (symbol_ref:DI ("_Z5errorv") [flags 0x41] 
) [ error S1 A8])
-(const_int 0 [0])) "testcase.C":19:12# {*call}
- (expr_list:REG_CALL_DECL (symbol_ref:DI ("_Z5errorv") [flags 0x41] 
)
-(expr_list:REG_ARGS_SIZE (const_int 0 [0])
-(expr_list:REG_NORETURN (const_int 0 [0])
-(nil
-(nil))
+(code_label # 0 0 2 2 (nil) [1 uses])
+(note # 0 0 [bb 2] NOTE_INSN_BASIC_BLOCK)
+(jump_insn:TI # 0 0 2 (set (pc)
+(label_ref #))# {jump}
+ (nil)
+ -> 2)
 (barrier # 0 0)
 (note # 0 0 NOTE_INSN_DELETED)

[Bug rtl-optimization/100701] New: [12 Regression] wrong code with -O -fschedule-insns2

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

Bug ID: 100701
   Summary: [12 Regression] wrong code with -O -fschedule-insns2
   Product: gcc
   Version: 12.0
Status: UNCONFIRMED
  Keywords: wrong-code
  Severity: normal
  Priority: P3
 Component: rtl-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu

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

Output:
$ x86_64-pc-linux-gnu-gcc -O -fschedule-insns2 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-r12-940-20210520111231-g507359e1d4d-checking-yes-rtl-df-extra-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/12.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--with-cloog --with-ppl --with-isl --build=x86_64-pc-linux-gnu
--host=x86_64-pc-linux-gnu --target=x86_64-pc-linux-gnu
--with-ld=/usr/bin/x86_64-pc-linux-gnu-ld
--with-as=/usr/bin/x86_64-pc-linux-gnu-as --disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r12-940-20210520111231-g507359e1d4d-checking-yes-rtl-df-extra-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 12.0.0 20210520 (experimental) (GCC)

[Bug middle-end/100672] wrong code with vector shift and unary minus

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

--- Comment #10 from Zdenek Sojka  ---
(In reply to Zdenek Sojka from comment #9)
> (In reply to Richard Biener from comment #8)
> > (In reply to Zdenek Sojka from comment #7)
> > > (In reply to Richard Biener from comment #2)
> > > > Maybe sth is wrong with the testcase?  clang also results in an abort.  
> > > > Isn't
> > > > right-shift of negative values undefined?
> > > > 
> > > 
> > > Thank you for having a look.
> > > 
> > > I believe the behavior is fully defined. The vectors are unsigned, and the
> > > conversion to unsigned is done by adding 2**64; this behaves the same:
> > > 
> > > $ cat testcase.c
> > > typedef unsigned long long __attribute__((__vector_size__ (32))) V;
> > > 
> > > V
> > > foo (V v)
> > > {
> > >   return -(v >> 1);
> > 
> > but this is a logical right shift, thus gives 0x7ff...e, ...
> > and negating that doesn't yield 1.
> > 
> 
> Shame on me. You are very right.

I did the mistake while reducing the testcase.
The original testcase had positive arguments:

$ cat testcase.c
typedef unsigned long long __attribute__((__vector_size__ (32))) V;

V
foo (V v)
{
  return -(v >> 1);
}

int
main (void)
{
  V v = foo ((V) { 2, 4, 6, 8 });
  if (v[0] != 0x || v[1] != 0xfffe ||
  v[2] != 0xfffd || v[3] != 0xfffc)
__builtin_abort ();
  return 0;
}


I wanted to prevent the long 0xf... constants, but broke the testcase in he
process. Thank you for correcting me.

[Bug middle-end/100672] wrong code with vector shift and unary minus

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

--- Comment #9 from Zdenek Sojka  ---
(In reply to Richard Biener from comment #8)
> (In reply to Zdenek Sojka from comment #7)
> > (In reply to Richard Biener from comment #2)
> > > Maybe sth is wrong with the testcase?  clang also results in an abort.  
> > > Isn't
> > > right-shift of negative values undefined?
> > > 
> > 
> > Thank you for having a look.
> > 
> > I believe the behavior is fully defined. The vectors are unsigned, and the
> > conversion to unsigned is done by adding 2**64; this behaves the same:
> > 
> > $ cat testcase.c
> > typedef unsigned long long __attribute__((__vector_size__ (32))) V;
> > 
> > V
> > foo (V v)
> > {
> >   return -(v >> 1);
> 
> but this is a logical right shift, thus gives 0x7ff...e, ...
> and negating that doesn't yield 1.
> 

Shame on me. You are very right.

[Bug middle-end/100672] wrong code with vector shift and unary minus

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

--- Comment #7 from Zdenek Sojka  ---
(In reply to Richard Biener from comment #2)
> Maybe sth is wrong with the testcase?  clang also results in an abort.  Isn't
> right-shift of negative values undefined?
> 

Thank you for having a look.

I believe the behavior is fully defined. The vectors are unsigned, and the
conversion to unsigned is done by adding 2**64; this behaves the same:

$ cat testcase.c
typedef unsigned long long __attribute__((__vector_size__ (32))) V;

V
foo (V v)
{
  return -(v >> 1);
}

int
main (void)
{
  V v = foo ((V) { 0xfffe, 0xfffc,
   0xfffa, 0xfff8 });
  if (v[0] != 1 || v[1] != 2 || v[2] != 3 || v[3] != 4)
__builtin_abort ();
  return 0;
}

Maybe clang behaves the same since the behavior was the same in the moment when
clang was forked.

[Bug tree-optimization/100672] wrong code with vector shift and unary minus

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

Zdenek Sojka  changed:

   What|Removed |Added

  Known to fail||10.3.1, 11.1.1, 12.0,
   ||5.5.0, 6.5.0, 7.5.0, 8.4.0,
   ||9.3.1

--- Comment #1 from Zdenek Sojka  ---
Adding 8.4.0 as "Known to fail", since 8.5.0 cannot be entered:
The value "8.5.0" used in the "Known to fail" field is not a valid version for
the "gcc" product.

[Bug tree-optimization/100672] New: wrong code with vector shift and unary minus

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

Bug ID: 100672
   Summary: wrong code with vector shift and unary minus
   Product: gcc
   Version: 12.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

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

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

Seems to happen at any optimization level, and for any 32bit or 64bit target.

Rewriting the expression as "(-v >> 1)" results in the expected output.

$ 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-r12-905-20210519101846-ga73a5af281c-checking-yes-rtl-df-extra-nobootstrap-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/12.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--disable-bootstrap --with-cloog --with-ppl --with-isl
--build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu
--target=x86_64-pc-linux-gnu --with-ld=/usr/bin/x86_64-pc-linux-gnu-ld
--with-as=/usr/bin/x86_64-pc-linux-gnu-as --disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r12-905-20210519101846-ga73a5af281c-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 12.0.0 20210519 (experimental) (GCC)

[Bug debug/100541] [12 Regression] -fcompare-debug failure (length) with -O3 -fno-expensive-optimizations -fno-tree-dce -fno-tree-dominator-opts

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

--- Comment #1 from Zdenek Sojka  ---
Created attachment 50833
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=50833&action=edit
another testcase (needs less compiler flags)

$ x86_64-pc-linux-gnu-gcc -O2 -fno-tree-dce -fno-tree-dominator-opts
-fcompare-debug aircraft_cmd.ii -save-temps
x86_64-pc-linux-gnu-gcc: error: aircraft_cmd.ii: '-fcompare-debug' failure
(length)
$ diff -u *gkd
--- a-aircraft_cmd.gk.ii.gkd2021-05-18 08:56:42.271670788 +0200
+++ a-aircraft_cmd.ii.gkd   2021-05-18 08:56:42.191670787 +0200
@@ -65,7 +65,7 @@
 (mult:HI (reg:HI 0 ax [orig:89 pretmp_31 ] [89])
 (const_int -21845 [0xaaab])))
 (clobber (reg:CC 17 flags))
-]) "aircraft_cmd.ii":18:19# {*mulhi3_1}
+])# {*mulhi3_1}
  (expr_list:REG_UNUSED (reg:CC 17 flags)
 (nil)))
 (insn:TI # 0 0 4 (parallel [
@@ -73,7 +73,7 @@
 (plus:HI (reg:HI 0 ax [101])
 (const_int 10922 [0x2aaa])))
 (clobber (reg:CC 17 flags))
-]) "aircraft_cmd.ii":18:19# {*addhi_1}
+])# {*addhi_1}
  (expr_list:REG_UNUSED (reg:CC 17 flags)
 (nil)))
 (insn:TI # 0 0 4 (set (reg:CC 17 flags)

[Bug target/100623] New: [10/11/12 Regression] wrong code with -Os -fno-dce -fno-defer-pop -fno-forward-propagate -flive-range-shrinkage -fno-rerun-cse-after-loop -mno-push-args

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

Bug ID: 100623
   Summary: [10/11/12 Regression] wrong code with -Os -fno-dce
-fno-defer-pop -fno-forward-propagate
-flive-range-shrinkage -fno-rerun-cse-after-loop
-mno-push-args
   Product: gcc
   Version: 12.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 50819
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=50819&action=edit
reduced testcase (from openssl sources)

Output:
$ x86_64-pc-linux-gnu-gcc -Os -fno-dce -fno-defer-pop -fno-forward-propagate
-flive-range-shrinkage -fno-rerun-cse-after-loop -mno-push-args testcase.c
$ ./a.out 
Aborted

bn_add_words() is called with r == NULL

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

[Bug tree-optimization/100574] New: [11/12 Regression] ICE: in size_remaining, at builtins.c:413 with -O3 -ftracer -fno-tree-dominator-opts -fno-tree-fre

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

Bug ID: 100574
   Summary: [11/12 Regression] ICE: in size_remaining, at
builtins.c:413 with -O3 -ftracer
-fno-tree-dominator-opts -fno-tree-fre
   Product: gcc
   Version: 12.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

Created attachment 50802
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=50802&action=edit
auto-reduced testcase (from OpenTTD sources)

Compiler output:
$ x86_64-pc-linux-gnu-gcc -O3 -ftracer -fno-tree-dominator-opts -fno-tree-fre
testcase.C 
during GIMPLE pass: strlen
testcase.C: In function 'void ReadTrackChunk()':
testcase.C:43:6: internal compiler error: in size_remaining, at builtins.c:413
   43 | void ReadTrackChunk() {
  |  ^~
0x714a5d
access_ref::size_remaining(generic_wide_int >*)
const
/repo/gcc-trunk/gcc/builtins.c:413
0xe2f36a access_ref::add_offset(generic_wide_int >
const&, generic_wide_int > const&)
/repo/gcc-trunk/gcc/builtins.c:517
0xe30211 handle_mem_ref
/repo/gcc-trunk/gcc/builtins.c:5407
0xe30211 compute_objsize_r
/repo/gcc-trunk/gcc/builtins.c:5549
0xe335d2 compute_objsize(tree_node*, int, access_ref*, pointer_query*)
/repo/gcc-trunk/gcc/builtins.c:5816
0x1514411 maybe_warn_overflow
/repo/gcc-trunk/gcc/tree-ssa-strlen.c:1952
0x151cbe1 maybe_warn_overflow
/repo/gcc-trunk/gcc/tree-ssa-strlen.c:2096
0x151cbe1 handle_store
/repo/gcc-trunk/gcc/tree-ssa-strlen.c:4788
0x151f4a6 check_and_optimize_stmt
/repo/gcc-trunk/gcc/tree-ssa-strlen.c:5426
0x151f4a6 strlen_dom_walker::before_dom_children(basic_block_def*)
/repo/gcc-trunk/gcc/tree-ssa-strlen.c:5622
0x1dcfc57 dom_walker::walk(basic_block_def*)
/repo/gcc-trunk/gcc/domwalk.c:309
0x1514f1e printf_strlen_execute
/repo/gcc-trunk/gcc/tree-ssa-strlen.c:5688
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

[Bug debug/100541] New: [12 Regression] -fcompare-debug failure (length) with -O3 -fno-expensive-optimizations -fno-tree-dce -fno-tree-dominator-opts

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

Bug ID: 100541
   Summary: [12 Regression] -fcompare-debug failure (length) with
-O3 -fno-expensive-optimizations -fno-tree-dce
-fno-tree-dominator-opts
   Product: gcc
   Version: 12.0
Status: UNCONFIRMED
  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

Created attachment 50793
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=50793&action=edit
auto-reduced testcase (from OpenTTD sources)

Compiler output:
$ x86_64-pc-linux-gnu-gcc -O3 -fno-expensive-optimizations -fno-tree-dce
-fno-tree-dominator-opts -fcompare-debug testcase.C -save-temps
x86_64-pc-linux-gnu-gcc: error: testcase.C: '-fcompare-debug' failure (length)
$ diff -u *.gkd
--- a-testcase.C.gkd2021-05-11 21:38:59.070437639 +0200
+++ a-testcase.gk.C.gkd 2021-05-11 21:38:59.103770789 +0200
@@ -93,7 +93,7 @@
 (mult:SI (mem/c:SI (symbol_ref:DI ("y") [flags 0x2]  ) [ y+0 S4 A32])
 (const_int -1431655765 [0xaaab])))
 (clobber (reg:CC 17 flags))
-])# {*mulsi3_1}
+]) "testcase.C":8:5# {*mulsi3_1}
  (expr_list:REG_UNUSED (reg:CC 17 flags)
 (nil)))
 (insn:TI # 0 0 7 (parallel [
@@ -101,7 +101,7 @@
 (plus:SI (reg:SI 0 ax [113])
 (const_int 715827882 [0x2aaa])))
 (clobber (reg:CC 17 flags))
-])# {*addsi_1}
+]) "testcase.C":8:5# {*addsi_1}
  (expr_list:REG_UNUSED (reg:CC 17 flags)
 (nil)))
 (insn:TI # 0 0 7 (set (reg:CC 17 flags)
@@ -163,7 +163,7 @@
 (mult:SI (mem/c:SI (symbol_ref:DI ("y") [flags 0x2]  ) [ y+0 S4 A32])
 (const_int -1431655765 [0xaaab])))
 (clobber (reg:CC 17 flags))
-])# {*mulsi3_1}
+]) "testcase.C":17:1# {*mulsi3_1}
  (expr_list:REG_UNUSED (reg:CC 17 flags)
 (nil)))
 (insn:TI # 0 0 10 (parallel [
@@ -171,7 +171,7 @@
 (plus:SI (reg:SI 0 ax [100])
 (const_int 715827882 [0x2aaa])))
 (clobber (reg:CC 17 flags))
-])# {*addsi_1}
+]) "testcase.C":17:1# {*addsi_1}
  (expr_list:REG_UNUSED (reg:CC 17 flags)
 (nil)))
 (insn:TI # 0 0 10 (set (reg:CC 17 flags)

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

[Bug debug/100304] [11/12 Regression] -fcompare-debug failure (length) with custom flags

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

--- Comment #4 from Zdenek Sojka  ---
I can't reproduce this anymore on r12-581 ; but it still reproduces for me on
the 11-branch.

[Bug debug/100469] New: [11/12 Regression] -fcompare-debug failure (length) with -O2 -fno-tree-dse -fno-tree-forwprop -fno-tree-tail-merge --param=sccvn-max-alias-queries-per-access=0

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

Bug ID: 100469
   Summary: [11/12 Regression] -fcompare-debug failure (length)
with -O2 -fno-tree-dse -fno-tree-forwprop
-fno-tree-tail-merge
--param=sccvn-max-alias-queries-per-access=0
   Product: gcc
   Version: 12.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: debug
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
CC: aoliva at gcc dot gnu.org
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu

Created attachment 50773
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=50773&action=edit
auto-reduced testcase (from OpenTTD sources)

Compiler output:
$ x86_64-pc-linux-gnu-gcc -O2 -fno-tree-dse -fno-tree-forwprop
-fno-tree-tail-merge --param=sccvn-max-alias-queries-per-access=0
-fcompare-debug testcase.C -save-temps
x86_64-pc-linux-gnu-gcc: error: testcase.C: '-fcompare-debug' failure (length)

$ diff a-testcase.C.gkd a-testcase.gk.C.gkd
13a14,15
> (note # 0 0 NOTE_INSN_DELETED)
> (note # 0 0 NOTE_INSN_DELETED)
15,16c17,18
< (mem:DI (reg:DI 4 si [89]) [ MEM[(const struct S &)s_2(D)].m+0 S8
A64])) "testcase.C":6:11# {*movdi_internal}
<  (expr_list:REG_DEAD (reg:DI 4 si [89])
---
> (mem:DI (reg:DI 4 si [90]) [ MEM[(const struct S &)s_2(D)].m+0 S8 
> A64])) "testcase.C":6:11# {*movdi_internal}
>  (expr_list:REG_DEAD (reg:DI 4 si [90])
19c21
< (set (reg:DI 2 cx [90])
---
> (set (reg:DI 2 cx [91])
26c28
< (reg:DI 5 di [88])) "testcase.C":26:1# {*movdi_internal}
---
> (reg:DI 5 di [89])) "testcase.C":26:1# {*movdi_internal}
36c38
< (reg:DI 2 cx [90]))) "testcase.C":21:32# {*movdicc_noc}
---
> (reg:DI 2 cx [91]))) "testcase.C":21:32# {*movdicc_noc}
38c40
< (expr_list:REG_DEAD (reg:DI 2 cx [90])
---
> (expr_list:REG_DEAD (reg:DI 2 cx [91])

$ 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-r12-581-20210507001633-gcfe82a0cbe7-checking-yes-rtl-df-extra-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/12.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--with-cloog --with-ppl --with-isl --build=x86_64-pc-linux-gnu
--host=x86_64-pc-linux-gnu --target=x86_64-pc-linux-gnu
--with-ld=/usr/bin/x86_64-pc-linux-gnu-ld
--with-as=/usr/bin/x86_64-pc-linux-gnu-as --disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r12-581-20210507001633-gcfe82a0cbe7-checking-yes-rtl-df-extra-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 12.0.0 20210507 (experimental) (GCC)

[Bug tree-optimization/100414] New: [12 Regression] ICE: in dominated_by_p, at dominance.c:1120 with -O -fno-tree-dce -fno-tree-dse

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

Bug ID: 100414
   Summary: [12 Regression] ICE: in dominated_by_p, at
dominance.c:1120 with -O -fno-tree-dce -fno-tree-dse
   Product: gcc
   Version: 12.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

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

Compiler output:
$ x86_64-pc-linux-gnu-gcc -O -fno-tree-dce -fno-tree-dse testcase.c
during GIMPLE pass: phiopt
testcase.c: In function 'foo0':
testcase.c:3:1: internal compiler error: in dominated_by_p, at dominance.c:1120
3 | foo (void)
  | ^~~~
0x6511a8 dominated_by_p(cdi_direction, basic_block_def const*, basic_block_def
const*)
/repo/gcc-trunk/gcc/dominance.c:1120
0x11f5f0b factor_out_conditional_conversion
/repo/gcc-trunk/gcc/tree-ssa-phiopt.c:507
0x11f5f0b tree_ssa_phiopt_worker
/repo/gcc-trunk/gcc/tree-ssa-phiopt.c:327
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

[Bug ipa/100413] New: [11/12 Regression] ICE: failed to reclaim unneeded function with custom flags

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

Bug ID: 100413
   Summary: [11/12 Regression] ICE: failed to reclaim unneeded
function with custom flags
   Product: gcc
   Version: 12.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
CC: marxin at gcc dot gnu.org
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu

Created attachment 50747
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=50747&action=edit
auto-reduced testcase (from OpenTTD sources)

Compiler output:
$ x86_64-pc-linux-gnu-gcc -O2 -fno-guess-branch-probability
-fno-inline-functions-called-once -fipa-cp-clone -fipa-pta
-fnon-call-exceptions --param=ipa-cp-eval-threshold=0 testcase.C 
_ZN12_Vector_base13_M_deallocateEv/6 (void _Vector_base::_M_deallocate())
@0x7fb58e54c880
  Type: function
  Body removed by symtab_remove_unreachable_nodes
  Visibility: externally_visible public weak comdat
comdat_group:_ZN12_Vector_base13_M_deallocateEv one_only
  References: 
  Referring: 
  Availability: not_available
  Function flags: body
  Called by: 
  Calls: 
testcase.C:60:73: internal compiler error: failed to reclaim unneeded function
   60 | ClientNetworkContentSocketHandler::ClientNetworkContentSocketHandler()
{}
  |
^
0xe9f7ce mark_functions_to_output
/repo/gcc-trunk/gcc/cgraphunit.c:1651
0xe9f7ce symbol_table::compile()
/repo/gcc-trunk/gcc/cgraphunit.c:2321
0xea2007 symbol_table::compile()
/repo/gcc-trunk/gcc/cgraphunit.c:2269
0xea2007 symbol_table::finalize_compilation_unit()
/repo/gcc-trunk/gcc/cgraphunit.c:2537
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

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

[Bug target/100342] New: [10/11 Regression] wrong code with -O2 -fno-dse -fno-forward-propagate -mno-sse2

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

Bug ID: 100342
   Summary: [10/11 Regression] wrong code with -O2 -fno-dse
-fno-forward-propagate -mno-sse2
   Product: gcc
   Version: 11.1.1
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 50712
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=50712&action=edit
semi-reduced testcase

I am failing to further reduce the testcase. I checked the code and I think the
behavior is fully defined. Also I am unable to find out what exactly goes
wrong; please close the PR if you don't want to spend time on this.

On master, it stopped failing between r12-100 (BAD) and r12-159 (OK); but it
might have been just papered over.

$ x86_64-pc-linux-gnu-gcc -O2 -fno-dse -fno-forward-propagate -mno-sse2
testcase.c -Wno-psabi
$ ./a.out 
Aborted

$ x86_64-pc-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=/repo/gcc-11-branch/binary-latest-amd64/bin/x86_64-pc-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/repo/gcc-11-branch/binary-11-branch-20210427124134-gfb7c736c2f1-checking-yes-rtl-df-extra-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/11.1.1/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /repo/gcc-11-branch//configure --enable-languages=c,c++
--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-libsanitizer
--disable-libstdcxx-pch
--prefix=/repo/gcc-11-branch//binary-11-branch-20210427124134-gfb7c736c2f1-checking-yes-rtl-df-extra-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 11.1.1 20210427 (GCC)

[Bug debug/100304] [11/12 Regression] -fcompare-debug failure (length) with custom flags

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

--- Comment #3 from Zdenek Sojka  ---
(In reply to Jakub Jelinek from comment #1)
> Can't reproduce this one.

Were you testing with a clean build, or did you have PR100303 fix applied?
On master, it stopped failing for me between r12-285 (BAD) and r12-293 (OK).

[Bug target/46250] ICE: in extract_insn, at recog.c:2110 (unrecognizable insn) with -fPIC -mcmodel=large and __thread variable

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

Zdenek Sojka  changed:

   What|Removed |Added

  Known to work||5.5.0, 6.5.0, 7.5.0

--- Comment #7 from Zdenek Sojka  ---
No longer fails for me since at least 5.5.0.

[Bug target/58067] ICE in GFortran recog.c:2158

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

Zdenek Sojka  changed:

   What|Removed |Added

 CC||zsojka at seznam dot cz

--- Comment #13 from Zdenek Sojka  ---
Even the original fortran testcase does not fail in 8.3.1, 9.3.0, 10.3.0,
11.1.0 for me.

[Bug debug/100304] [11/12 Regression] -fcompare-debug failure (length) with custom flags

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

--- Comment #2 from Zdenek Sojka  ---
(In reply to Jakub Jelinek from comment #1)
> Can't reproduce this one.

Thank you for checking this. I've updated the sources, and rebuilt with release
checking, no bootstrap:
$ 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-r12-212-20210428120349-gf7ee6a1e8ac-checking-release-nobootstrap-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/12.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=release
--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-r12-212-20210428120349-gf7ee6a1e8ac-checking-release-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 12.0.0 20210428 (experimental) (GCC) 

Valgrind doesn't report any issues during compilation.

The diff is:
$ diff -u a-testcase.C.gkd a-testcase.gk.C.gkd
--- a-testcase.C.gkd2021-04-28 13:08:24.0 +0200
+++ a-testcase.gk.C.gkd 2021-04-28 13:08:40.0 +0200
@@ -526,10 +526,13 @@
 (nil
 (expr_list:DI (use (reg:DI 5 di))
 (nil)))
-(insn # 0 0 18 (set (reg/f:DI 5 di [orig:89 __first$_M_current ] [89])
-(plus:DI (reg/f:DI 3 bx [orig:86 _9 ] [86])
-(const_int 24 [0x18])))# {*leadi}
- (nil))
+(insn # 0 0 18 (parallel [
+(set (reg/f:DI 5 di [orig:89 __first$_M_current ] [89])
+(const_int 0 [0]))
+(clobber (reg:CC 17 flags))
+]) "testcase.C":82:3# {*movdi_xor}
+ (expr_list:REG_UNUSED (reg:CC 17 flags)
+(nil)))
 (call_insn:TI # 0 0 18 (call (mem:QI (symbol_ref:DI
("_ZN12_Vector_baseI9allocatorIiEED2Ev") [flags 0x41]  ) [ __dt_base  S1 A8])
 (const_int 0 [0])) "testcase.C":82:3# {*call}
  (expr_list:REG_DEAD (reg:DI 5 di)

[Bug debug/100304] New: [11/12 Regression] -fcompare-debug failure (length) with custom flags

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

Bug ID: 100304
   Summary: [11/12 Regression] -fcompare-debug failure (length)
with custom flags
   Product: gcc
   Version: 12.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: debug
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
CC: aoliva at gcc dot gnu.org
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu

Created attachment 50694
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=50694&action=edit
auto-reduced testcase (from OpenTTD sources)

The same set of compiler flags after reduction was observed twice on two
different testcases, so it might be important.

Compiler output:
$ x86_64-pc-linux-gnu-gcc -O2 -fno-cse-follow-jumps
-fno-guess-branch-probability -fno-tree-coalesce-vars -fno-tree-forwprop
-funroll-loops -fno-web -fcompare-debug testcase.C -w
x86_64-pc-linux-gnu-gcc: error: testcase.C: '-fcompare-debug' failure (length)


$ 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-r12-174-20210427141825-g37d2b98100c-checking-yes-rtl-df-extra-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/12.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--with-cloog --with-ppl --with-isl --build=x86_64-pc-linux-gnu
--host=x86_64-pc-linux-gnu --target=x86_64-pc-linux-gnu
--with-ld=/usr/bin/x86_64-pc-linux-gnu-ld
--with-as=/usr/bin/x86_64-pc-linux-gnu-as --disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r12-174-20210427141825-g37d2b98100c-checking-yes-rtl-df-extra-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 12.0.0 20210427 (experimental) (GCC)

[Bug debug/100303] New: [11/12 Regression] -fcompare-debug failure (length) with -O -fno-dce -ftracer

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

Bug ID: 100303
   Summary: [11/12 Regression] -fcompare-debug failure (length)
with -O -fno-dce -ftracer
   Product: gcc
   Version: 12.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: debug
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
CC: aoliva at gcc dot gnu.org
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu

Created attachment 50693
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=50693&action=edit
auto-reduced testcase (from OpenTTD sources)

Compiler output:
$ x86_64-pc-linux-gnu-gcc -O -fno-dce -ftracer -fcompare-debug testcase.C -w
x86_64-pc-linux-gnu-gcc: error: testcase.C: '-fcompare-debug' failure (length)

$ 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-r12-174-20210427141825-g37d2b98100c-checking-yes-rtl-df-extra-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/12.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--with-cloog --with-ppl --with-isl --build=x86_64-pc-linux-gnu
--host=x86_64-pc-linux-gnu --target=x86_64-pc-linux-gnu
--with-ld=/usr/bin/x86_64-pc-linux-gnu-ld
--with-as=/usr/bin/x86_64-pc-linux-gnu-as --disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r12-174-20210427141825-g37d2b98100c-checking-yes-rtl-df-extra-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 12.0.0 20210427 (experimental) (GCC)

[Bug tree-optimization/100292] New: [12 Regression] ICE: verify_gimple failed: invalid operands in ternary operation (during GIMPLE pass: veclower) with vectors

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

Bug ID: 100292
   Summary: [12 Regression] ICE: verify_gimple failed: invalid
operands in ternary operation (during GIMPLE pass:
veclower) with vectors
   Product: gcc
   Version: 12.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

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

This seems to be a recent regression; r12-100 is OK, r12-159 is BAD.
I searched the bug database, and even though I am triggering this often on
various targets, I didn't find any duplicate.

Compiler output:
$ x86_64-pc-linux-gnu-gcc testcase.c
testcase.c: In function 'foo':
testcase.c:6:1: error: invalid operands in ternary operation
6 | foo (char c)
  | ^~~
_13 = (signed char) c.1_2 >= 0 ? -1 : 0;
during GIMPLE pass: veclower
testcase.c:6:1: internal compiler error: verify_gimple failed
0x10b888a verify_gimple_in_cfg(function*, bool)
/repo/gcc-trunk/gcc/tree-cfg.c:5507
0xf6f67f execute_function_todo
/repo/gcc-trunk/gcc/passes.c:2042
0xf704f3 do_per_function
/repo/gcc-trunk/gcc/passes.c:1687
0xf704f3 execute_todo
/repo/gcc-trunk/gcc/passes.c:2096
Please submit a full bug report,
with preprocessed source if appropriate.
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-trunk-r12-159-20210427154247-g83d26d0e1b3-checking-yes-rtl-df-extra-nobootstrap-amd64/bin/x86_64-pc-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-r12-159-20210427154247-g83d26d0e1b3-checking-yes-rtl-df-extra-nobootstrap-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/12.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--disable-bootstrap --with-cloog --with-ppl --with-isl
--build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu
--target=x86_64-pc-linux-gnu --with-ld=/usr/bin/x86_64-pc-linux-gnu-ld
--with-as=/usr/bin/x86_64-pc-linux-gnu-as --disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r12-159-20210427154247-g83d26d0e1b3-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 12.0.0 20210427 (experimental) (GCC)

[Bug debug/100254] New: [11/12 Regression] -fcompare-debug failure (length) with -O2 -fno-guess-branch-probability -fipa-pta -fnon-call-exceptions

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

Bug ID: 100254
   Summary: [11/12 Regression] -fcompare-debug failure (length)
with -O2 -fno-guess-branch-probability -fipa-pta
-fnon-call-exceptions
   Product: gcc
   Version: 12.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: debug
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
CC: aoliva at gcc dot gnu.org
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu

Created attachment 50673
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=50673&action=edit
auto-reduced testcase (from OpenTTD sources)

Compiler output:
$ x86_64-pc-linux-gnu-g++ -O2 -mtune=goldmont -fno-guess-branch-probability
-fipa-pta -fnon-call-exceptions -fcompare-debug testcase.C 
testcase.C:20:38: warning: friend declaration 'bool
operator!=(_Rb_tree_const_iterator<_Tp>::_Self,
_Rb_tree_const_iterator<_Tp>::_Self)' declares a non-template function
[-Wnon-template-friend]
   20 |   friend bool operator!=(_Self, _Self);
  |  ^
testcase.C:20:38: note: (if this is not what you intended, make sure the
function template has already been declared and add '<>' after the function
name here)
testcase.C: In member function 'bool CargoSorter::operator()(const
CargoDataEntry*, const CargoDataEntry*) const':
testcase.C:82:61: warning: no return statement in function returning non-void
[-Wreturn-type]
   82 |  const CargoDataEntry *) const {}
  | ^
x86_64-pc-linux-gnu-g++: error: testcase.C: '-fcompare-debug' failure (length)

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

[Bug rtl-optimization/100253] New: [10/11/12 Regression] wrong code with -O2 -fno-tree-bit-ccp -ftree-slp-vectorize (unaligned movdqa)

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

Bug ID: 100253
   Summary: [10/11/12 Regression] wrong code with -O2
-fno-tree-bit-ccp -ftree-slp-vectorize (unaligned
movdqa)
   Product: gcc
   Version: 12.0
Status: UNCONFIRMED
  Keywords: wrong-code
  Severity: normal
  Priority: P3
 Component: rtl-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu

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

Output:
$ x86_64-pc-linux-gnu-g++ testcase.C -O2 -fno-tree-bit-ccp -ftree-slp-vectorize
$ ./a.out
Segmentation fault

Program received signal SIGSEGV, Segmentation fault.
0x004011aa in S::operator= (this=0x404120 ) at testcase.C:7
7   struct S
(gdb) disas
Dump of assembler code for function main():
   0x00401180 <+0>: push   %rbp
   0x00401181 <+1>: mov$0x404120,%edi
   0x00401186 <+6>: push   %rbx
   0x00401187 <+7>: sub$0x8,%rsp
   0x0040118b <+11>:movsbq 0x2f2d(%rip),%rbp# 0x4040c0 
   0x00401193 <+19>:shl$0x6,%rbp
   0x00401197 <+23>:lea0x4040e0(%rbp),%rsi
   0x0040119e <+30>:call   0x4014e0
<_ZNSt6vectorIS_I1TSaIS0_EESaIS2_EEaSERKS4_>
   0x004011a3 <+35>:movzbl 0x4040f8(%rbp),%eax
=> 0x004011aa <+42>:movdqa 0x404109(%rbp),%xmm0
   0x004011b2 <+50>:movdqa 0x4040f9(%rbp),%xmm1
   0x004011ba <+58>:mov%al,0x2f78(%rip)# 0x404138

   0x004011c0 <+64>:xor%eax,%eax
   0x004011c2 <+66>:movups %xmm1,0x2f70(%rip)# 0x404139

   0x004011c9 <+73>:movups %xmm0,0x2f79(%rip)# 0x404149

   0x004011d0 <+80>:add$0x8,%rsp
   0x004011d4 <+84>:pop%rbx
   0x004011d5 <+85>:pop%rbp
   0x004011d6 <+86>:ret

[Bug rtl-optimization/100239] New: [10/11/12 Regression] ICE: in expand_expr_real_2, at expr.c:9865 with __builtin_shuffle()

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

Bug ID: 100239
   Summary: [10/11/12 Regression] ICE: in expand_expr_real_2, at
expr.c:9865 with __builtin_shuffle()
   Product: gcc
   Version: 12.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: rtl-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu

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

Compiler output:
$ x86_64-pc-linux-gnu-gcc testcase.c
during RTL pass: expand
testcase.c: In function 'foo':
testcase.c:9:7: internal compiler error: in expand_expr_real_2, at expr.c:9865
9 |   c & __builtin_shuffle (v != v, 0 < (V){}, (V){719} >>5);
  |   ^~~
0x671830 expand_expr_real_2(separate_ops*, rtx_def*, machine_mode,
expand_modifier)
/repo/gcc-trunk/gcc/expr.c:9865
0xb94d3f expand_gimple_stmt_1
/repo/gcc-trunk/gcc/cfgexpand.c:3947
0xb94d3f expand_gimple_stmt
/repo/gcc-trunk/gcc/cfgexpand.c:4008
0xb9a5d1 expand_gimple_basic_block
/repo/gcc-trunk/gcc/cfgexpand.c:6045
0xb9c246 execute
/repo/gcc-trunk/gcc/cfgexpand.c:6729
Please submit a full bug report,
with preprocessed source if appropriate.
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-r12-96-20210423095621-g886b6c1e8af-checking-yes-rtl-df-extra-nobootstrap-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/12.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--disable-bootstrap --with-cloog --with-ppl --with-isl
--build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu
--target=x86_64-pc-linux-gnu --with-ld=/usr/bin/x86_64-pc-linux-gnu-ld
--with-as=/usr/bin/x86_64-pc-linux-gnu-as --disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r12-96-20210423095621-g886b6c1e8af-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 12.0.0 20210423 (experimental) (GCC)

[Bug debug/100148] New: [10/11 Regression] -fcompare-debug failure (length) with -O2 -fno-dce -fno-tree-dce -fno-tree-dominator-opts -fno-tree-sink

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

Bug ID: 100148
   Summary: [10/11 Regression] -fcompare-debug failure (length)
with -O2 -fno-dce -fno-tree-dce
-fno-tree-dominator-opts -fno-tree-sink
   Product: gcc
   Version: 11.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: debug
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
CC: aoliva at gcc dot gnu.org
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu

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

Compiler output:
$ x86_64-pc-linux-gnu-gcc -O2 -fno-dce -fno-tree-dce -fno-tree-dominator-opts
-fno-tree-sink -fcompare-debug testcase.C 
x86_64-pc-linux-gnu-gcc: error: testcase.C: '-fcompare-debug' failure (length)

$ 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-r11-8244-20210419132718-g714bdc31b69-checking-yes-rtl-df-extra-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/11.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-r11-8244-20210419132718-g714bdc31b69-checking-yes-rtl-df-extra-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 11.0.1 20210419 (experimental) (GCC)

[Bug target/99905] [8/9/10/11 Regression] wrong code with -mno-mmx -mno-sse

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

Zdenek Sojka  changed:

   What|Removed |Added

Summary|wrong code with |[8/9/10/11 Regression]
   |-mgeneral-regs-only |wrong code with -mno-mmx
   ||-mno-sse

--- Comment #3 from Zdenek Sojka  ---
(In reply to Zdenek Sojka from comment #2)
> (In reply to Martin Liška from comment #1)
> > > Probably present since -mgeneral-regs-only introduction.
> > 
> > Confirmed that, it's since r7-928-gce3a16ff1f59e6db.
> 
> Thank you for the bisection.
> If -mgeneral-regs-only is not used, the flag can be replaced by -mno-mmx
> -mno-sse:
> 
> $ x86_64-pc-linux-gnu-gcc -Os -mno-mmx -mno-sse testcase.c
> $ ./a.out 
> Aborted

... which seems a regression from gcc-6.5.0

[Bug target/99905] wrong code with -mgeneral-regs-only

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

--- Comment #2 from Zdenek Sojka  ---
(In reply to Martin Liška from comment #1)
> > Probably present since -mgeneral-regs-only introduction.
> 
> Confirmed that, it's since r7-928-gce3a16ff1f59e6db.

Thank you for the bisection.
If -mgeneral-regs-only is not used, the flag can be replaced by -mno-mmx
-mno-sse:

$ x86_64-pc-linux-gnu-gcc -Os -mno-mmx -mno-sse testcase.c
$ ./a.out 
Aborted

[Bug analyzer/99906] New: [11 Regression] ICE: SIGSEGV in maybe_reconstruct_from_def_stmt with -fanalyzer

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

Bug ID: 99906
   Summary: [11 Regression] ICE: SIGSEGV in
maybe_reconstruct_from_def_stmt with -fanalyzer
   Product: gcc
   Version: 11.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

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

Compiler output:
$ x86_64-pc-linux-gnu-gcc -fanalyzer testcase.c -wrapper valgrind,-q 
==16921== Invalid read of size 4
==16921==at 0xA0DEF7: operator[] (vec.h:890)
==16921==by 0xA0DEF7: operator[] (vec.h:1461)
==16921==by 0xA0DEF7: maybe_reconstruct_from_def_stmt (analyzer.cc:151)
==16921==by 0xA0DEF7: ana::fixup_tree_for_diagnostic_1(tree_node*,
hash_set >*) [clone .part.0]
[clone .cold] (analyzer.cc:168)
==16921==by 0x1CBE732: fixup_tree_for_diagnostic_1 (analyzer.cc:189)
==16921==by 0x1CBE732: ana::fixup_tree_for_diagnostic(tree_node*)
(analyzer.cc:188)
==16921==by 0x140E497:
ana::region_model::get_representative_tree(ana::svalue const*) const
(region-model.cc:2330)
==16921==by 0x13F7A54:
ana::impl_sm_context::get_diagnostic_tree(tree_node*) (engine.cc:314)
==16921==by 0x1435056: ana::(anonymous
namespace)::malloc_state_machine::on_stmt(ana::sm_context*, ana::supernode
const*, gimple const*) const (sm-malloc.cc:1603)
==16921==by 0x13F1448: ana::exploded_node::on_stmt(ana::exploded_graph&,
ana::supernode const*, gimple const*, ana::program_state*) (engine.cc:1271)
==16921==by 0x13F3729:
ana::exploded_graph::process_node(ana::exploded_node*) (engine.cc:3016)
==16921==by 0x13F40EA: ana::exploded_graph::process_worklist()
(engine.cc:2641)
==16921==by 0x13F6225: ana::impl_run_checkers(ana::logger*)
(engine.cc:4851)
==16921==by 0x13F70B3: ana::run_checkers() (engine.cc:4922)
==16921==by 0x13E8CA8: (anonymous
namespace)::pass_analyzer::execute(function*) (analyzer-pass.cc:87)
==16921==by 0xF62CAC: execute_one_pass(opt_pass*) (passes.c:2567)
==16921==  Address 0x4 is not stack'd, malloc'd or (recently) free'd
==16921== 
during IPA pass: analyzer
testcase.c: In function 'foo':
testcase.c:3:18: internal compiler error: Segmentation fault
3 | void foo(void) { bar(baz()); }
  |  ^~
0x105dd0f crash_signal
/repo/gcc-trunk/gcc/toplev.c:327
0xa0def7 vec::operator[](unsigned int)
/repo/gcc-trunk/gcc/vec.h:890
0xa0def7 vec::operator[](unsigned int)
/repo/gcc-trunk/gcc/vec.h:1461
0xa0def7 maybe_reconstruct_from_def_stmt
/repo/gcc-trunk/gcc/analyzer/analyzer.cc:151
0xa0def7 fixup_tree_for_diagnostic_1
/repo/gcc-trunk/gcc/analyzer/analyzer.cc:168
0x1cbe732 fixup_tree_for_diagnostic_1
/repo/gcc-trunk/gcc/analyzer/analyzer.cc:189
0x1cbe732 ana::fixup_tree_for_diagnostic(tree_node*)
/repo/gcc-trunk/gcc/analyzer/analyzer.cc:188
0x140e497 ana::region_model::get_representative_tree(ana::svalue const*) const
/repo/gcc-trunk/gcc/analyzer/region-model.cc:2330
0x13f7a54 ana::impl_sm_context::get_diagnostic_tree(tree_node*)
/repo/gcc-trunk/gcc/analyzer/engine.cc:314
0x1435056 on_stmt
/repo/gcc-trunk/gcc/analyzer/sm-malloc.cc:1603
0x13f1448 ana::exploded_node::on_stmt(ana::exploded_graph&, ana::supernode
const*, gimple const*, ana::program_state*)
/repo/gcc-trunk/gcc/analyzer/engine.cc:1271
0x13f3729 ana::exploded_graph::process_node(ana::exploded_node*)
/repo/gcc-trunk/gcc/analyzer/engine.cc:3016
0x13f40ea ana::exploded_graph::process_worklist()
/repo/gcc-trunk/gcc/analyzer/engine.cc:2641
0x13f6225 ana::impl_run_checkers(ana::logger*)
/repo/gcc-trunk/gcc/analyzer/engine.cc:4851
0x13f70b3 ana::run_checkers()
/repo/gcc-trunk/gcc/analyzer/engine.cc:4922
0x13e8ca8 execute
/repo/gcc-trunk/gcc/analyzer/analyzer-pass.cc:87
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

$ x86_64-pc-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=/repo/gcc-trunk/binary-latest/bin/x86_64-pc-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-r11-7980-20210403205900-gc3d3bb0f03d-checking-yes-rtl-df-extra-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/11.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/x8

[Bug target/99905] New: wrong code with -mgeneral-regs-only

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

Bug ID: 99905
   Summary: wrong code with -mgeneral-regs-only
   Product: gcc
   Version: 11.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 50504
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=50504&action=edit
reduced testcase

Output:
$ x86_64-pc-linux-gnu-gcc testcase.c -Os -mgeneral-regs-only
$ ./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-r11-7980-20210403205900-gc3d3bb0f03d-checking-yes-rtl-df-extra-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/11.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-r11-7980-20210403205900-gc3d3bb0f03d-checking-yes-rtl-df-extra-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 11.0.1 20210404 (experimental) (GCC) 

Probably present since -mgeneral-regs-only introduction.

[Bug target/99863] New: [10/11 Regression] wrong code with -O -fno-tree-forwprop -mno-sse2

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

Bug ID: 99863
   Summary: [10/11 Regression] wrong code with -O
-fno-tree-forwprop -mno-sse2
   Product: gcc
   Version: 11.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 50493
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=50493&action=edit
reduced testcase

Output:
$ x86_64-pc-linux-gnu-gcc -O -fno-tree-forwprop -mno-sse2 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-r11-7937-20210331154556-geadf009b229-checking-yes-rtl-df-extra-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/11.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-r11-7937-20210331154556-geadf009b229-checking-yes-rtl-df-extra-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 11.0.1 20210331 (experimental) (GCC)

[Bug rtl-optimization/99830] New: [11 Regression] ICE: in lra_eliminate_regs_1, at lra-eliminations.c:659 with -O2 -fno-expensive-optimizations -fno-split-wide-types -g

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

Bug ID: 99830
   Summary: [11 Regression] ICE: in lra_eliminate_regs_1, at
lra-eliminations.c:659 with -O2
-fno-expensive-optimizations -fno-split-wide-types -g
   Product: gcc
   Version: 11.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: rtl-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: aarch64-unknown-linux-gnu

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

Compiler output:
$ aarch64-unknown-linux-gnu-gcc -O2 -fno-expensive-optimizations
-fno-split-wide-types -g testcase.c
during RTL pass: reload
testcase.c: In function 'foo':
testcase.c:6:1: internal compiler error: in lra_eliminate_regs_1, at
lra-eliminations.c:659
6 | }
  | ^
0x73e41c lra_eliminate_regs_1(rtx_insn*, rtx_def*, machine_mode, bool, bool,
poly_int<2u, long>, bool)
/repo/gcc-trunk/gcc/lra-eliminations.c:659
0xf16d42 lra_eliminate_regs_1(rtx_insn*, rtx_def*, machine_mode, bool, bool,
poly_int<2u, long>, bool)
/repo/gcc-trunk/gcc/lra-eliminations.c:602
0xf16b3c lra_eliminate_regs_1(rtx_insn*, rtx_def*, machine_mode, bool, bool,
poly_int<2u, long>, bool)
/repo/gcc-trunk/gcc/lra-eliminations.c:503
0xf16ba9 lra_eliminate_regs_1(rtx_insn*, rtx_def*, machine_mode, bool, bool,
poly_int<2u, long>, bool)
/repo/gcc-trunk/gcc/lra-eliminations.c:507
0xf171ad lra_eliminate_regs_1(rtx_insn*, rtx_def*, machine_mode, bool, bool,
poly_int<2u, long>, bool)
/repo/gcc-trunk/gcc/lra-eliminations.c:610
0xf16d42 lra_eliminate_regs_1(rtx_insn*, rtx_def*, machine_mode, bool, bool,
poly_int<2u, long>, bool)
/repo/gcc-trunk/gcc/lra-eliminations.c:602
0xf16ba9 lra_eliminate_regs_1(rtx_insn*, rtx_def*, machine_mode, bool, bool,
poly_int<2u, long>, bool)
/repo/gcc-trunk/gcc/lra-eliminations.c:507
0xf171ad lra_eliminate_regs_1(rtx_insn*, rtx_def*, machine_mode, bool, bool,
poly_int<2u, long>, bool)
/repo/gcc-trunk/gcc/lra-eliminations.c:610
0xf183ff eliminate_regs_in_insn(rtx_insn*, bool, bool, poly_int<2u, long>)
/repo/gcc-trunk/gcc/lra-eliminations.c:1023
0xf18f9d process_insn_for_elimination
/repo/gcc-trunk/gcc/lra-eliminations.c:1333
0xf18f9d lra_eliminate(bool, bool)
/repo/gcc-trunk/gcc/lra-eliminations.c:1401
0xefa038 lra(_IO_FILE*)
/repo/gcc-trunk/gcc/lra.c:2470
0xeab919 do_reload
/repo/gcc-trunk/gcc/ira.c:5835
0xeab919 execute
/repo/gcc-trunk/gcc/ira.c:6021
Please submit a full bug report,
with preprocessed source if appropriate.
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-r11-7911-20210330134321-gf64b91568f3-checking-yes-rtl-df-extra-aarch64/bin/../libexec/gcc/aarch64-unknown-linux-gnu/11.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-r11-7911-20210330134321-gf64b91568f3-checking-yes-rtl-df-extra-aarch64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 11.0.1 20210330 (experimental) (GCC)

[Bug target/99702] [11 Regression] ICE: RTL check: expected code 'const_int', have 'subreg' in riscv_expand_block_move, at config/riscv/riscv.c:3262 with memcpy() since r11-7757-gfc9c4e5fc50c7fcbd27d6

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

--- Comment #3 from Zdenek Sojka  ---
(In reply to Martin Liška from comment #2)
> Started with r11-7757-gfc9c4e5fc50c7fcbd27d6cb3dd372f7da8216954.

Thank you for the analysis! However I don't think that's possible, since I was
observing the failure on r11-7753 ; I even reported this before r11-7757 was
available.

[Bug target/99702] [11 Regression] ICE: RTL check: expected code 'const_int', have 'subreg' in riscv_expand_block_move, at config/riscv/riscv.c:3262 with memcpy()

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

Zdenek Sojka  changed:

   What|Removed |Added

  Known to fail||11.0

--- Comment #1 from Zdenek Sojka  ---
This might be a recent regression, r11-7696 works fine.

[Bug target/99702] New: [11 Regression] ICE: RTL check: expected code 'const_int', have 'subreg' in riscv_expand_block_move, at config/riscv/riscv.c:3262 with memcpy()

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

Bug ID: 99702
   Summary: [11 Regression] ICE: RTL check: expected code
'const_int', have 'subreg' in riscv_expand_block_move,
at config/riscv/riscv.c:3262 with memcpy()
   Product: gcc
   Version: 11.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 50444
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=50444&action=edit
reduced testcase (from libgcc/unwind-dw2.c)

Compiler output:
$ cc1 -mabi=lp64d -march=rv64imafdc -O testcase.c 
 foo
Analyzing compilation unit
Performing interprocedural optimizations
 <*free_lang_data> {heap 860k}  {heap 860k} 
{heap 860k}  {heap 992k}  {heap 1720k}
 {heap 1720k}  {heap 1720k}Streaming LTO
  {heap 1720k}  {heap 1720k}  {heap
1720k}  {heap 1720k}  {heap 1720k}  {heap 1720k}
 {heap 1720k}  {heap 1720k}  {heap
1720k}  {heap 1720k}Assembling functions:
 fooduring RTL pass: expand

testcase.c: In function 'foo':
testcase.c:4:3: internal compiler error: RTL check: expected code 'const_int',
have 'subreg' in riscv_expand_block_move, at config/riscv/riscv.c:3262
4 |   __builtin_memcpy(i, j, n);
  |   ^
0x6c4289 rtl_check_failed_code1(rtx_def const*, rtx_code, char const*, int,
char const*)
/repo/gcc-trunk/gcc/rtl.c:879
0x776ff0 riscv_expand_block_move(rtx_def*, rtx_def*, rtx_def*)
/repo/gcc-trunk/gcc/config/riscv/riscv.c:3262
0x14c4ba0 gen_cpymemsi(rtx_def*, rtx_def*, rtx_def*, rtx_def*)
/repo/gcc-trunk/gcc/config/riscv/riscv.md:1528
0xd4b8d8 maybe_expand_insn(insn_code, unsigned int, expand_operand*)
/repo/gcc-trunk/gcc/optabs.c:7820
0xae7f5e emit_block_move_via_pattern
/repo/gcc-trunk/gcc/expr.c:1873
0xae7f5e emit_block_move_hints(rtx_def*, rtx_def*, rtx_def*, block_op_methods,
unsigned int, long, unsigned long, unsigned long, unsigned long, bool, bool*,
bool)
/repo/gcc-trunk/gcc/expr.c:1665
0x977aa3 expand_builtin_memory_copy_args
/repo/gcc-trunk/gcc/builtins.c:6053
0x989470 expand_builtin_memcpy
/repo/gcc-trunk/gcc/builtins.c:5906
0x98c3a2 expand_builtin(tree_node*, rtx_def*, rtx_def*, machine_mode, int)
/repo/gcc-trunk/gcc/builtins.c:9955
0xade284 expand_expr_real_1(tree_node*, rtx_def*, machine_mode,
expand_modifier, rtx_def**, bool)
/repo/gcc-trunk/gcc/expr.c:11282
0x9b9d5c expand_expr
/repo/gcc-trunk/gcc/expr.h:282
0x9b9d5c expand_call_stmt
/repo/gcc-trunk/gcc/cfgexpand.c:2840
0x9b9d5c expand_gimple_stmt_1
/repo/gcc-trunk/gcc/cfgexpand.c:3844
0x9b9d5c expand_gimple_stmt
/repo/gcc-trunk/gcc/cfgexpand.c:4008
0x9ba7a9 expand_gimple_basic_block
/repo/gcc-trunk/gcc/cfgexpand.c:6045
0x9bc4a6 execute
/repo/gcc-trunk/gcc/cfgexpand.c:6729
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

$ xgcc -v
Using built-in specs.
COLLECT_GCC=/repo/build-gcc-trunk-riscv64/./gcc/xgcc
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-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-r11-7753-20210321172739-gfc24ea23742-checking-yes-rtl-df-extra-riscv64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 11.0.1 20210321 (experimental) (GCC) 

This breaks compiler build with --enable-checking=yes,rtl,df,extra

[Bug target/99321] New: [11 Regression] ICE: in extract_constrain_insn, at recog.c:2670: insn does not satisfy its constraints: {*uminv16qi3}

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

Bug ID: 99321
   Summary: [11 Regression] ICE: in extract_constrain_insn, at
recog.c:2670: insn does not satisfy its constraints:
{*uminv16qi3}
   Product: gcc
   Version: 11.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 50275
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=50275&action=edit
reduced testcase

Compiler output:
$ x86_64-pc-linux-gnu-gcc -O2 -mtune=btver2 -fno-tree-dce -mavx512vl testcase.c 
testcase.c: In function 'foo0':
testcase.c:68:1: error: insn does not satisfy its constraints:
   68 | }
  | ^
(insn 2646 2645 2188 2 (set (reg/v:V16QI 27 xmm7 [orig:428 v128u8_0 ] [428])
(umin:V16QI (reg/v:V16QI 27 xmm7 [orig:428 v128u8_0 ] [428])
(reg/v:V16QI 53 xmm17 [orig:428 v128u8_0 ] [428])))
"testcase.c":28:50 3810 {*uminv16qi3}
 (nil))
during RTL pass: cprop_hardreg
testcase.c:68:1: internal compiler error: in extract_constrain_insn, at
recog.c:2670
0x703506 _fatal_insn(char const*, rtx_def const*, char const*, int, char
const*)
/repo/gcc-trunk/gcc/rtl-error.c:108
0x703593 _fatal_insn_not_found(rtx_def const*, char const*, int, char const*)
/repo/gcc-trunk/gcc/rtl-error.c:118
0x6f1f3f extract_constrain_insn(rtx_insn*)
/repo/gcc-trunk/gcc/recog.c:2670
0xfae7cc copyprop_hardreg_forward_1
/repo/gcc-trunk/gcc/regcprop.c:831
0xfaf9fe execute
/repo/gcc-trunk/gcc/regcprop.c:1396
Please submit a full bug report,
with preprocessed source if appropriate.
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-r11-7439-20210301075850-g074226d5aa8-checking-yes-rtl-df-extra-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/11.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-r11-7439-20210301075850-g074226d5aa8-checking-yes-rtl-df-extra-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 11.0.1 20210301 (experimental) (GCC)

[Bug target/98853] New: [11 Regression] wrong use of bfxil at -O1

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

Bug ID: 98853
   Summary: [11 Regression] wrong use of bfxil at -O1
   Product: gcc
   Version: 11.0
Status: UNCONFIRMED
  Keywords: wrong-code
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: aarch64-unknown-linux-gnu

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

Output:
$ aarch64-unknown-linux-gnu-gcc -O testcase.c -static
$ ./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-r11-6925-20210127102218-g6cf43433750-checking-yes-rtl-df-extra-aarch64/bin/../libexec/gcc/aarch64-unknown-linux-gnu/11.0.0/lto-wrapper
Target: aarch64-unknown-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--with-cloog --with-ppl --with-isl
--with-sysroot=/usr/aarch64-unknown-linux-gnu --build=x86_64-pc-linux-gnu
--host=x86_64-pc-linux-gnu --target=aarch64-unknown-linux-gnu
--with-ld=/usr/bin/aarch64-unknown-linux-gnu-ld
--with-as=/usr/bin/aarch64-unknown-linux-gnu-as --disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r11-6925-20210127102218-g6cf43433750-checking-yes-rtl-df-extra-aarch64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 11.0.0 20210127 (experimental) (GCC)

[Bug target/98807] New: [11 Regression] wrong code with -O2 -mno-sse2

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

Bug ID: 98807
   Summary: [11 Regression] wrong code with -O2 -mno-sse2
   Product: gcc
   Version: 11.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 50044
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=50044&action=edit
reduced testcase

Output:
$ x86_64-pc-linux-gnu-gcc -O2 testcase.c && ./a.out
$ x86_64-pc-linux-gnu-gcc -O2 testcase.c -mno-sse2 && ./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-r11-6878-20210123002417-ga8cef3cba69-checking-yes-rtl-df-extra-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/11.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--with-cloog --with-ppl --with-isl --build=x86_64-pc-linux-gnu
--host=x86_64-pc-linux-gnu --target=x86_64-pc-linux-gnu
--with-ld=/usr/bin/x86_64-pc-linux-gnu-ld
--with-as=/usr/bin/x86_64-pc-linux-gnu-as --disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r11-6878-20210123002417-ga8cef3cba69-checking-yes-rtl-df-extra-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 11.0.0 20210123 (experimental) (GCC)

[Bug rtl-optimization/98793] New: [11 Regression] wrong code with --param=max-jump-thread-duplication-stmts=4

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

Bug ID: 98793
   Summary: [11 Regression] wrong code with
--param=max-jump-thread-duplication-stmts=4
   Product: gcc
   Version: 11.0
Status: UNCONFIRMED
  Keywords: wrong-code
  Severity: normal
  Priority: P3
 Component: rtl-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu

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

Output:
$ x86_64-pc-linux-gnu-gcc -O2 --param=max-jump-thread-duplication-stmts=3
testcase.c -Wno-psabi && ./a.out
$ x86_64-pc-linux-gnu-gcc -O2 --param=max-jump-thread-duplication-stmts=4
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-r11-6849-20210122123514-gee78c20e74d-checking-yes-rtl-df-extra-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/11.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--with-cloog --with-ppl --with-isl --build=x86_64-pc-linux-gnu
--host=x86_64-pc-linux-gnu --target=x86_64-pc-linux-gnu
--with-ld=/usr/bin/x86_64-pc-linux-gnu-ld
--with-as=/usr/bin/x86_64-pc-linux-gnu-as --disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r11-6849-20210122123514-gee78c20e74d-checking-yes-rtl-df-extra-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 11.0.0 20210122 (experimental) (GCC) 

I am unable to further reduce the testcase. I have several similar testcases,
all seem to be related to higher values of
--param=max-jump-thread-duplication-stmts=

[Bug rtl-optimization/98287] [10/11 Regression] ICE: in expand_expr_real_2, at expr.c:10000 with -O2 -fno-tree-ccp -fno-tree-forwprop

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

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

$ x86_64-pc-linux-gnu-gcc -Og -fipa-cp another_testcase.c
during RTL pass: expand
another_testcase.c: In function 'bar.constprop':
another_testcase.c:7:23: internal compiler error: in expand_expr_real_2, at
expr.c:1
7 |   return v << (s & 3) >> (s & 3);
  |  ~^~
0x667803 expand_expr_real_2(separate_ops*, rtx_def*, machine_mode,
expand_modifier)
/repo/gcc-trunk/gcc/expr.c:1
0xc280cb expand_expr_real_1(tree_node*, rtx_def*, machine_mode,
expand_modifier, rtx_def**, bool)
/repo/gcc-trunk/gcc/expr.c:10201
0xaf2b5b expand_expr
/repo/gcc-trunk/gcc/expr.h:282
0xaf2b5b expand_return
/repo/gcc-trunk/gcc/cfgexpand.c:3764
0xaf2b5b expand_gimple_stmt_1
/repo/gcc-trunk/gcc/cfgexpand.c:3873
0xaf2b5b expand_gimple_stmt
/repo/gcc-trunk/gcc/cfgexpand.c:3999
0xaf80fb expand_gimple_basic_block
/repo/gcc-trunk/gcc/cfgexpand.c:6036
0xaf9c76 execute
/repo/gcc-trunk/gcc/cfgexpand.c:6720
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See  for instructions.

[Bug target/98403] New: [11 Regression] ICE: in add_def, at rtl-ssa/accesses.cc:837 with -Og -march=goldmont -fPIC -fcse-follow-jumps -fipa-ra -mforce-indirect-call

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

Bug ID: 98403
   Summary: [11 Regression] ICE: in add_def, at
rtl-ssa/accesses.cc:837 with -Og -march=goldmont -fPIC
-fcse-follow-jumps -fipa-ra -mforce-indirect-call
   Product: gcc
   Version: 11.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 49815
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=49815&action=edit
auto-reduced testcase (from OpenTTD sources)

Compiler output:
$ x86_64-pc-linux-gnu-gcc -Og -march=goldmont -fPIC -fcse-follow-jumps -fipa-ra
-mforce-indirect-call ai_gui.ii
during RTL pass: fwprop1
ai_gui.ii: In function 'void __static_initialization_and_destruction_0(int,
int)':
ai_gui.ii:191:58: internal compiler error: in add_def, at
rtl-ssa/accesses.cc:837
  191 | SetDataTip(2, 3)};
  |  ^
0xa44aac rtl_ssa::function_info::add_def(rtl_ssa::def_info*)
/repo/gcc-trunk/gcc/rtl-ssa/accesses.cc:837
0x1e06fed rtl_ssa::function_info::apply_changes_to_insn(rtl_ssa::insn_change&)
/repo/gcc-trunk/gcc/rtl-ssa/changes.cc:540
0x1e0976f
rtl_ssa::function_info::change_insns(array_slice)
/repo/gcc-trunk/gcc/rtl-ssa/changes.cc:707
0x1e09957 rtl_ssa::function_info::change_insn(rtl_ssa::insn_change&)
/repo/gcc-trunk/gcc/rtl-ssa/changes.cc:715
0x1cdea78 try_fwprop_subst_pattern
/repo/gcc-trunk/gcc/fwprop.c:530
0x1cdea78 try_fwprop_subst
/repo/gcc-trunk/gcc/fwprop.c:603
0x1cdf1a0 forward_propagate_and_simplify
/repo/gcc-trunk/gcc/fwprop.c:801
0x1cdf1a0 forward_propagate_into
/repo/gcc-trunk/gcc/fwprop.c:861
0x1cdf48b forward_propagate_into
/repo/gcc-trunk/gcc/fwprop.c:813
0x1cdf48b fwprop_insn
/repo/gcc-trunk/gcc/fwprop.c:918
0x1cdf569 fwprop
/repo/gcc-trunk/gcc/fwprop.c:970
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

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

[Bug rtl-optimization/98287] New: [10/11 Regression] ICE: in expand_expr_real_2, at expr.c:10000 with -O2 -fno-tree-ccp -fno-tree-forwprop

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

Bug ID: 98287
   Summary: [10/11 Regression] ICE: in expand_expr_real_2, at
expr.c:1 with -O2 -fno-tree-ccp -fno-tree-forwprop
   Product: gcc
   Version: 11.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: rtl-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu

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

Compiler output:
$ x86_64-pc-linux-gnu-gcc -O2 -fno-tree-ccp -fno-tree-forwprop testcase.c
during RTL pass: expand
testcase.c: In function 'bar':
testcase.c:7:22: internal compiler error: in expand_expr_real_2, at
expr.c:1
7 |   return v >> s << s | v >> s >> 63;
  |  ^~
0x661c3d expand_expr_real_2(separate_ops*, rtx_def*, machine_mode,
expand_modifier)
/repo/gcc-trunk/gcc/expr.c:1
0xc21188 expand_expr_real_1(tree_node*, rtx_def*, machine_mode,
expand_modifier, rtx_def**, bool)
/repo/gcc-trunk/gcc/expr.c:10201
0xaeb6ab expand_expr
/repo/gcc-trunk/gcc/expr.h:282
0xaeb6ab expand_return
/repo/gcc-trunk/gcc/cfgexpand.c:3764
0xaeb6ab expand_gimple_stmt_1
/repo/gcc-trunk/gcc/cfgexpand.c:3873
0xaeb6ab expand_gimple_stmt
/repo/gcc-trunk/gcc/cfgexpand.c:3999
0xaf0c4b expand_gimple_basic_block
/repo/gcc-trunk/gcc/cfgexpand.c:6036
0xaf27c6 execute
/repo/gcc-trunk/gcc/cfgexpand.c:6720
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

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

[Bug tree-optimization/98272] New: [11 Regression] ICE: during GIMPLE pass: switchlower: in decompose, at wide-int.h:984 with -O -fno-tree-forwprop

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

Bug ID: 98272
   Summary: [11 Regression] ICE: during GIMPLE pass: switchlower:
in decompose, at wide-int.h:984 with -O
-fno-tree-forwprop
   Product: gcc
   Version: 11.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

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

Compiler output:
$ x86_64-pc-linux-gnu-gcc -O -fno-tree-forwprop testcase.c 
during GIMPLE pass: switchlower
testcase.c: In function 'foo':
testcase.c:4:1: internal compiler error: in decompose, at wide-int.h:984
4 | foo (unsigned char uc)
  | ^~~
0x61a4c0 wi::int_traits >
>::decompose(long*, unsigned int, generic_wide_int > const&)
/repo/gcc-trunk/gcc/wide-int.h:984
0xac2400 wi::int_traits >::decompose(long*,
unsigned int, generic_wide_int const&)
/repo/gcc-trunk/gcc/wide-int.h:1933
0xac2400 wide_int_ref_storage::wide_int_ref_storage
>(generic_wide_int const&, unsigned int)
/repo/gcc-trunk/gcc/wide-int.h:1034
0xac2400 generic_wide_int
>::generic_wide_int
>(generic_wide_int const&, unsigned int)
/repo/gcc-trunk/gcc/wide-int.h:790
0xac2400 bool wi::ltu_p,
generic_wide_int >(generic_wide_int const&,
generic_wide_int const&)
/repo/gcc-trunk/gcc/wide-int.h:1937
0x10aa543 bool wi::lt_p,
generic_wide_int >(generic_wide_int const&,
generic_wide_int const&, signop)
/repo/gcc-trunk/gcc/wide-int.h:1963
0x10aa543 tree_switch_conversion::bit_test_cluster::emit(tree_node*,
tree_node*, tree_node*, basic_block_def*)
/repo/gcc-trunk/gcc/tree-switch-conversion.c:1562
0x10aac3b
tree_switch_conversion::switch_decision_tree::try_switch_expansion(vec&)
/repo/gcc-trunk/gcc/tree-switch-conversion.c:1893
0x10ab413
tree_switch_conversion::switch_decision_tree::analyze_switch_statement()
/repo/gcc-trunk/gcc/tree-switch-conversion.c:1823
0x10ac217 execute
/repo/gcc-trunk/gcc/tree-switch-conversion.c:2570
Please submit a full bug report,
with preprocessed source if appropriate.
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-r11-5984-20201214092247-gcf7efe2d36f-checking-yes-rtl-df-extra-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/11.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--with-cloog --with-ppl --with-isl --build=x86_64-pc-linux-gnu
--host=x86_64-pc-linux-gnu --target=x86_64-pc-linux-gnu
--with-ld=/usr/bin/x86_64-pc-linux-gnu-ld
--with-as=/usr/bin/x86_64-pc-linux-gnu-as --disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r11-5984-20201214092247-gcf7efe2d36f-checking-yes-rtl-df-extra-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 11.0.0 20201214 (experimental) (GCC)

[Bug rtl-optimization/97777] New: ICE: in df_refs_verify, at df-scan.c:3991 with -O -ffinite-math-only -fzero-call-used-regs=all

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

Bug ID: 9
   Summary: ICE: in df_refs_verify, at df-scan.c:3991 with -O
-ffinite-math-only -fzero-call-used-regs=all
   Product: gcc
   Version: 11.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: rtl-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: zsojka at seznam dot cz
  Target Milestone: ---
  Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu

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

The compiler is configured with --enable-checking=yes,rtl,df,extra

Compiler output:
$ x86_64-pc-linux-gnu-gcc -O -ffinite-math-only -fzero-call-used-regs=all
testcase.c
during RTL pass: zero_call_used_regs
testcase.c: In function 'foo':
testcase.c:5:1: internal compiler error: in df_refs_verify, at df-scan.c:3991
5 | }
  | ^
0x63bf73 df_refs_verify
/repo/gcc-trunk/gcc/df-scan.c:3991
0xbd44a6 df_insn_refs_verify
/repo/gcc-trunk/gcc/df-scan.c:4074
0xbd644c df_bb_verify
/repo/gcc-trunk/gcc/df-scan.c:4107
0xbd6807 df_scan_verify()
/repo/gcc-trunk/gcc/df-scan.c:4228
0xbc0757 df_verify()
/repo/gcc-trunk/gcc/df-core.c:1818
0xbc0757 df_analyze_1
/repo/gcc-trunk/gcc/df-core.c:1214
0xce77ec execute
/repo/gcc-trunk/gcc/function.c:6656
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

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

[Bug target/97521] New: [11 Regression] wrong code with -mno-sse2

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

Bug ID: 97521
   Summary: [11 Regression] wrong code with -mno-sse2
   Product: gcc
   Version: 11.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 49415
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=49415&action=edit
reduced testcase

Output:
$ x86_64-pc-linux-gnu-gcc -O -mno-sse2 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-r11-4185-20201021114306-gd9409301387-checking-yes-rtl-df-extra-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/11.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--with-cloog --with-ppl --with-isl --build=x86_64-pc-linux-gnu
--host=x86_64-pc-linux-gnu --target=x86_64-pc-linux-gnu
--with-ld=/usr/bin/x86_64-pc-linux-gnu-ld
--with-as=/usr/bin/x86_64-pc-linux-gnu-as --disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r11-4185-20201021114306-gd9409301387-checking-yes-rtl-df-extra-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 11.0.0 20201021 (experimental) (GCC)

[Bug target/97506] New: [11 Regression] ICE: in extract_insn, at recog.c:2294 (unrecognizable insn) with -mavx512vbmi -mavx512vl

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

Bug ID: 97506
   Summary: [11 Regression] ICE: in extract_insn, at recog.c:2294
(unrecognizable insn) with -mavx512vbmi -mavx512vl
   Product: gcc
   Version: 11.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 49410
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=49410&action=edit
reduced testcase

Compiler output:
$ x86_64-pc-linux-gnu-gcc -Og -finline-functions-called-once -fno-tree-ccp
-mavx512vbmi -mavx512vl testcase.c 
testcase.c: In function 'foo':
testcase.c:15:1: error: unrecognizable insn:
   15 | }
  | ^
(insn 9 8 10 2 (set (reg:V16QI 84 [ _8 ])
(vec_merge:V16QI (const_vector:V16QI [
(const_int 0 [0]) repeated x16
])
(const_vector:V16QI [
(const_int 0 [0]) repeated x16
])
(reg:HI 90))) "testcase.c":8:17 -1
 (nil))
during RTL pass: vregs
testcase.c:15:1: internal compiler error: in extract_insn, at recog.c:2294
0x6ef463 _fatal_insn(char const*, rtx_def const*, char const*, int, char
const*)
/repo/gcc-trunk/gcc/rtl-error.c:108
0x6ef4e6 _fatal_insn_not_found(rtx_def const*, char const*, int, char const*)
/repo/gcc-trunk/gcc/rtl-error.c:116
0x6de26e extract_insn(rtx_insn*)
/repo/gcc-trunk/gcc/recog.c:2294
0xce62b3 instantiate_virtual_regs_in_insn
/repo/gcc-trunk/gcc/function.c:1607
0xce62b3 instantiate_virtual_regs
/repo/gcc-trunk/gcc/function.c:1977
0xce62b3 execute
/repo/gcc-trunk/gcc/function.c:2026
Please submit a full bug report,
with preprocessed source if appropriate.
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-r11-4031-20201019090534-g04ffed2ef29-checking-yes-rtl-df-extra-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/11.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--with-cloog --with-ppl --with-isl --build=x86_64-pc-linux-gnu
--host=x86_64-pc-linux-gnu --target=x86_64-pc-linux-gnu
--with-ld=/usr/bin/x86_64-pc-linux-gnu-ld
--with-as=/usr/bin/x86_64-pc-linux-gnu-as --disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r11-4031-20201019090534-g04ffed2ef29-checking-yes-rtl-df-extra-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 11.0.0 20201019 (experimental) (GCC)

[Bug tree-optimization/97386] New: [8/9/10/11 Regression] wrong code with __builtin_bswap16() of rotated 64bit value

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

Bug ID: 97386
   Summary: [8/9/10/11 Regression] wrong code with
__builtin_bswap16() of rotated 64bit value
   Product: gcc
   Version: 11.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: ---

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

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

The code in fact rotates 0x00 instead of 0x.

foo:
mov rcx, QWORD PTR c[rip]
mov eax, 13421568 # 0x00
rol rax, cl
ret

$ 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-r11-3806-20201012001625-g2baa36d4911-checking-yes-rtl-df-extra-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/11.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--with-cloog --with-ppl --with-isl --build=x86_64-pc-linux-gnu
--host=x86_64-pc-linux-gnu --target=x86_64-pc-linux-gnu
--with-ld=/usr/bin/x86_64-pc-linux-gnu-ld
--with-as=/usr/bin/x86_64-pc-linux-gnu-as --disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r11-3806-20201012001625-g2baa36d4911-checking-yes-rtl-df-extra-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 11.0.0 20201012 (experimental) (GCC)

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