[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 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/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;
  
}


$ 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 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 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 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.