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

2024-02-08 Thread mjires at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113390

Michal Jireš  changed:

   What|Removed |Added

   Keywords|needs-bisection |
 CC||mjires at gcc dot gnu.org,
   ||pinskia at gcc dot gnu.org

--- Comment #1 from Michal Jireš  ---
Bisected to r14-7114-g113475d03b0ab1.

[Bug debug/113519] [14 Regression] ICE: in replace_child, at dwarf2out.cc:5704 with -g -fdebug-types-section -fsso-struct=big-endian (or little-endian if the target is big-endian)

2024-02-08 Thread mjires at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113519

Michal Jireš  changed:

   What|Removed |Added

   Keywords|needs-bisection |
 CC||ebotcazou at gcc dot gnu.org,
   ||mjires at gcc dot gnu.org
   Last reconfirmed|2024-01-20 00:00:00 |2024-2-8

--- Comment #4 from Michal Jireš  ---
Bisected to r14-7098-g5d8b60effc7268.

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

2024-02-08 Thread mjires at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113673

Michal Jireš  changed:

   What|Removed |Added

   Last reconfirmed|2024-01-30 00:00:00 |2024-2-8
   Keywords|needs-bisection |
 CC||mjires at gcc dot gnu.org,
   ||roger at nextmovesoftware dot 
com

--- Comment #3 from Michal Jireš  ---
Bisected to r12-5453-ga944b5dec3adb2.

[Bug c/114058] New: ICE: _BitInt + asan: tree check: expected ssa_name, have view_convert_expr in has_zero_uses, at ssa-iterators.h:389

2024-02-22 Thread mjires at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114058

Bug ID: 114058
   Summary: ICE: _BitInt + asan: tree check: expected ssa_name,
have view_convert_expr in has_zero_uses, at
ssa-iterators.h:389
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: mjires at gcc dot gnu.org
CC: jakub at redhat dot com
  Target Milestone: ---

Compiling reduced testcase gcc.dg/torture/bitint-35.c results in ICE, since
_BitInt was introduced in r14-3751-g8c984a1c3693df.

$ cat bitint-35.c
_BitInt(129) foo() {
  _BitInt(129) r;
  &r;
}


$ gcc bitint-35.c -fsanitize=address -Og -fno-tree-dce
during GIMPLE pass: sanopt
bitint-35.c: In function ‘foo’:
bitint-35.c:1:14: internal compiler error: tree check: expected ssa_name, have
view_convert_expr in has_zero_uses, at ssa-iterators.h:389
1 | _BitInt(129) foo() {
  |  ^~~
0x1ac77e1 tree_check_failed(tree_node const*, char const*, int, char const*,
...)
/home/mjires/git/GCC/master/gcc/tree.cc:8955
0xd2f6f5 tree_check(tree_node const*, char const*, int, char const*, tree_code)
/home/mjires/git/GCC/master/gcc/tree.h:3900
0xfa0dfd has_zero_uses(tree_node const*)
/home/mjires/git/GCC/master/gcc/ssa-iterators.h:389
0x1714f27 asan_expand_poison_ifn(gimple_stmt_iterator*, bool*,
hash_map, tree_node*> >&)
/home/mjires/git/GCC/master/gcc/asan.cc:4104
0x172b021 execute
/home/mjires/git/GCC/master/gcc/sanopt.cc:1382
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See  for instructions.


$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/home/mjires/built/master/libexec/gcc/x86_64-pc-linux-gnu/14.0.1/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /home/mjires/git/GCC/master/configure
--prefix=/home/mjires/built/master --disable-bootstrap
--enable-languages=c,c++,fortran,lto --disable-multilib --disable-libsanitizer
--enable-checking : (reconfigured) /home/mjires/git/GCC/master/configure
--prefix=/home/mjires/built/master --disable-bootstrap
--enable-languages=c,c++,fortran,lto --disable-multilib --disable-libsanitizer
--enable-checking
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.1 20240222 (experimental) (GCC)

[Bug target/114059] New: ICE in extract_insn, at recog.cc:2812 | sme2 vs -fsanitize=address -mtrack-speculation -fharden-control-flow-redundancy

2024-02-22 Thread mjires at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114059

Bug ID: 114059
   Summary: ICE in extract_insn, at recog.cc:2812 | sme2 vs
-fsanitize=address -mtrack-speculation
-fharden-control-flow-redundancy
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: mjires at gcc dot gnu.org
CC: rsandifo at gcc dot gnu.org
  Target Milestone: ---

Compiling reduced testcase gcc.target/aarch64/sme/sibcall_9.c results in ICE,
since sme2 was introduced in r14-6175-g3b58b2205ffdce.

$ cat sibcall_9.c
#pragma GCC target "+sme2"
void caller_preserves() __arm_inout("za") {}


$ aarch64-linux-gnu-gcc sibcall_9.c -fsanitize=address -mtrack-speculation
-fharden-control-flow-redundancy
sibcall_9.c: In function ‘caller_preserves’:
sibcall_9.c:2:44: error: unrecognizable insn:
2 | void caller_preserves() __arm_inout("za") {}
  |^
(jump_insn 156 155 157 (set (pc)
(if_then_else (ne (reg:DI 16 x16)
(const_int 0 [0]))
(label_ref 160)
(pc))) -1
 (int_list:REG_BR_PROB 1073204964 (nil))
 -> 160)
during RTL pass: split5
sibcall_9.c:2:44: internal compiler error: in extract_insn, at recog.cc:2812
0x16f34de _fatal_insn(char const*, rtx_def const*, char const*, int, char
const*)
/home/mjires/git/GCC/master/gcc/rtl-error.cc:108
0x16f351f _fatal_insn_not_found(rtx_def const*, char const*, int, char const*)
/home/mjires/git/GCC/master/gcc/rtl-error.cc:116
0x16a4044 extract_insn(rtx_insn*)
/home/mjires/git/GCC/master/gcc/recog.cc:2812
0x16a3d03 extract_insn_cached(rtx_insn*)
/home/mjires/git/GCC/master/gcc/recog.cc:2701
0x1203628 cleanup_subreg_operands(rtx_insn*)
/home/mjires/git/GCC/master/gcc/final.cc:3053
0x16a581d split_insn
/home/mjires/git/GCC/master/gcc/recog.cc:3441
0x16a5b01 split_all_insns_noflow()
/home/mjires/git/GCC/master/gcc/recog.cc:3567
0x16a7b40 execute
/home/mjires/git/GCC/master/gcc/recog.cc:4641
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See  for instructions.


$ aarch64-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=aarch64-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/home/mjires/built/master/libexec/gcc/aarch64-linux-gnu/14.0.1/lto-wrapper
Target: aarch64-linux-gnu
Configured with: /home/mjires/git/GCC/master/configure
--prefix=/home/mjires/built/master --target=aarch64-linux-gnu
--disable-bootstrap --enable-languages=c,c++,fortran --disable-multilib
--disable-libsanitizer --enable-checking : (reconfigured)
/home/mjires/git/GCC/master/configure --prefix=/home/mjires/built/master
--target=aarch64-linux-gnu --disable-bootstrap --enable-languages=c,c++,fortran
--disable-multilib --disable-libsanitizer --enable-checking
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 14.0.1 20240222 (experimental) (GCC)

[Bug c++/114772] New: pragma GCC target applied to earlier template function with __attribute__((warn_unused_result))

2024-04-18 Thread mjires at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114772

Bug ID: 114772
   Summary: pragma GCC target applied to earlier template function
with __attribute__((warn_unused_result))
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: mjires at gcc dot gnu.org
CC: jamborm at gcc dot gnu.org
  Target Milestone: ---

Following minimized testcase fails depending on warn_unused_result attribute.
Fails at least since GCC 10.

$ cat simdjson.cpp
template
inline __attribute__((always_inline))
#ifdef FAIL
__attribute__((warn_unused_result))
#endif
int walk_document(V visitor) {return 0;}

template
void parse_document() {
int r = walk_document(false);
}

void stage2_next() {
parse_document();
}

#pragma GCC target("pclmul")



$ gcc simdjson.cpp -DFAIL
simdjson.cpp: In function ‘void parse_document() [with bool STREAMING = true]’:
simdjson.cpp:6:5: error: inlining failed in call to ‘always_inline’ ‘int
walk_document(V) [with V = bool; bool STREAMING = true]’: target specific
option mismatch
6 | int walk_document(V visitor) {return 0;}
  | ^
simdjson.cpp:10:43: note: called from here
   10 | int r = walk_document(false);
  | ~~^~~



Without __attribute__((warn_unused_result)) it compiles without problems.

Inlining is denied in ix86_can_inline_p, because:
caller: void parse_document() [with bool STREAMING = true]/1
callee: int walk_document(V) [with V = bool; bool STREAMING = true]/2
caller_opts->x_ix86_isa_flags: 000c00110012
callee_opts->x_ix86_isa_flags: 000c00910012
So they differ by OPTION_MASK_ISA_PCLMUL

Source of this difference seems to be attribs.cc:decl_attributes, which is
called during template instantiation, but uses global_options.

[Bug lto/118181] gcc/lto-ltrans-cache.cc:312: Avoid call by value for large objects

2025-01-12 Thread mjires at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118181

Michal Jireš  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |FIXED

--- Comment #2 from Michal Jireš  ---
Fixed.

[Bug target/118489] New: [15 Regression][avx512] ICE in ix86_expand_vector_bf2sf_with_vec_perm, at config/i386/i386-expand.cc:26917 since r15-4955-g648bd1fcc6acfc

2025-01-15 Thread mjires at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118489

Bug ID: 118489
   Summary: [15 Regression][avx512] ICE in
ix86_expand_vector_bf2sf_with_vec_perm, at
config/i386/i386-expand.cc:26917 since
r15-4955-g648bd1fcc6acfc
   Product: gcc
   Version: 15.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: mjires at gcc dot gnu.org
CC: liuhongt at gcc dot gnu.org
  Target Milestone: ---
Target: x86-64

Compiling reduced testcase gcc.target/i386/avx512bw-extendbf2sf.c results in
ICE since r15-4955-g648bd1fcc6acfc.

$ cat avx512bw-extendbf2sf.c
typedef float v16sf __attribute__((vector_size(64)));
__attribute__((__vector_size__(16 * sizeof(__bf16 __bf16 foo3_mem_a;
v16sf foo3_mem() { return __builtin_convertvector(foo3_mem_a, v16sf); }


$ gcc avx512bw-extendbf2sf.c -ffinite-math-only -mavx512f
during RTL pass: expand
avx512bw-extendbf2sf.c: In function ‘foo3_mem’:
avx512bw-extendbf2sf.c:3:27: internal compiler error: in
ix86_expand_vector_bf2sf_with_vec_perm, at config/i386/i386-expand.cc:26951
3 | v16sf foo3_mem() { return __builtin_convertvector(foo3_mem_a, v16sf); }
  |   ^~
0x36ef415 internal_error(char const*, ...)
/home/mjires/git/GCC/master/gcc/diagnostic-global-context.cc:517
0x36bee4b fancy_abort(char const*, int, char const*)
/home/mjires/git/GCC/master/gcc/diagnostic.cc:1722
0x1fc24f0 ix86_expand_vector_bf2sf_with_vec_perm(rtx_def*, rtx_def*)
/home/mjires/git/GCC/master/gcc/config/i386/i386-expand.cc:26951
0x2a46d24 gen_extendv16bfv16sf2(rtx_def*, rtx_def*)
/home/mjires/git/GCC/master/gcc/config/i386/sse.md:31158
0x10c0ab4 rtx_insn* insn_gen_fn::operator()(rtx_def*,
rtx_def*) const
/home/mjires/git/GCC/master/gcc/recog.h:472
0x168f0bc maybe_gen_insn(insn_code, unsigned int, expand_operand*)
/home/mjires/git/GCC/master/gcc/optabs.cc:8192
0x1683f97 maybe_emit_unop_insn(insn_code, rtx_def*, rtx_def*, rtx_code)
/home/mjires/git/GCC/master/gcc/optabs.cc:4094
0x1684088 emit_unop_insn(insn_code, rtx_def*, rtx_def*, rtx_code)
/home/mjires/git/GCC/master/gcc/optabs.cc:4118
0x128375a convert_move(rtx_def*, rtx_def*, int)
/home/mjires/git/GCC/master/gcc/expr.cc:283
0x12a9360 expand_expr_real_2(separate_ops const*, rtx_def*, machine_mode,
expand_modifier)
/home/mjires/git/GCC/master/gcc/expr.cc:9889
0x12af0cf expand_expr_real_gassign(gassign*, rtx_def*, machine_mode,
expand_modifier, rtx_def**, bool)
/home/mjires/git/GCC/master/gcc/expr.cc:11186
0x10f5406 expand_gimple_stmt_1
/home/mjires/git/GCC/master/gcc/cfgexpand.cc:4300
0x10f56bd expand_gimple_stmt
/home/mjires/git/GCC/master/gcc/cfgexpand.cc:4364
0x10fd86c expand_gimple_basic_block
/home/mjires/git/GCC/master/gcc/cfgexpand.cc:6427
0x10fff43 execute
/home/mjires/git/GCC/master/gcc/cfgexpand.cc:7176
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See  for instructions.


$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/home/mjires/built/master/libexec/gcc/x86_64-pc-linux-gnu/15.0.1/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /home/mjires/git/GCC/master/configure
--prefix=/home/mjires/built/master --disable-bootstrap
--enable-languages=c,c++,fortran,lto --disable-multilib --disable-libsanitizer
--enable-checking
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 15.0.1 20250115 (experimental) (GCC)

[Bug middle-end/118490] New: [15 Regression] ICE Indefinite recursion transforming exp-log with -frounding-math since r15-5116-ge232dc3bb5c3e8

2025-01-15 Thread mjires at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118490

Bug ID: 118490
   Summary: [15 Regression] ICE Indefinite recursion transforming
exp-log with -frounding-math since
r15-5116-ge232dc3bb5c3e8
   Product: gcc
   Version: 15.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: middle-end
  Assignee: unassigned at gcc dot gnu.org
  Reporter: mjires at gcc dot gnu.org
CC: soumyaa at gcc dot gnu.org
  Target Milestone: ---

Compiling reduced testcase gcc.dg/builtins-17.c results in ICE since
r15-5116-ge232dc3bb5c3e8.
Backtrace shows indefinite recursion switching between generic_simplify_365
(exps) and generic_simplify_366 (logs) which were added in mentioned patch.

$ cat builtins-17.c
double exp(double);
int foo(int v) {
return v && exp(1.) < 2.;
}


$ gcc builtins-17.c -ffast-math -frounding-math -Wlogical-op
gcc: internal compiler error: Segmentation fault signal terminated program cc1
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
See  for instructions.


$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/home/mjires/built/master/libexec/gcc/x86_64-pc-linux-gnu/15.0.1/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /home/mjires/git/GCC/master/configure
--prefix=/home/mjires/built/master --disable-bootstrap
--enable-languages=c,c++,fortran,lto --disable-multilib --disable-libsanitizer
--enable-checking
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 15.0.1 20250115 (experimental) (GCC)

[Bug tree-optimization/118487] New: [15 Regression] ICE tree check: expected vector_cst, have ssa_name in vector_cst_encoded_nelts, at tree.h:4683 since r15-5563-g1c4d39ada33d36

2025-01-15 Thread mjires at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118487

Bug ID: 118487
   Summary: [15 Regression] ICE tree check: expected vector_cst,
have ssa_name in vector_cst_encoded_nelts, at
tree.h:4683 since r15-5563-g1c4d39ada33d36
   Product: gcc
   Version: 15.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: mjires at gcc dot gnu.org
CC: cmuellner at gcc dot gnu.org
  Target Milestone: ---

Compiling reduced testcase gcc.dg/tree-ssa/vector-11.c results in ICE since
r15-5563-g1c4d39ada33d36.

$ cat vector-11.c
typedef int vec __attribute__((vector_size(16)));
vec f1_p_v_in, f1_sel00, f1_sel11, f1_sel, f1_v_out_2;
void f1() {
  vec v_1, v_2, v_x, v_y;
  v_1 = __builtin_shuffle(f1_p_v_in, f1_sel00);
  v_2 = __builtin_shuffle(f1_p_v_in, f1_sel11);
  v_x = v_2 - v_1;
  v_y = v_1 + v_2;
  f1_v_out_2 = __builtin_shuffle(v_y, v_x, f1_sel);
}


$ gcc vector-11.c -Ofast
during GIMPLE pass: forwprop
vector-11.c: In function ‘f1’:
vector-11.c:3:6: internal compiler error: tree check: expected vector_cst, have
ssa_name in vector_cst_encoded_nelts, at tree.h:4720
3 | void f1() {
  |  ^~
0x36ef415 internal_error(char const*, ...)
/home/mjires/git/GCC/master/gcc/diagnostic-global-context.cc:517
0x1cd0691 tree_check_failed(tree_node const*, char const*, int, char const*,
...)
/home/mjires/git/GCC/master/gcc/tree.cc:9044
0xe66065 tree_check(tree_node const*, char const*, int, char const*, tree_code)
/home/mjires/git/GCC/master/gcc/tree.h:3975
0xea5f28 vector_cst_encoded_nelts(tree_node const*)
/home/mjires/git/GCC/master/gcc/tree.h:4720
0x1cd7a8a vector_cst_elt(tree_node const*, unsigned int)
/home/mjires/git/GCC/master/gcc/tree.cc:10419
0x1a51b5a recognise_vec_perm_simplify_seq
/home/mjires/git/GCC/master/gcc/tree-ssa-forwprop.cc:3632
0x1a55930 execute
/home/mjires/git/GCC/master/gcc/tree-ssa-forwprop.cc:4553
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See  for instructions.


$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/home/mjires/built/master/libexec/gcc/x86_64-pc-linux-gnu/15.0.1/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /home/mjires/git/GCC/master/configure
--prefix=/home/mjires/built/master --disable-bootstrap
--enable-languages=c,c++,fortran,lto --disable-multilib --disable-libsanitizer
--enable-checking
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 15.0.1 20250115 (experimental) (GCC)

[Bug lto/118238] [15 Regression] gcc/lto-wrapper.cc uses link which is not recommend and does not exist on mingw

2025-01-14 Thread mjires at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118238

Michal Jireš  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 Status|ASSIGNED|RESOLVED

--- Comment #6 from Michal Jireš  ---
Fixed.

[Bug target/118510] New: [15 Regression][x86] ICE in extract_insn, at recog.cc:2869 with -mapxf since r15-5635-g1ff69000b50e8a

2025-01-16 Thread mjires at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118510

Bug ID: 118510
   Summary: [15 Regression][x86] ICE in extract_insn, at
recog.cc:2869 with -mapxf since
r15-5635-g1ff69000b50e8a
   Product: gcc
   Version: 15.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: mjires at gcc dot gnu.org
CC: ubizjak at gmail dot com
  Target Milestone: ---
Target: x86_64

Compiling reduced testcase gcc.dg/ipa/20040703-wpa.c results in ICE since
r15-5635-g1ff69000b50e8a.

$ cat 20040703-wpa.c
typedef struct cpp_num cpp_num;
struct cpp_num {
  int high;
  unsigned low;
  int overflow;
};
int num_rshift_n;
cpp_num num_lshift(cpp_num num) {
  num.low = num.low >> num_rshift_n | num.high << (32 - num_rshift_n);
  return num;
}


$ gcc 20040703-wpa.c -mapxf -O2
20040703-wpa.c: In function ‘num_lshift’:
20040703-wpa.c:11:1: error: unrecognizable insn:
   11 | }
  | ^
(insn 39 38 16 2 (parallel [
(set (reg:SI 124)
(ior:SI (lshiftrt:SI (reg:SI 120)
(and:QI (subreg:QI (reg:SI 98 [ num_rshift_n.0_1 ]) 0)
(const_int 31 [0x1f])))
(subreg:SI (ashift:DI (zero_extend:DI (subreg:SI (reg:DI
122 [ num ]) 0))
(minus:QI (const_int 32 [0x20])
(and:QI (subreg:QI (reg:SI 98 [
num_rshift_n.0_1 ]) 0)
(const_int 31 [0x1f] 0)))
(clobber (reg:CC 17 flags))
(set (mem/c:SI (plus:DI (reg/f:DI 19 frame)
(const_int -28 [0xffe4])) [1 num.low+0 S4
A32])
(reg:SI 124))
]) "20040703-wpa.c":9:37 -1
 (nil))
during RTL pass: subreg3
20040703-wpa.c:11:1: internal compiler error: in extract_insn, at recog.cc:2882
0x370010f internal_error(char const*, ...)
/home/mjires/git/GCC/master/gcc/diagnostic-global-context.cc:517
0x36cfabb fancy_abort(char const*, int, char const*)
/home/mjires/git/GCC/master/gcc/diagnostic.cc:1722
0x17e96a0 _fatal_insn(char const*, rtx_def const*, char const*, int, char
const*)
/home/mjires/git/GCC/master/gcc/rtl-error.cc:108
0x17e96e1 _fatal_insn_not_found(rtx_def const*, char const*, int, char const*)
/home/mjires/git/GCC/master/gcc/rtl-error.cc:116
0x1792f12 extract_insn(rtx_insn*)
/home/mjires/git/GCC/master/gcc/recog.cc:2882
0x34fe2be decompose_multiword_subregs
/home/mjires/git/GCC/master/gcc/lower-subreg.cc:1587
0x34fec65 execute
/home/mjires/git/GCC/master/gcc/lower-subreg.cc:1894
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See  for instructions.


$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/home/mjires/built/master/libexec/gcc/x86_64-pc-linux-gnu/15.0.1/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /home/mjires/git/GCC/master/configure
--prefix=/home/mjires/built/master --disable-bootstrap
--enable-languages=c,c++,fortran,lto --disable-multilib --disable-libsanitizer
--enable-checking
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 15.0.1 20250116 (experimental) (GCC)

[Bug tree-optimization/118517] ICE in single_succ_edge, at basic-block.h:332 since r15-5336-gcee7d080d5c2a5

2025-01-16 Thread mjires at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118517

--- Comment #1 from Michal Jireš  ---
The patch trips up on empty basic block without successors.
This block comes from DSE and can be fixed by:

--- a/gcc/tree-ssa-dse.cc
+++ b/gcc/tree-ssa-dse.cc
@@ -1396,8 +1396,9 @@ dse_optimize_call (gimple_stmt_iterator *gsi, sbitmap
live_bytes)
   if (!node)
 return false;

-  if (stmt_could_throw_p (cfun, stmt)
-  && !cfun->can_delete_dead_exceptions)
+  if ((stmt_could_throw_p (cfun, stmt)
+   && !cfun->can_delete_dead_exceptions)
+  || gimple_call_ctrl_altering_p (stmt))
 return false;

[Bug tree-optimization/118517] New: ICE in single_succ_edge, at basic-block.h:332 since r15-5336-gcee7d080d5c2a5

2025-01-16 Thread mjires at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118517

Bug ID: 118517
   Summary: ICE in single_succ_edge, at basic-block.h:332 since
r15-5336-gcee7d080d5c2a5
   Product: gcc
   Version: 15.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: mjires at gcc dot gnu.org
CC: hubicka at gcc dot gnu.org
  Target Milestone: ---

Compiling reduced testcase gcc.dg/torture/pr54824.c results in ICE since
r15-5336-gcee7d080d5c2a5.

$ cat pr54824.c
void __attribute__((noreturn)) bar(void) {
  __builtin_unreachable ();
}

int p;
void foo() {
  if (p) bar();
}


$ gcc pr54824.c -fno-ipa-pure-const -O1
during GIMPLE pass: local-fnsummary
pr54824.c: In function ‘foo’:
pr54824.c:8:1: internal compiler error: in single_succ_edge, at
basic-block.h:332
8 | }
  | ^
0x370010f internal_error(char const*, ...)
/home/mjires/git/GCC/master/gcc/diagnostic-global-context.cc:517
0x36cfabb fancy_abort(char const*, int, char const*)
/home/mjires/git/GCC/master/gcc/diagnostic.cc:1722
0x1108f5f single_succ_edge(basic_block_def const*)
/home/mjires/git/GCC/master/gcc/basic-block.h:332
0x14bfef7 builtin_unreachable_bb_p
/home/mjires/git/GCC/master/gcc/ipa-fnsummary.cc:2708
0x14c00e4 guards_builtin_unreachable
/home/mjires/git/GCC/master/gcc/ipa-fnsummary.cc:2730
0x14c04d2 find_necessary_statements
/home/mjires/git/GCC/master/gcc/ipa-fnsummary.cc:2805
0x14c0c6b analyze_function_body
/home/mjires/git/GCC/master/gcc/ipa-fnsummary.cc:2931
0x14c3257 compute_fn_summary(cgraph_node*, bool)
/home/mjires/git/GCC/master/gcc/ipa-fnsummary.cc:3473
0x14c3324 compute_fn_summary_for_current
/home/mjires/git/GCC/master/gcc/ipa-fnsummary.cc:3503
0x14c8d8c execute
/home/mjires/git/GCC/master/gcc/ipa-fnsummary.cc:5158
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See  for instructions.


$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/home/mjires/built/master/libexec/gcc/x86_64-pc-linux-gnu/15.0.1/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /home/mjires/git/GCC/master/configure
--prefix=/home/mjires/built/master --disable-bootstrap
--enable-languages=c,c++,fortran,lto --disable-multilib --disable-libsanitizer
--enable-checking
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 15.0.1 20250116 (experimental) (GCC)

[Bug preprocessor/118860] New: ICE Segfault with --param=file-cache-files= since r15-7431-g66af77cbed6c5b

2025-02-13 Thread mjires at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118860

Bug ID: 118860
   Summary: ICE Segfault with --param=file-cache-files= since
r15-7431-g66af77cbed6c5b
   Product: gcc
   Version: 15.0
Status: UNCONFIRMED
  Keywords: ice-on-valid-code
  Severity: normal
  Priority: P3
 Component: preprocessor
  Assignee: unassigned at gcc dot gnu.org
  Reporter: mjires at gcc dot gnu.org
CC: ak at gcc dot gnu.org
  Target Milestone: ---

Compiling reduced testcase g++.dg/other/pr31078.C results in ICE since
r15-7431-g66af77cbed6c5b.

$ cat pr31078.C
static void foo();


$ g++ pr31078.C --param=file-cache-files=80 -Wunused

g++: internal compiler error: Segmentation fault signal terminated program
cc1plus
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
See  for instructions.


$ g++ -v
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/home/mjires/built/master/libexec/gcc/x86_64-pc-linux-gnu/15.0.1/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /home/mjires/git/GCC/master/configure
--prefix=/home/mjires/built/master --disable-bootstrap
--enable-languages=c,c++,fortran,lto --disable-multilib --disable-libsanitizer
--enable-checking : (reconfigured) /home/mjires/git/GCC/master/configure
--prefix=/home/mjires/built/master --disable-bootstrap
--enable-languages=c,c++,fortran,lto --disable-multilib --disable-libsanitizer
--enable-checking
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 15.0.1 20250213 (experimental) (GCC)

[Bug ipa/119009] [15 regression] AArch64: Commit 'Node clones share order' (r15-6345-g0895aef01c64c3) causes regression in Snappy workload for -mcpu=neoverse-v2 with LTO

2025-03-03 Thread mjires at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119009

--- Comment #3 from Michal Jireš  ---
Thanks a lot for the script.

I have reproduced it:
# bad3714b - before my patch
BM_UIOVecSink/0   33.8 us   33.8 us   20659 bytes_per_second=2.82508G/s html
# 0895aef0 - my patch
BM_UIOVecSink/0   41.0 us   41.0 us   16890 bytes_per_second=2.32381G/s html

However current trunk shows the opposite:
# 3605e057 - trunk
BM_UIOVecSink/0   33.7 us   33.7 us   20161 bytes_per_second=2.82955G/s html
# revert patch
BM_UIOVecSink/0   39.9 us   39.9 us   17399 bytes_per_second=2.38832G/s html

Is it still a problem on your machine with current trunk?



Perf record/report of:
snappy_benchmark --benchmark_filter=BM_UIOVecSink/0
--benchmark_min_warmup_time=5 --benchmark_time_unit=us

shows regression in functions:
  61.46% void
snappy::SnappyDecompressor::DecompressAllTags(snappy::SnappyIOVecWriter*)
 
  25.65% snappy::(anonymous namespace)::IncrementalCopy(char const*, char*,
char*, char*)

relevant symbols:
_ZN6snappy18SnappyDecompressor17DecompressAllTagsINS_17SnappyIOVecWriterEEEvPT_ 
_ZN6snappy12_GLOBAL__N_1L15IncrementalCopyEPKcPcS3_S3_
are identical outside of address changes.

Changing alignment of DecompressAllTags with asm("nop; nop") or
__attribute__((aligned(128))) removes the regression.

19,023,629  branch-misses:u # bad3714b
53,781,446  branch-misses:u # 0895aef0
The underlying problem seems to be branch misses caused by different alignment,
but I cannot pinpoint any specific instruction(s) as a source.

I am not sure we can reliably prevent this. In any case, reliable solution
would be unrelated to my patch.

[Bug ipa/119009] [15 regression] AArch64: Commit 'Node clones share order' (r15-6345-g0895aef01c64c3) causes regression in Snappy workload for -mcpu=neoverse-v2 with LTO

2025-03-06 Thread mjires at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119009

Michal Jireš  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 Status|WAITING |RESOLVED

--- Comment #5 from Michal Jireš  ---
Fixed. Regression no longer occurs on trunk.