[Bug c++/116113] ICE: Segmentation fault (maybe_convert_cond)

2024-07-26 Thread iamanonymous.cs at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116113

--- Comment #1 from Anonymous  ---
Created attachment 58766
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=58766=edit
cpp testcase

[Bug c++/116113] New: ICE: Segmentation fault (maybe_convert_cond)

2024-07-26 Thread iamanonymous.cs at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116113

Bug ID: 116113
   Summary: ICE: Segmentation fault (maybe_convert_cond)
   Product: gcc
   Version: 15.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: iamanonymous.cs at gmail dot com
  Target Milestone: ---
Target: x86_64

***
The compiler produces a segfault during maybe_convert_cond when compiling the
provided code with the specified options. 
The issue can also be reproduced on Compiler Explorer.

***
OS and Platform:
# uname -a
Linux ubuntu 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023
x86_64 x86_64 x86_64 GNU/Linux
***
# g++ -v
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/home/gcc-set/gcc24-7-24/gccbin/libexec/gcc/x86_64-pc-linux-gnu/15.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /home/gcc-set/gcc24-7-24/configure
--prefix=/home/gcc-set/gcc24-7-24/gccbin --enable-languages=c,c++,fortran,go
--disable-multilib
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 15.0.0 20240724 (experimental) (GCC) 
***
Program:Please refer to the attachment. 

***
Command Lines:
#g++ scanner-pp.cpp -fprofile-arcs -ftest-coverage -O3 -o scanner-pp

...
...
...
...
/usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/type_traits:100019:37:
error: no match for ‘operator*’ (operand type is
‘std::vector::iterator’)
/usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/type_traits:100022:19:
internal compiler error: Segmentation fault
0x27f432e internal_error(char const*, ...)
/home/gcc-set/gcc24-7-24/gcc/diagnostic-global-context.cc:491
0x1412bf6 crash_signal
/home/gcc-set/gcc24-7-24/gcc/toplev.cc:319
0xd4b8e5 maybe_convert_cond
/home/gcc-set/gcc24-7-24/gcc/cp/semantics.cc:974
0xd4b946 maybe_convert_cond
/home/gcc-set/gcc24-7-24/gcc/cp/semantics.cc:966
0xd4b946 finish_if_stmt_cond(tree_node*, tree_node*)
/home/gcc-set/gcc24-7-24/gcc/cp/semantics.cc:1154
0xcb0624 cp_parser_selection_statement
/home/gcc-set/gcc24-7-24/gcc/cp/parser.cc:13706
0xc76dba cp_parser_statement
/home/gcc-set/gcc24-7-24/gcc/cp/parser.cc:12743
0xc79f8f cp_parser_statement_seq_opt
/home/gcc-set/gcc24-7-24/gcc/cp/parser.cc:13451
0xcae86e cp_parser_already_scoped_statement
/home/gcc-set/gcc24-7-24/gcc/cp/parser.cc:15134
0xcb137b cp_parser_iteration_statement
/home/gcc-set/gcc24-7-24/gcc/cp/parser.cc:14743
0xc76d91 cp_parser_statement
/home/gcc-set/gcc24-7-24/gcc/cp/parser.cc:12750
0xc79f8f cp_parser_statement_seq_opt
/home/gcc-set/gcc24-7-24/gcc/cp/parser.cc:13451
0xc7a20f cp_parser_compound_statement
/home/gcc-set/gcc24-7-24/gcc/cp/parser.cc:13298
0xcb00c5 cp_parser_implicitly_scoped_statement
/home/gcc-set/gcc24-7-24/gcc/cp/parser.cc:15070
0xcb0697 cp_parser_selection_statement
/home/gcc-set/gcc24-7-24/gcc/cp/parser.cc:13727
0xc76dba cp_parser_statement
/home/gcc-set/gcc24-7-24/gcc/cp/parser.cc:12743
0xc79f8f cp_parser_statement_seq_opt
/home/gcc-set/gcc24-7-24/gcc/cp/parser.cc:13451
0xc7a20f cp_parser_compound_statement
/home/gcc-set/gcc24-7-24/gcc/cp/parser.cc:13298
0xca2585 cp_parser_function_body
/home/gcc-set/gcc24-7-24/gcc/cp/parser.cc:26175
0xca2585 cp_parser_ctor_initializer_opt_and_function_body
/home/gcc-set/gcc24-7-24/gcc/cp/parser.cc:26226
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.



***

Also ICE on trunk, compiler explorer:https://godbolt.org/z/zen4vYrj5

***

[Bug c/116112] New: ICE: in add_dwarf_attr, at dwarf2out.cc:4515

2024-07-26 Thread iamanonymous.cs at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116112

Bug ID: 116112
   Summary: ICE: in add_dwarf_attr, at dwarf2out.cc:4515
   Product: gcc
   Version: 15.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: iamanonymous.cs at gmail dot com
  Target Milestone: ---
Target: x86_64

***
The compiler produces a ICE during add_dwarf_attr when compiling the provided
code with the specified options. 
The issue can also be reproduced on Compiler Explorer.

***
OS and Platform:
# uname -a
Linux ubuntu 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023
x86_64 x86_64 x86_64 GNU/Linux
***
# gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/home/gcc-set/gcc24-7-24/gccbin/libexec/gcc/x86_64-pc-linux-gnu/15.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /home/gcc-set/gcc24-7-24/configure
--prefix=/home/gcc-set/gcc24-7-24/gccbin --enable-languages=c,c++,fortran,go
--disable-multilib
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 15.0.0 20240724 (experimental) (GCC) 
***
Program:
#cat 1.c
int __seg_gs m;

int foo (void)
{
  return m;
}

***
Command Lines:
#gcc 1.c -fprofile-arcs -ftest-coverage -O3 -fno-omit-frame-pointer -g -ftrapv
-fno-stack-protector -ffunction-sections -fdata-sections -fno-strict-aliasing
-Wall -Wextra -Werror -fno-optimize-sibling-calls
-fno-unsafe-math-optimizations -DDEBUG -DNDEBUG -o 1

1.c:1:1: internal compiler error: in add_dwarf_attr, at dwarf2out.cc:4515
1 | int __seg_gs m;
  | ^~~
0x24d6e6e internal_error(char const*, ...)
/home/gcc-set/gcc24-7-24/gcc/diagnostic-global-context.cc:491
0x9be1b9 fancy_abort(char const*, int, char const*)
/home/gcc-set/gcc24-7-24/gcc/diagnostic.cc:1725
0x7d4cc6 add_dwarf_attr
/home/gcc-set/gcc24-7-24/gcc/dwarf2out.cc:4515
0x7d62bf add_dwarf_attr
/home/gcc-set/gcc24-7-24/gcc/hash-table.h:769
0x7d62bf add_AT_string
/home/gcc-set/gcc24-7-24/gcc/dwarf2out.cc:4787
0x7d62bf add_name_attribute(die_struct*, char const*)
/home/gcc-set/gcc24-7-24/gcc/dwarf2out.cc:21323
0x7d62bf add_name_attribute(die_struct*, char const*)
/home/gcc-set/gcc24-7-24/gcc/dwarf2out.cc:21316
0xc4cd81 modified_type_die
/home/gcc-set/gcc24-7-24/gcc/dwarf2out.cc:14081
0xc4e0ab add_type_attribute
/home/gcc-set/gcc24-7-24/gcc/dwarf2out.cc:22447
0xc616b2 gen_variable_die
/home/gcc-set/gcc24-7-24/gcc/dwarf2out.cc:24785
0xc46814 gen_decl_die
/home/gcc-set/gcc24-7-24/gcc/dwarf2out.cc:27281
0xc48248 dwarf2out_decl
/home/gcc-set/gcc24-7-24/gcc/dwarf2out.cc:27774
0xc48558 dwarf2out_early_global_decl
/home/gcc-set/gcc24-7-24/gcc/dwarf2out.cc:27421
0x9f8d88 finish_decl(tree_node*, unsigned int, tree_node*, tree_node*,
tree_node*)
/home/gcc-set/gcc24-7-24/gcc/c/c-decl.cc:5994
0xa6a1a2 c_parser_declaration_or_fndef
/home/gcc-set/gcc24-7-24/gcc/c/c-parser.cc:2855
0xa75c9b c_parser_external_declaration
/home/gcc-set/gcc24-7-24/gcc/c/c-parser.cc:2060
0xa766dd c_parser_translation_unit
/home/gcc-set/gcc24-7-24/gcc/c/c-parser.cc:1914
0xa766dd c_parse_file()
/home/gcc-set/gcc24-7-24/gcc/c/c-parser.cc:27336
0xaf24b1 c_common_parse_file()
/home/gcc-set/gcc24-7-24/gcc/c-family/c-opts.cc:1315
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.



***

Also ICE on trunk, compiler explorer:https://godbolt.org/z/z45q4TKf3

***

[Bug target/116042] ICE Segmentation fault ( in ix86_finalize_stack_frame_flags and ix86_expand_prologue())

2024-07-24 Thread iamanonymous.cs at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116042

--- Comment #2 from Anonymous  ---
# gcc helper.i -O2 -fno-omit-frame-pointer -fno-stack-protector
-fno-strict-aliasing -g3 -Wall -Wextra -Werror -Wno-pointer-arith
-Wno-missing-field-initializers -pedantic -DDEBUG -c -o helper.o
helper.i:1:17: error: file-scope declaration of ‘env’ specifies ‘register’
[-Werror=pedantic]
1 | register struct str *env asm("ebp");
  | ^~~
helper.i: In function ‘fun’:
helper.i:5:12: error: frame pointer required, but reserved
5 | extern int fun (int base)
  |^~~
helper.i:1:22: note: for ‘env’
1 | register struct str *env asm("ebp");
  |  ^~~
during RTL pass: pro_and_epilogue
helper.i:8:1: internal compiler error: Segmentation fault
8 | }
  | ^
0x10a70ff crash_signal
/root/gdbtest/gcc/obj/../gcc/gcc/toplev.cc:319
0x148922d ix86_finalize_stack_frame_flags
/root/gdbtest/gcc/obj/../gcc/gcc/config/i386/i386.cc:8606
0x148a70c ix86_expand_prologue()
/root/gdbtest/gcc/obj/../gcc/gcc/config/i386/i386.cc:8777
0x1a6c0aa gen_prologue()
/root/gdbtest/gcc/obj/../gcc/gcc/config/i386/i386.md:19176
0x1475135 target_gen_prologue
/root/gdbtest/gcc/obj/../gcc/gcc/config/i386/i386.md:27088
0xcf6da7 make_prologue_seq
/root/gdbtest/gcc/obj/../gcc/gcc/function.cc:5818
0xcf6f63 thread_prologue_and_epilogue_insns()
/root/gdbtest/gcc/obj/../gcc/gcc/function.cc:6053
0xcf76d2 rest_of_handle_thread_prologue_and_epilogue
/root/gdbtest/gcc/obj/../gcc/gcc/function.cc:6567
0xcf76d2 execute
/root/gdbtest/gcc/obj/../gcc/gcc/function.cc:6653
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See  for instructions.

[Bug target/116042] ICE Segmentation fault ( in ix86_finalize_stack_frame_flags and ix86_expand_prologue())

2024-07-24 Thread iamanonymous.cs at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116042

--- Comment #1 from Anonymous  ---
Here is a reduced testcase:

register struct str *env asm("ebp");

extern int foo (int base) ;

extern int fun (int base)
{
  return foo (base);
}

[Bug c/116042] New: ICE Segmentation fault ( in ix86_finalize_stack_frame_flags and ix86_expand_prologue())

2024-07-22 Thread iamanonymous.cs at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116042

Bug ID: 116042
   Summary: ICE Segmentation fault  ( in
ix86_finalize_stack_frame_flags and
ix86_expand_prologue())
   Product: gcc
   Version: 15.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: iamanonymous.cs at gmail dot com
  Target Milestone: ---
Target: x86_64

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

***
The compiler produces a segfault during ix86_finalize_stack_frame_flags when
compiling the provided code with the specified options. 
The issue can also be reproduced on Compiler Explorer.

***
OS and Platform:
# uname -a
Linux ubuntu 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023
x86_64 x86_64 x86_64 GNU/Linux
***
# gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/root/gdbtest/gcc/gcc-15/libexec/gcc/x86_64-pc-linux-gnu/15.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /root/gdbtest/gcc/obj/../gcc/configure
--prefix=/root/gdbtest/gcc/gcc-15 --enable-languages=c,c++,fortran,go
--disable-multilib
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 15.0.0 20240509 (experimental) (GCC) 
***
Program:Please refer to the attachment. 

***
Command Lines:
gcc helper.i -O2 -fno-omit-frame-pointer -fno-stack-protector
-fno-strict-aliasing -g3 -Wall -Wextra -Werror -Wno-pointer-arith
-Wno-missing-field-initializers -pedantic -DDEBUG -c -o helper.o

In file included from /tmp/qemu/BUILD/qemu-0.5.5/target-i386/helper.c:20:
/tmp/qemu/BUILD/qemu-0.5.5/target-i386/exec.h:23:17: error: file-scope
declaration of ‘env’ specifies ‘register’ [-Werror=pedantic]
/tmp/qemu/BUILD/qemu-0.5.5/target-i386/exec.h:24:1: error: file-scope
declaration of ‘T0’ specifies ‘register’ [-Werror=pedantic]
/tmp/qemu/BUILD/qemu-0.5.5/target-i386/exec.h:25:1: error: file-scope
declaration of ‘T1’ specifies ‘register’ [-Werror=pedantic]
/tmp/qemu/BUILD/qemu-0.5.5/target-i386/exec.h:25:19: error: call-clobbered
register used for global register variable [-Werror]
/tmp/qemu/BUILD/qemu-0.5.5/target-i386/exec.h:26:1: error: file-scope
declaration of ‘T2’ specifies ‘register’ [-Werror=pedantic]
/tmp/qemu/BUILD/qemu-0.5.5/target-i386/exec.h:26:19: error: call-clobbered
register used for global register variable [-Werror]
In file included from /tmp/qemu/BUILD/qemu-0.5.5/target-i386/cpu.h:452,
 from /tmp/qemu/BUILD/qemu-0.5.5/target-i386/exec.h:115:
/tmp/qemu/BUILD/qemu-0.5.5/cpu-all.h: In function ‘tswap16s’:
/tmp/qemu/BUILD/qemu-0.5.5/cpu-all.h:95:39: error: unused parameter ‘s’
[-Werror=unused-parameter]
/tmp/qemu/BUILD/qemu-0.5.5/cpu-all.h: In function ‘tswap32s’:
/tmp/qemu/BUILD/qemu-0.5.5/cpu-all.h:99:39: error: unused parameter ‘s’
[-Werror=unused-parameter]
/tmp/qemu/BUILD/qemu-0.5.5/cpu-all.h: In function ‘tswap64s’:
/tmp/qemu/BUILD/qemu-0.5.5/cpu-all.h:103:39: error: unused parameter ‘s’
[-Werror=unused-parameter]
In file included from /tmp/qemu/BUILD/qemu-0.5.5/target-i386/exec.h:116:
/tmp/qemu/BUILD/qemu-0.5.5/exec-all.h: In function ‘spin_lock’:
/tmp/qemu/BUILD/qemu-0.5.5/exec-all.h:518:42: error: unused parameter ‘lock’
[-Werror=unused-parameter]
/tmp/qemu/BUILD/qemu-0.5.5/exec-all.h: In function ‘spin_unlock’:
/tmp/qemu/BUILD/qemu-0.5.5/exec-all.h:522:44: error: unused parameter ‘lock’
[-Werror=unused-parameter]
/tmp/qemu/BUILD/qemu-0.5.5/exec-all.h: In function ‘spin_trylock’:
/tmp/qemu/BUILD/qemu-0.5.5/exec-all.h:526:44: error: unused parameter ‘lock’
[-Werror=unused-parameter]
/tmp/qemu/BUILD/qemu-0.5.5/exec-all.h: In function ‘get_phys_addr_code’:
/tmp/qemu/BUILD/qemu-0.5.5/exec-all.h:590:19: error: cast to pointer from
integer of different size [-Werror=int-to-pointer-cast]
/tmp/qemu/BUILD/qemu-0.5.5/target-i386/exec.h: At top level:
/tmp/qemu/BUILD/qemu-0.5.5/target-i386/exec.h:310:12: error: conflicting types
for built-in function ‘lrintl’; expected ‘long int(long double)’
[-Werror=builtin-declaration-mismatch]
/tmp/qemu/BUILD/qemu-0.5.5/target-i386/exec.h:236:1: note: ‘lrintl’ is declared
in header ‘’
/tmp/qemu/BUILD/qemu-0.5.5/target-i386/helper.c: In function ‘load_segment’:
/tmp/qemu/BUILD/qemu-0.5.5/target-i386/helper.c:152:21: error: comparison of
integer expressions of different signedness: ‘int’ and ‘uint32_t’ {aka
‘unsigned int’} [-Werror=sign-compare]
/tmp/qemu/BUILD/qemu-0.5.5/target-i386/helper.c: In function ‘get_seg_base’:

[Bug c/116002] New: GCC Compiler Hang with Recursive Macros in Function

2024-07-19 Thread iamanonymous.cs at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116002

Bug ID: 116002
   Summary: GCC Compiler Hang with Recursive Macros in Function
   Product: gcc
   Version: 15.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: iamanonymous.cs at gmail dot com
  Target Milestone: ---
Target: x86_64

***
I encountered an issue where the GCC compiler hangs indefinitely while trying
to compile a specific piece of code involving recursive macros within a
function. The code snippet is provided below.Clang also has this problem.

***
OS and Platform:
# uname -a
Linux ubuntu 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023
x86_64 x86_64 x86_64 GNU/Linux
***
# gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/root/gdbtest/gcc/gcc-15/libexec/gcc/x86_64-pc-linux-gnu/15.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /root/gdbtest/gcc/obj/../gcc/configure
--prefix=/root/gdbtest/gcc/gcc-15 --enable-languages=c,c++,fortran,go
--disable-multilib
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 15.0.0 20240509 (experimental) (GCC) 
***
Program:
# cat 1.c

int a(int c) {
  if (c < 12345) {
#define A \
{ int d = c % 12345; \
  int e = c ^ d * 12345; \
  int f = c * d % e % 12345; \
  c = f; }
#define B A A A A A A
#define C B B B B B B
#define D C C C C C C
#define E D D D D D D
E E E E E
  }
  return c;
}




***
Output: Nothing (Waited for nearly 300 seconds.
***

Also got killed on compiler explorer:https://godbolt.org/z/9Exof1rrW

***

[Bug c++/115956] New: ICE: in change_stack, at reg-stack.cc:2732

2024-07-16 Thread iamanonymous.cs at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115956

Bug ID: 115956
   Summary: ICE: in change_stack, at reg-stack.cc:2732
   Product: gcc
   Version: 15.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: iamanonymous.cs at gmail dot com
  Target Milestone: ---
Target: x86_64

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

***
The compiler produces a segfault during build_this_conversion when compiling
the provided code with the specified options. 
The issue can also be reproduced on Compiler Explorer.

***
OS and Platform:
# uname -a
Linux ubuntu 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023
x86_64 x86_64 x86_64 GNU/Linux
***
# g++ -v
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/root/gdbtest/gcc/gcc-15/libexec/gcc/x86_64-pc-linux-gnu/15.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /root/gdbtest/gcc/obj/../gcc/configure
--prefix=/root/gdbtest/gcc/gcc-15 --enable-languages=c,c++,fortran,go
--disable-multilib
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 15.0.0 20240509 (experimental) (GCC) 
***
Program:Please refer to the attachment.
***
Command Lines:
# g++ random.cpp -O2 -std=c11 -march=native -msse2 -Wall -Wextra 
-Wconversion -Wshadow -Wold-style-cast -Wcast-align -Woverloaded-virtual  -c -o
random.o

cc1plus: warning: command-line option '-std=c11' is valid for C/ObjC but not
for C++
random.cpp: In member function 'float Random::operator()(int, int, float,
float, float) const':
random.cpp:75:21: warning: use of old-style cast to 'int' [-Wold-style-cast]
random.cpp:76:21: warning: use of old-style cast to 'int' [-Wold-style-cast]
random.cpp:77:21: warning: use of old-style cast to 'int' [-Wold-style-cast]
random.cpp:95:22: warning: conversion from 'int' to 'float' may change value
[-Wconversion]
random.cpp:96:22: warning: conversion from 'int' to 'float' may change value
[-Wconversion]
random.cpp:97:22: warning: conversion from 'int' to 'float' may change value
[-Wconversion]
random.cpp:102:11: warning: narrowing conversion of '((5.0e-1 *
((double)((float)dx))) * ((double)float)dx) * float)dx) * (float)-1) +
(float)2)) - (float)1)))' from 'double' to 'float' [-Wnarrowing]
random.cpp:102:11: warning: conversion from 'double' to 'float' may change
value [-Wfloat-conversion]
random.cpp:103:8: warning: narrowing conversion of '(5.0e-1 *
((double)float)dx) * (((float)dx) * (((float)3 * ((float)dx)) - (float)5)))
+ (float)2)))' from 'double' to 'float' [-Wnarrowing]
random.cpp:103:8: warning: conversion from 'double' to 'float' may change value
[-Wfloat-conversion]
random.cpp:104:11: warning: narrowing conversion of '((5.0e-1 *
((double)((float)dx))) * ((double)float)dx) * (((float)-3 * ((float)dx)) +
(float)4)) + (float)1)))' from 'double' to 'float' [-Wnarrowing]
random.cpp:104:11: warning: conversion from 'double' to 'float' may change
value [-Wfloat-conversion]
random.cpp:105:14: warning: narrowing conversion of '(((5.0e-1 *
((double)((float)dx))) * ((double)((float)dx))) * ((double)(((float)dx) -
(float)1)))' from 'double' to 'float' [-Wnarrowing]
random.cpp:105:14: warning: conversion from 'double' to 'float' may change
value [-Wfloat-conversion]
random.cpp:110:11: warning: narrowing conversion of '((5.0e-1 *
((double)((float)dy))) * ((double)float)dy) * float)dy) * (float)-1) +
(float)2)) - (float)1)))' from 'double' to 'float' [-Wnarrowing]
random.cpp:110:11: warning: conversion from 'double' to 'float' may change
value [-Wfloat-conversion]
random.cpp:111:8: warning: narrowing conversion of '(5.0e-1 *
((double)float)dy) * (((float)dy) * (((float)3 * ((float)dy)) - (float)5)))
+ (float)2)))' from 'double' to 'float' [-Wnarrowing]
random.cpp:111:8: warning: conversion from 'double' to 'float' may change value
[-Wfloat-conversion]
random.cpp:112:11: warning: narrowing conversion of '((5.0e-1 *
((double)((float)dy))) * ((double)float)dy) * (((float)-3 * ((float)dy)) +
(float)4)) + (float)1)))' from 'double' to 'float' [-Wnarrowing]
random.cpp:112:11: warning: conversion from 'double' to 'float' may change
value [-Wfloat-conversion]
random.cpp:113:14: warning: narrowing conversion of '(((5.0e-1 *
((double)((float)dy))) * ((double)((float)dy))) * ((double)(((float)dy) -
(float)1)))' from 'double' to 'float' [-Wnarrowing]
random.cpp:113:14: warning: conversion from 'double' to 'float' may change
value 

[Bug c++/115940] New: ICE: tree check: expected record_type or union_type or qual_union_type, have translation_unit_decl in maybe_dummy_object, at cp/tree.cc:4379

2024-07-15 Thread iamanonymous.cs at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115940

Bug ID: 115940
   Summary: ICE: tree check: expected record_type or union_type or
qual_union_type, have translation_unit_decl in
maybe_dummy_object, at cp/tree.cc:4379
   Product: gcc
   Version: 15.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: iamanonymous.cs at gmail dot com
  Target Milestone: ---
Target: x86_64

***
The compiler produces a segfault during tree_check_failed when compiling the
provided code with the specified options. 
The issue can also be reproduced on Compiler Explorer.

***
OS and Platform:
# uname -a
Linux ubuntu 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023
x86_64 x86_64 x86_64 GNU/Linux
***
# g++ -v
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/root/gdbtest/gcc/gcc-15/libexec/gcc/x86_64-pc-linux-gnu/15.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /root/gdbtest/gcc/obj/../gcc/configure
--prefix=/root/gdbtest/gcc/gcc-15 --enable-languages=c,c++,fortran,go
--disable-multilib
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 15.0.0 20240509 (experimental) (GCC) 
***
Program:Please refer to the attachment. 

***
Command Lines:
# g++ BlockRegion.i -O3 -march=native -flto -fsanitize=address,undefined
-fno-omit-frame-pointer -Wall -Wextra -Wpedantic -Wshadow -Wconversion
-Wdouble-promotion -fstack-protector-all -fno-strict-aliasing -Wstrict-overflow
-Wnull-dereference -Wformat=2 -Wformat-signedness -c -o BlockRegion.o
:1:3: warning: style of line directive is a GCC extension
1 | # 1 "PFA/BlockRegion.c"
  |   ^
PFA/BlockRegion.c:1:3: warning: style of line directive is a GCC extension
: warning: style of line directive is a GCC extension
:1:3: warning: style of line directive is a GCC extension
PFA/BlockRegion.c:1:3: warning: style of line directive is a GCC extension
/home/compwork/monat/Open64-1-7-0-B-Linux/CVSTop-LAO2/LAO_PRO/lao/PFA/BlockRegion.xcc:16:3:
warning: style of line directive is a GCC extension
In file included from
/home/compwork/monat/Open64-1-7-0-B-Linux/CVSTop-LAO2/LAO_PRO/lao/PFA/BlockRegion.xcc:16:
PFA/PFA._h:1:3: warning: style of line directive is a GCC extension
/home/compwork/monat/Open64-1-7-0-B-Linux/CVSTop-LAO2/LAO_PRO/lao/PFA/PFA.xcc:19:3:
warning: style of line directive is a GCC extension
In file included from
/home/compwork/monat/Open64-1-7-0-B-Linux/CVSTop-LAO2/LAO_PRO/lao/PFA/PFA.xcc:19:
PFA/PFA.h:1:3: warning: style of line directive is a GCC extension
/home/compwork/monat/Open64-1-7-0-B-Linux/CVSTop-LAO2/LAO_PRO/lao/PFA/PFA.xcc:1:3:
warning: style of line directive is a GCC extension
/home/compwork/monat/Open64-1-7-0-B-Linux/CVSTop-LAO2/LAO_PRO/lao/PFA/PFA.xcc:22:3:
warning: style of line directive is a GCC extension
In file included from
/home/compwork/monat/Open64-1-7-0-B-Linux/CVSTop-LAO2/LAO_PRO/lao/PFA/PFA.xcc:22:
/work1/monat/tmp/include/CCL.h:1:3: warning: style of line directive is a GCC
extension
/home/compwork/monat/Open64-1-7-0-B-Linux/CVSTop-LAO2/LAO_PRO/CDT/CCL/CCL.xcc:1:3:
warning: style of line directive is a GCC extension
/home/compwork/monat/Open64-1-7-0-B-Linux/CVSTop-LAO2/LAO_PRO/CDT/CCL/CCL.xcc:20:3:
warning: style of line directive is a GCC extension
In file included from
/home/compwork/monat/Open64-1-7-0-B-Linux/CVSTop-LAO2/LAO_PRO/CDT/CCL/CCL.xcc:20:
/work1/monat/tmp/include/BSL.h:1:3: warning: style of line directive is a GCC
extension
/home/compwork/monat/Open64-1-7-0-B-Linux/CVSTop-LAO2/LAO_PRO/CDT/BSL/BSL.xcc:1:3:
warning: style of line directive is a GCC extension
/home/compwork/monat/Open64-1-7-0-B-Linux/CVSTop-LAO2/LAO_PRO/CDT/BSL/BSL.xcc:19:3:
warning: style of line directive is a GCC extension
In file included from
/home/compwork/monat/Open64-1-7-0-B-Linux/CVSTop-LAO2/LAO_PRO/CDT/BSL/BSL.xcc:19:
/work1/monat/tmp/include/CDT.h:4:3: warning: style of line directive is a GCC
extension
/work1/monat/tmp/include/CDT.h:5:3: warning: style of line directive is a GCC
extension
/work1/monat/tmp/include/CDT.h:6:3: warning: style of line directive is a GCC
extension
/work1/monat/tmp/include/CDT.h:7:3: warning: style of line directive is a GCC
extension
/work1/monat/tmp/include/CDT.h:8:3: warning: style of line directive is a GCC
extension
/work1/monat/tmp/include/CDT.h:9:3: warning: style of line directive is a GCC
extension
/work1/monat/tmp/include/CDT.h:10:3: warning: style of line directive is a GCC
extension

[Bug c++/115930] New: ICE: tree check: expected type_argument_pack or nontype_argument_pack, have integer_type in template_parm_natural_p, at cp/mangle.cc:1828

2024-07-14 Thread iamanonymous.cs at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115930

Bug ID: 115930
   Summary: ICE: tree check: expected type_argument_pack or
nontype_argument_pack, have integer_type in
template_parm_natural_p, at cp/mangle.cc:1828
   Product: gcc
   Version: 15.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: iamanonymous.cs at gmail dot com
  Target Milestone: ---
Target: x86_64

***
The compiler produces an internal error during tree_check_failed when compiling
the provided code with the specified options. 
The issue can also be reproduced on Compiler Explorer.

***
OS and Platform:
# uname -a
Linux ubuntu 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023
x86_64 x86_64 x86_64 GNU/Linux
***
# g++ -v
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/root/gdbtest/gcc/gcc-15/libexec/gcc/x86_64-pc-linux-gnu/15.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /root/gdbtest/gcc/obj/../gcc/configure
--prefix=/root/gdbtest/gcc/gcc-15 --enable-languages=c,c++,fortran,go
--disable-multilib
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 15.0.0 20240509 (experimental) (GCC) 
***
Program:
# cat source_code_1.cpp

#include 

template 
struct MemPtrList {};

struct X {
int a;
};

template 
int bar () {
std::cout << "bar" << std::endl;
return 42;
}

template 
void foo (MemPtrList) {
// Version 1 (miscompile)
int dummy [] = {bar () ... };

// Version 2 (ICE)
//  (bar (), ...);
}

int main () {
foo (MemPtrList<::a> {});
}

***
Command Lines:
# g++  source_code_1.cpp  -O2 -Wall -Wextra -pedantic -std=c++20
-fno-exceptions -fno-rtti -fstrict-aliasing -Wshadow -Wnon-virtual-dtor
-Wold-style-cast -Wcast-align -Woverloaded-virtual -Wconversion
-Wsign-conversion -Wduplicated-cond -Wduplicated-branches -Wlogical-op
-Wnull-dereference -Wuseless-cast -Wdouble-promotion -Wformat=2
-fconcepts-diagnostics-depth=2 -o source_code_1.o
source_code_1.cpp: In function ‘int bar()’:
source_code_1.cpp:11:14: error: ‘cout’ is not a member of ‘std’
   11 | std::cout << "bar" << std::endl;
  |  ^~~~
source_code_1.cpp:1:1: note: ‘std::cout’ is defined in header ‘’;
this is probably fixable by adding ‘#include ’
  +++ |+#include 
1 | 
source_code_1.cpp:11:36: error: ‘endl’ is not a member of ‘std’
   11 | std::cout << "bar" << std::endl;
  |^~~~
source_code_1.cpp:1:1: note: ‘std::endl’ is defined in header ‘’; this
is probably fixable by adding ‘#include ’
  +++ |+#include 
1 | 
source_code_1.cpp: In instantiation of ‘void foo(MemPtrList) [with
SubPtrTypes = int; SubPtrTypes X::* ...SubRefs = {::a}]’:
source_code_1.cpp:25:6:   required from here
   25 | foo (MemPtrList<::a> {});
  | ^~
source_code_1.cpp:18:13: warning: unused variable ‘dummy’ [-Wunused-variable]
   18 | int dummy [] = {bar () ... };
  | ^
source_code_1.cpp: In instantiation of ‘void foo(MemPtrList) [with
SubPtrTypes = int; SubPtrTypes X::* ...SubRefs = {::a}]’:
source_code_1.cpp:16:6: internal compiler error: tree check: expected
type_argument_pack or nontype_argument_pack, have integer_type in
template_parm_natural_p, at cp/mangle.cc:1828
   16 | void foo (MemPtrList) {
  |  ^~~
0x99e2c3 tree_check_failed(tree_node const*, char const*, int, char const*,
...)
/root/gdbtest/gcc/obj/../gcc/gcc/tree.cc:8995
0x7f561c tree_check2(tree_node*, char const*, int, char const*, tree_code,
tree_code)
/root/gdbtest/gcc/obj/../gcc/gcc/tree.h:3643
0x7f561c template_parm_natural_p
/root/gdbtest/gcc/obj/../gcc/gcc/cp/mangle.cc:1828
0x7f561c write_template_args
/root/gdbtest/gcc/obj/../gcc/gcc/cp/mangle.cc:3224
0xbc5276 write_encoding
/root/gdbtest/gcc/obj/../gcc/gcc/cp/mangle.cc:938
0xbc541b write_mangled_name
/root/gdbtest/gcc/obj/../gcc/gcc/cp/mangle.cc:820
0xbcb4e0 mangle_decl_string
/root/gdbtest/gcc/obj/../gcc/gcc/cp/mangle.cc:4420
0xbcb6ca get_mangled_id
/root/gdbtest/gcc/obj/../gcc/gcc/cp/mangle.cc:4441
0xbcb6ca mangle_decl(tree_node*)
/root/gdbtest/gcc/obj/../gcc/gcc/cp/mangle.cc:4479
0x16bc0fd decl_assembler_name(tree_node*)
/root/gdbtest/gcc/obj/../gcc/gcc/tree.cc:719
0xeaaac1 symtab_node::get_comdat_group_id()

[Bug c/115920] New: ICE: in tree_to_poly_int64, at tree.cc:3319

2024-07-14 Thread iamanonymous.cs at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115920

Bug ID: 115920
   Summary: ICE: in tree_to_poly_int64, at tree.cc:3319
   Product: gcc
   Version: 15.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: iamanonymous.cs at gmail dot com
  Target Milestone: ---
Target: x86_64

***
The compiler produces an internal error during tree_to_poly_int64 when
compiling the provided code with the specified options. 
The issue can also be reproduced on Compiler Explorer.

***
OS and Platform:
# uname -a
Linux ubuntu 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023
x86_64 x86_64 x86_64 GNU/Linux
***
# gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/root/gdbtest/gcc/gcc-15/libexec/gcc/x86_64-pc-linux-gnu/15.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /root/gdbtest/gcc/obj/../gcc/configure
--prefix=/root/gdbtest/gcc/gcc-15 --enable-languages=c,c++,fortran,go
--disable-multilib
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 15.0.0 20240509 (experimental) (GCC) 
***
Program:
# cat source_code_1.c

struct s {
int i;
char c[];
};

const struct s s = { .c = "0", };
const struct s *const r = &(constexpr struct s) { .c = "1", };
const struct s *const t = &(static struct s) { .c = "2", };

size_t ice(void)
{
return __builtin_object_size(t, 1);
}


***
Command Lines:
# gcc  source_code_1.c  -O2 -Wall -Wextra -pedantic -std=c99 -fstrict-aliasing
-Wshadow -Wconversion -Wsign-conversion -Wcast-align -Wformat=2
-Wnull-dereference -Wstrict-overflow=5 -Wdouble-promotion -Wduplicated-cond
-Wduplicated-branches -Wlogical-op -Wuseless-cast -Wno-gnu-anonymous-struct
-Wno-non-standard-layout -Wno-variadic-macros -o source_code_1.o
source_code_1.c:7:27: warning: initialization of a flexible array member
[-Wpedantic]
7 | const struct s s = { .c = "0", };
  |   ^~~
source_code_1.c:7:27: note: (near initialization for ‘s.c’)
source_code_1.c:7:14: warning: initialization of a flexible array member
[-Wpedantic]
7 | const struct s s = { .c = "0", };
  |  ^
source_code_1.c:7:14: note: (near initialization for ‘s’)
source_code_1.c:8:29: error: ‘constexpr’ undeclared here (not in a function)
8 | const struct s *const r = &(constexpr struct s) { .c = "1", };
  | ^
source_code_1.c:8:38: error: expected ‘)’ before ‘struct’
8 | const struct s *const r = &(constexpr struct s) { .c = "1", };
  |~ ^~~
  |  )
source_code_1.c:8:49: error: expected ‘,’ or ‘;’ before ‘{’ token
8 | const struct s *const r = &(constexpr struct s) { .c = "1", };
  | ^
source_code_1.c:8:62: warning: ISO C does not allow extra ‘;’ outside of a
function [-Wpedantic]
8 | const struct s *const r = &(constexpr struct s) { .c = "1", };
  |  ^
source_code_1.c:9:53: warning: initialization of a flexible array member
[-Wpedantic]
9 | const struct s *const t = &(static struct s) { .c = "2", };
  | ^~~
source_code_1.c:9:53: note: (near initialization for ‘(anonymous).c’)
source_code_1.c:9:43: warning: initialization of a flexible array member
[-Wpedantic]
9 | const struct s *const t = &(static struct s) { .c = "2", };
  |   ^
source_code_1.c:9:43: note: (near initialization for ‘(anonymous)’)
source_code_1.c:9:46: warning: ISO C forbids storage class specifiers in
compound literals before C23 [-Wpedantic]
9 | const struct s *const t = &(static struct s) { .c = "2", };
  |  ^
source_code_1.c:11:1: error: unknown type name ‘size_t’
   11 | size_t ice(void)
  | ^~
source_code_1.c:1:1: note: ‘size_t’ is defined in header ‘’; this is
probably fixable by adding ‘#include ’
  +++ |+#include 
1 | 
source_code_1.c: In function ‘ice’:
source_code_1.c:13:12: warning: conversion from ‘long unsigned int’ to ‘int’
may change value [-Wconversion]
   13 | return __builtin_object_size(t, 1);
  |^~~
source_code_1.c:13:12: internal compiler error: in tree_to_poly_int64, at
tree.cc:3313
0x8bd846 tree_to_poly_int64(tree_node const*)

[Bug c++/115919] New: ICE: in tsubst_expr, at cp/pt.cc:20300

2024-07-14 Thread iamanonymous.cs at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115919

Bug ID: 115919
   Summary: ICE: in tsubst_expr, at cp/pt.cc:20300
   Product: gcc
   Version: 15.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: iamanonymous.cs at gmail dot com
  Target Milestone: ---
Target: x86_64

***
The compiler produces an internal error during tsubst_expr when compiling the
provided code with the specified options. 
The issue can also be reproduced on Compiler Explorer.

***
OS and Platform:
# uname -a
Linux ubuntu 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023
x86_64 x86_64 x86_64 GNU/Linux
***
# g++ -v
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/root/gdbtest/gcc/gcc-15/libexec/gcc/x86_64-pc-linux-gnu/15.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /root/gdbtest/gcc/obj/../gcc/configure
--prefix=/root/gdbtest/gcc/gcc-15 --enable-languages=c,c++,fortran,go
--disable-multilib
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 15.0.0 20240509 (experimental) (GCC) 
***
Program:
# cat pom.ii


template
class A
{
public:
static double const VAL = 0.5;

enum
{
 COS = (int)(A::VAL)
};
};

int main()
{
A<5>::COS;
return 0;
}


***
Command Lines:
# g++ pom.ii  -O2 -Wall -Wextra -pedantic -std=c++17 -fno-exceptions -fno-rtti
-fstrict-aliasing -Wshadow -Wnon-virtual-dtor -Wold-style-cast -Wcast-align
-Woverloaded-virtual -Wconversion -Wsign-conversion -Wduplicated-cond
-Wduplicated-branches -Wlogical-op -Wnull-dereference -Wuseless-cast
-Wdouble-promotion -Wformat=2 -o pom.o
pom.cpp:5:25: error: ‘constexpr’ needed for in-class initialization of static
data member ‘const double A::VAL’ of non-integral type [-fpermissive]
pom.cpp:9:20: warning: use of old-style cast to ‘int’ [-Wold-style-cast]
pom.cpp: In instantiation of ‘class A<5>’:
pom.cpp:15:9:   required from here
pom.cpp:5:25: error: ‘constexpr’ needed for in-class initialization of static
data member ‘const double A<5>::VAL’ of non-integral type [-fpermissive]
pom.cpp:9:8: internal compiler error: in tsubst_expr, at cp/pt.cc:20306
0x82df47 tsubst_expr(tree_node*, tree_node*, int, tree_node*)
/root/gdbtest/gcc/obj/../gcc/gcc/cp/pt.cc:20306
0xcdf0fe tsubst_enum
/root/gdbtest/gcc/obj/../gcc/gcc/cp/pt.cc:27699
0xcdf0fe lookup_template_class(tree_node*, tree_node*, tree_node*, tree_node*,
int)
/root/gdbtest/gcc/obj/../gcc/gcc/cp/pt.cc:10496
0xcd2cd0 tsubst(tree_node*, tree_node*, int, tree_node*)
/root/gdbtest/gcc/obj/../gcc/gcc/cp/pt.cc:16265
0xccf2d4 tsubst_decl
/root/gdbtest/gcc/obj/../gcc/gcc/cp/pt.cc:15435
0xcef0d0 instantiate_class_template(tree_node*)
/root/gdbtest/gcc/obj/../gcc/gcc/cp/pt.cc:12572
0xd43e90 complete_type(tree_node*)
/root/gdbtest/gcc/obj/../gcc/gcc/cp/typeck.cc:138
0xc6bc3a cp_parser_nested_name_specifier_opt
/root/gdbtest/gcc/obj/../gcc/gcc/cp/parser.cc:7271
0xc7a7b7 cp_parser_simple_type_specifier
/root/gdbtest/gcc/obj/../gcc/gcc/cp/parser.cc:20576
0xc53411 cp_parser_type_specifier
/root/gdbtest/gcc/obj/../gcc/gcc/cp/parser.cc:20227
0xc551ed cp_parser_decl_specifier_seq
/root/gdbtest/gcc/obj/../gcc/gcc/cp/parser.cc:16675
0xc56588 cp_parser_simple_declaration
/root/gdbtest/gcc/obj/../gcc/gcc/cp/parser.cc:15831
0xc7cb60 cp_parser_declaration_statement
/root/gdbtest/gcc/obj/../gcc/gcc/cp/parser.cc:14944
0xc84b7e cp_parser_statement
/root/gdbtest/gcc/obj/../gcc/gcc/cp/parser.cc:12897
0xc59807 cp_parser_statement_seq_opt
/root/gdbtest/gcc/obj/../gcc/gcc/cp/parser.cc:13427
0xc59a2f cp_parser_compound_statement
/root/gdbtest/gcc/obj/../gcc/gcc/cp/parser.cc:13281
0xc7ccd5 cp_parser_function_body
/root/gdbtest/gcc/obj/../gcc/gcc/cp/parser.cc:26072
0xc7ccd5 cp_parser_ctor_initializer_opt_and_function_body
/root/gdbtest/gcc/obj/../gcc/gcc/cp/parser.cc:26123
0xc8241e cp_parser_function_definition_after_declarator
/root/gdbtest/gcc/obj/../gcc/gcc/cp/parser.cc:32903
0xc835be cp_parser_function_definition_from_specifiers_and_declarator
/root/gdbtest/gcc/obj/../gcc/gcc/cp/parser.cc:32820
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.

***

Also ICE on trunk, 

[Bug lto/115890] New: ICE: verify_gimple failed with -flto

2024-07-12 Thread iamanonymous.cs at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115890

Bug ID: 115890
   Summary: ICE: verify_gimple failed with -flto
   Product: gcc
   Version: 15.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: lto
  Assignee: unassigned at gcc dot gnu.org
  Reporter: iamanonymous.cs at gmail dot com
  Target Milestone: ---

***
OS and Platform:
$ uname -a:
Linux 65dac7c84719 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC
2023 x86_64 x86_64 x86_64 GNU/Linux
***
gcc version:
Using built-in specs.
COLLECT_GCC=/home/software/gcc-trunk-3aa004f/bin/gcc
COLLECT_LTO_WRAPPER=/home/software/gcc-trunk-3aa004f/libexec/gcc/x86_64-pc-linux-gnu/15.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --disable-multilib --disable-bootstrap
--enable-languages=c,c++ --prefix=/home/software/gcc-trunk-3aa004f
--enable-coverage
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 15.0.0 20240630 (experimental) (GCC) 

***
Program:
$ cat mutant.c
int b;
void c() {
  struct d {
int a[b]
  } e() {
  }
  struct d f() { return e(); }
  f();
}

***
Command Lines:
$ gcc -flto mutant.c
mutant.c: In function 'c':
mutant.c:5:3: warning: no semicolon at end of struct or union
5 |   } e() {
  |   ^
mutant.c: In function 'f':
mutant.c:7:12: error: invalid conversion in gimple call
7 |   struct d f() { return e(); }
  |^
struct d

struct d

# .MEM_14 = VDEF <.MEM_13(D)>
 = e (); [static-chain: CHAIN.3_8(D)] [return slot optimization]
during GIMPLE pass: fixup_cfg
mutant.c:7:12: internal compiler error: verify_gimple failed
0x4ddb72b diagnostic_context::report_diagnostic(diagnostic_info*)
???:0
0x4ddbffd diagnostic_context::diagnostic_impl(rich_location*,
diagnostic_metadata const*, int, char const*, __va_list_tag (*) [1],
diagnostic_t)
???:0
0x4dfc327 internal_error(char const*, ...)
???:0
0x1cc84a5 verify_gimple_in_cfg(function*, bool, bool)
???:0
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.
lto-wrapper: fatal error: /home/software/gcc-trunk-3aa004f/bin/gcc returned 1
exit status
compilation terminated.
/usr/bin/ld: error: lto-wrapper failed
collect2: error: ld returned 1 exit status

Also ICE on trunk.
Compiler Explorer: https://godbolt.org/z/x8fPWKqs7

[Bug c++/115861] New: ICE: tree check: expected template_decl, have overload in cplus_decl_attributes, at cp/decl2.cc:1896 with deprecated attribute

2024-07-10 Thread iamanonymous.cs at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115861

Bug ID: 115861
   Summary: ICE: tree check: expected template_decl, have overload
in cplus_decl_attributes, at cp/decl2.cc:1896 with
deprecated attribute
   Product: gcc
   Version: 15.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: iamanonymous.cs at gmail dot com
  Target Milestone: ---

***
OS and Platform:
$ uname -a:
Linux 65dac7c84719 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC
2023 x86_64 x86_64 x86_64 GNU/Linux
***
gcc version:
Using built-in specs.
COLLECT_GCC=/home/software/gcc-trunk-3aa004f/bin/gcc
COLLECT_LTO_WRAPPER=/home/software/gcc-trunk-3aa004f/libexec/gcc/x86_64-pc-linux-gnu/15.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --disable-multilib --disable-bootstrap
--enable-languages=c,c++ --prefix=/home/software/gcc-trunk-3aa004f
--enable-coverage
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 15.0.0 20240630 (experimental) (GCC) 

***
Program:
$ cat mutant.C
struct { template < a > void b(; __attribute__((deprecated)) friend b<>(

***
Command Lines:
$ gcc mutant.C
mutant.C:1:30: error: 'a' has not been declared
1 | struct {  template < a > void b(;   
__attribute__((deprecated)) friend b<>(
  |  ^
mutant.C:1:41: error: expected identifier before ';' token
1 | struct {  template < a > void b(;   
__attribute__((deprecated)) friend b<>(
  | ^
mutant.C:1:41: error: expected ')' before ';' token
1 | struct {  template < a > void b(;   
__attribute__((deprecated)) friend b<>(
  |~^
  | )
mutant.C:1:97: error: expected identifier at end of input
1 | struct {  template < a > void b(;   
__attribute__((deprecated)) friend b<>(
  |
^
mutant.C:1:97: error: expected ',' or '...' at end of input
mutant.C:1:97: error: expected ')' at end of input
1 | struct {  template < a > void b(;   
__attribute__((deprecated)) friend b<>(
  |
   ~^
  |
)
mutant.C:1:93: error: ISO C++ forbids declaration of 'b' with no type
[-fpermissive]
1 | struct {  template < a > void b(;   
__attribute__((deprecated)) friend b<>(
  |
^~~
mutant.C:1:97: internal compiler error: tree check: expected template_decl,
have overload in cplus_decl_attributes, at cp/decl2.cc:1896
1 | struct {  template < a > void b(;   
__attribute__((deprecated)) friend b<>(
  |
^
0x576c1eb diagnostic_context::report_diagnostic(diagnostic_info*)
???:0
0x576cabd diagnostic_context::diagnostic_impl(rich_location*,
diagnostic_metadata const*, int, char const*, __va_list_tag (*) [1],
diagnostic_t)
???:0
0x578c98b internal_error(char const*, ...)
???:0
0x2d6b950 tree_check_failed(tree_node const*, char const*, int, char const*,
...)
???:0
0xdca713 tree_check(tree_node*, char const*, int, char const*, tree_code)
???:0
0x10731f6 cplus_decl_attributes(tree_node**, tree_node*, int)
???:0
0x102cddb grokdeclarator(cp_declarator const*, cp_decl_specifier_seq*,
decl_context, int, tree_node**)
???:0
0x106d240 grokfield(cp_declarator const*, cp_decl_specifier_seq*, tree_node*,
bool, tree_node*, tree_node*)
???:0
0x1378350 c_parse_file()
???:0
0x171c898 c_common_parse_file()
???:0
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.

Also ICE on trunk.
Compiler Explorer: https://godbolt.org/z/cjYGE3jcP

[Bug middle-end/115859] New: ICE: in lower_stmt, at gimple-low.cc:724 with -g and __attribute__((optimize(3)))

2024-07-10 Thread iamanonymous.cs at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115859

Bug ID: 115859
   Summary: ICE: in lower_stmt, at gimple-low.cc:724 with -g and
__attribute__((optimize(3)))
   Product: gcc
   Version: 15.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: middle-end
  Assignee: unassigned at gcc dot gnu.org
  Reporter: iamanonymous.cs at gmail dot com
  Target Milestone: ---

***
OS and Platform:
$ uname -a:
Linux 65dac7c84719 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC
2023 x86_64 x86_64 x86_64 GNU/Linux
***
gcc version:
Using built-in specs.
COLLECT_GCC=/home/software/gcc-trunk-3aa004f/bin/gcc
COLLECT_LTO_WRAPPER=/home/software/gcc-trunk-3aa004f/libexec/gcc/x86_64-pc-linux-gnu/15.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --disable-multilib --disable-bootstrap
--enable-languages=c,c++ --prefix=/home/software/gcc-trunk-3aa004f
--enable-coverage
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 15.0.0 20240630 (experimental) (GCC) 

***
Program:
$ cat mutant.C
namespace std {
template  struct coroutine_traits {
  using promise_type = a : promise_type;
} template  struct coroutine_handle;
struct coroutine_handle<> {
} template  struct coroutine_handle {
} class b {
  get_return_object()
} class c {
  using promise_type = b;
};
__attribute__((optimize(3))) auto d(int awaitable) -> c {
  co_await awaitable

***
Command Lines:
$ gcc -g -std=c++20 mutant.C
mutant.C:3:26: error: found ':' in nested-name-specifier, expected '::'
3 |   using promise_type = a : promise_type;
  |  ^
  |  ::
mutant.C:4:2: error: expected ';' after struct definition
4 | } template  struct coroutine_handle;
  |  ^
  |  ;
mutant.C:5:1: error: an explicit specialization must be preceded by 'template
<>'
5 | struct coroutine_handle<> {
  | ^
  | template <> 
mutant.C:6:2: error: expected ';' after struct definition
6 | } template  struct coroutine_handle {
  |  ^
  |  ;
mutant.C:7:2: error: expected ';' after struct definition
7 | } class b {
  |  ^
  |  ;
mutant.C:8:3: error: ISO C++ forbids declaration of 'get_return_object' with no
type [-fpermissive]
8 |   get_return_object()
  |   ^
mutant.C:8:21: error: expected ';' at end of member declaration
8 |   get_return_object()
  | ^
  |  ;
mutant.C:9:2: error: expected ';' after class definition
9 | } class c {
  |  ^
  |  ;
mutant.C: In instantiation of 'struct std::coroutine_traits':
mutant.C:13:12:   required from here
   13 |   co_await awaitable
  |^
mutant.C:3:9: error: 'using std::c::promise_type = class std::b' is private
within this context
3 |   using promise_type = a : promise_type;
  | ^~~~
mutant.C:10:9: note: declared private here
   10 |   using promise_type = b;
  | ^~~~
mutant.C: In function 'std::c std::d(int)':
mutant.C:13:3: error: awaitable type 'int' is not a structure
   13 |   co_await awaitable
  |   ^~~~
mutant.C:13:21: error: expected '}' at end of input
   13 |   co_await awaitable
  | ^
mutant.C:12:57: note: to match this '{'
   12 | __attribute__((optimize(3))) auto d(int awaitable) -> c {
  | ^
mutant.C:12:35: error: no member named 'initial_suspend' in
'std::coroutine_traits::promise_type' {aka 'std::b'}
   12 | __attribute__((optimize(3))) auto d(int awaitable) -> c {
  |   ^
mutant.C:12:35: error: no member named 'unhandled_exception' in
'std::coroutine_traits::promise_type' {aka 'std::b'}
mutant.C:12:35: error: no member named 'final_suspend' in
'std::coroutine_traits::promise_type' {aka 'std::b'}
mutant.C:13:21: error: 'int std::b::get_return_object()' is private within this
context
   13 |   co_await awaitable
  | ^
mutant.C:8:3: note: declared private here
8 |   get_return_object()
  |   ^
mutant.C:13:21: error: could not convert '_Coro_gro' from 'int' to 'std::c'
   13 |   co_await awaitable
  | ^
  | |
  | int
mutant.C: At global scope:
mutant.C:13:21: error: expected '}' at end of input
mutant.C:1:15: note: to match this '{'
1 | namespace std {
  |   ^
during GIMPLE pass: lower
mutant.C: In function 'void 

[Bug lto/115848] New: ICE: 'verify_type' failed with -flto and custom attribute

2024-07-09 Thread iamanonymous.cs at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115848

Bug ID: 115848
   Summary: ICE: 'verify_type' failed with -flto and custom
attribute
   Product: gcc
   Version: 15.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: lto
  Assignee: unassigned at gcc dot gnu.org
  Reporter: iamanonymous.cs at gmail dot com
  Target Milestone: ---

***
OS and Platform:
$ uname -a:
Linux 65dac7c84719 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC
2023 x86_64 x86_64 x86_64 GNU/Linux
***
gcc version:
Using built-in specs.
COLLECT_GCC=/home/software/gcc-trunk-3aa004f/bin/gcc
COLLECT_LTO_WRAPPER=/home/software/gcc-trunk-3aa004f/libexec/gcc/x86_64-pc-linux-gnu/15.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --disable-multilib --disable-bootstrap
--enable-languages=c,c++ --prefix=/home/software/gcc-trunk-3aa004f
--enable-coverage
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 15.0.0 20240630 (experimental) (GCC) 

***
Program:
$ cat mutant.c
typedef void __attribute__((__strub__)) a(int, int);
a(b);
void c() { b(0, 0); }

***
Command Lines:
$ gcc -flto mutant.c
lto1: error: type variant differs by TYPE_ARG_TYPES
 >
QI
size  constant 8>
unit-size  constant 1>
align:8 warn_if_not_align:0 symtab:0 alias-set -1 structural-equality
attributes >
arg-types 
unit-size 
align:32 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type
0x7f931a3a05e8 precision:32 min  max

pointer_to_this >
chain 
chain 
 >
QI
size  constant 8>
unit-size  constant 1>
align:8 warn_if_not_align:0 symtab:0 alias-set -1 structural-equality
attributes >
arg-types 
unit-size 
align:32 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type
0x7f931a3a05e8 precision:32 min  max

pointer_to_this >
chain 
chain 
chain 
pointer_to_this >
lto1: internal compiler error: 'verify_type' failed
0x4ddb72b diagnostic_context::report_diagnostic(diagnostic_info*)
???:0
0x4ddbffd diagnostic_context::diagnostic_impl(rich_location*,
diagnostic_metadata const*, int, char const*, __va_list_tag (*) [1],
diagnostic_t)
???:0
0x4dfc327 internal_error(char const*, ...)
???:0
0x23e928b verify_type(tree_node const*)
???:0
0xdef502 read_cgraph_and_symbols(unsigned int, char const**)
???:0
0xd8f963 lto_main()
???:0
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.
lto-wrapper: fatal error: /home/software/gcc-trunk-3aa004f/bin/gcc returned 1
exit status
compilation terminated.
/usr/bin/ld: error: lto-wrapper failed
collect2: error: ld returned 1 exit status

It can be compiled normally without -flto.
Also ICE on trunk.
Compiler Explorer: https://godbolt.org/z/nKac3vG47

[Bug c/115847] New: ICE: tree check: expected none of vector_type, have vector_type in element_precision, at tree.cc:6808 with attribute simd

2024-07-09 Thread iamanonymous.cs at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115847

Bug ID: 115847
   Summary: ICE: tree check: expected none of vector_type, have
vector_type in element_precision, at tree.cc:6808 with
attribute simd
   Product: gcc
   Version: 15.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: iamanonymous.cs at gmail dot com
  Target Milestone: ---

***
OS and Platform:
$ uname -a:
Linux 65dac7c84719 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC
2023 x86_64 x86_64 x86_64 GNU/Linux
***
gcc version:
Using built-in specs.
COLLECT_GCC=/home/software/gcc-trunk-3aa004f/bin/gcc
COLLECT_LTO_WRAPPER=/home/software/gcc-trunk-3aa004f/libexec/gcc/x86_64-pc-linux-gnu/15.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --disable-multilib --disable-bootstrap
--enable-languages=c,c++ --prefix=/home/software/gcc-trunk-3aa004f
--enable-coverage
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 15.0.0 20240630 (experimental) (GCC) 

***
Program:
$ cat mutant.c
__attribute__((simd)) __attribute__((__vector_size__(sizeof(char char a()
{}

***
Command Lines:
$ gcc mutant.c
during RTL pass: expand
mutant.c: In function 'a.simdclone.0':
mutant.c:1:75: internal compiler error: tree check: expected none of
vector_type, have vector_type in element_precision, at tree.cc:6808
1 | __attribute__((simd)) __attribute__((__vector_size__(sizeof(char
char a() {}
  |
  ^
0x5071bcf diagnostic_context::report_diagnostic(diagnostic_info*)
???:0
0x50724a1 diagnostic_context::diagnostic_impl(rich_location*,
diagnostic_metadata const*, int, char const*, __va_list_tag (*) [1],
diagnostic_t)
???:0
0x50924c7 internal_error(char const*, ...)
???:0
0x2685609 tree_not_check_failed(tree_node const*, char const*, int, char
const*, ...)
???:0
0xfa6926 tree_not_check(tree_node const*, char const*, int, char const*,
tree_code)
???:0
0x2676bc8 element_precision(tree_node const*)
???:0
0x14fd1e7 operand_compare::operand_equal_p(tree_node const*, tree_node const*,
unsigned int)
???:0
0x150776d operand_compare::verify_hash_value(tree_node const*, tree_node
const*, unsigned int, bool*)
???:0
0x14fc7d6 operand_compare::operand_equal_p(tree_node const*, tree_node const*,
unsigned int)
???:0
0x1507978 operand_equal_p(tree_node const*, tree_node const*, unsigned int)
???:0
0x1483c48 expand_assignment(tree_node*, tree_node*, bool)
???:0
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.

Also ICE on trunk.
Compiler Explorer: https://godbolt.org/z/bPbxsqaq7

[Bug target/115816] New: ICE: in emit_move_insn, at expr.cc:4611 with target("sse4.1,arch=core2") attribute and -mavx512f

2024-07-07 Thread iamanonymous.cs at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115816

Bug ID: 115816
   Summary: ICE: in emit_move_insn, at expr.cc:4611 with
target("sse4.1,arch=core2") attribute and -mavx512f
   Product: gcc
   Version: 15.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: iamanonymous.cs at gmail dot com
  Target Milestone: ---

***
OS and Platform:
$ uname -a:
Linux 65dac7c84719 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC
2023 x86_64 x86_64 x86_64 GNU/Linux
***
gcc version:
Using built-in specs.
COLLECT_GCC=/home/software/gcc-trunk-3aa004f/bin/gcc
COLLECT_LTO_WRAPPER=/home/software/gcc-trunk-3aa004f/libexec/gcc/x86_64-pc-linux-gnu/15.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --disable-multilib --disable-bootstrap
--enable-languages=c,c++ --prefix=/home/software/gcc-trunk-3aa004f
--enable-coverage
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 15.0.0 20240630 (experimental) (GCC) 

***
Program:
$ cat mutant.c
register __attribute__((__vector_size__(16 * sizeof(float float a,
b asm("zmm6"), c;
__attribute__((target("sse4.1,arch=core2"))) void d() {
  for (int e;;)
c[e] = a[e] < b[e];
}

***
Command Lines:
$ gcc -mavx512f mutant.c
mutant.c:2:5: warning: call-clobbered register used for global register
variable
2 | b asm("zmm6"), c;
  | ^
mutant.c:1:69: error: register name not specified for 'a'
1 | register __attribute__((__vector_size__(16 * sizeof(float float a,
  | ^
mutant.c:2:20: error: register name not specified for 'c'
2 | b asm("zmm6"), c;
  |^
during RTL pass: expand
mutant.c: In function 'd':
mutant.c:5:20: internal compiler error: in emit_move_insn, at expr.cc:4611
5 | c[e] = a[e] < b[e];
  |   ~^~~
0x5071bcf diagnostic_context::report_diagnostic(diagnostic_info*)
???:0
0x50724a1 diagnostic_context::diagnostic_impl(rich_location*,
diagnostic_metadata const*, int, char const*, __va_list_tag (*) [1],
diagnostic_t)
???:0
0x50924c7 internal_error(char const*, ...)
???:0
0x50729e4 fancy_abort(char const*, int, char const*)
???:0
0x147c27f emit_move_insn(rtx_def*, rtx_def*)
???:0
0x14b3d1b expand_expr_real_1(tree_node*, rtx_def*, machine_mode,
expand_modifier, rtx_def**, bool)
???:0
0x149e86c expand_expr_real(tree_node*, rtx_def*, machine_mode, expand_modifier,
rtx_def**, bool)
???:0
0x148b3db store_expr(tree_node*, rtx_def*, int, bool, bool)
???:0
0x14885d9 expand_assignment(tree_node*, tree_node*, bool)
???:0
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.

Also ICE on trunk.
Compiler Explorer: https://godbolt.org/z/deK4G7bGP

[Bug ipa/115815] New: ICE: in purge_all_uses, at ipa-param-manipulation.cc:632 with -O2 -flto and attribute destructor

2024-07-07 Thread iamanonymous.cs at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115815

Bug ID: 115815
   Summary: ICE: in purge_all_uses, at
ipa-param-manipulation.cc:632 with -O2 -flto and
attribute destructor
   Product: gcc
   Version: 15.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: ipa
  Assignee: unassigned at gcc dot gnu.org
  Reporter: iamanonymous.cs at gmail dot com
  Target Milestone: ---

***
OS and Platform:
$ uname -a:
Linux 65dac7c84719 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC
2023 x86_64 x86_64 x86_64 GNU/Linux
***
gcc version:
Using built-in specs.
COLLECT_GCC=/home/software/gcc-trunk-3aa004f/bin/gcc
COLLECT_LTO_WRAPPER=/home/software/gcc-trunk-3aa004f/libexec/gcc/x86_64-pc-linux-gnu/15.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --disable-multilib --disable-bootstrap
--enable-languages=c,c++ --prefix=/home/software/gcc-trunk-3aa004f
--enable-coverage
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 15.0.0 20240630 (experimental) (GCC) 

***
Program:
$ cat mutant.c
int a;
__attribute__((destructor)) int b() { return a + b(); }

***
Command Lines:
$ gcc -O2 -flto mutant.c
during IPA pass: inline
mutant.c: In function 'b':
mutant.c:2:33: internal compiler error: in purge_all_uses, at
ipa-param-manipulation.cc:632
2 | __attribute__((destructor)) int b() { return a + b(); }
  | ^
0x4ddb72b diagnostic_context::report_diagnostic(diagnostic_info*)
???:0
0x4ddbffd diagnostic_context::diagnostic_impl(rich_location*,
diagnostic_metadata const*, int, char const*, __va_list_tag (*) [1],
diagnostic_t)
???:0
0x4dfc327 internal_error(char const*, ...)
???:0
0x4ddc540 fancy_abort(char const*, int, char const*)
???:0
0x1668655 ipa_param_adjustments::modify_call(cgraph_edge*, bool,
hash_set >*)
???:0
0xf86d7b cgraph_edge::redirect_call_stmt_to_callee(cgraph_edge*,
hash_set >*)
???:0
0x15d1d7c inline_transform(cgraph_node*)
???:0
0x19733ad execute_all_ipa_transforms(bool)
???:0
0xfae996 cgraph_node::expand()
???:0
0xfb0eb4 symbol_table::compile()
???:0
0xd8faf4 lto_main()
???:0
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.
lto-wrapper: fatal error: /home/software/gcc-trunk-3aa004f/bin/gcc returned 1
exit status
compilation terminated.
/usr/bin/ld: error: lto-wrapper failed
collect2: error: ld returned 1 exit status

Also ICE on trunk.
Compiler Explorer: https://godbolt.org/z/oP8hn3Ej8

[Bug c/115787] New: ICE: in gimple_build_switch_nlabels, at gimple.cc:807

2024-07-04 Thread iamanonymous.cs at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115787

Bug ID: 115787
   Summary: ICE: in gimple_build_switch_nlabels, at gimple.cc:807
   Product: gcc
   Version: 15.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: iamanonymous.cs at gmail dot com
  Target Milestone: ---
Target: x86_64

***
The compiler produces a segfault during gimple_build_switch_nlabels at
gimple.cc807 when compiling the provided code with the specified options. 
The issue can also be reproduced on Compiler Explorer.

***
OS and Platform:
# uname -a
Linux ubuntu 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023
x86_64 x86_64 x86_64 GNU/Linux
***
# gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/root/gdbtest/gcc/gcc-15/libexec/gcc/x86_64-pc-linux-gnu/15.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /root/gdbtest/gcc/obj/../gcc/configure
--prefix=/root/gdbtest/gcc/gcc-15 --enable-languages=c,c++,fortran,go
--disable-multilib
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 15.0.0 20240509 (experimental) (GCC) 
***
Program:
# cat test035.c
__GIMPLE a(argc) {
  switch (argc_20) {
  case 1:
b;
  }


***
Command Lines:
# gcc test035.c -O2 -fdump-tree-gimple -fdump-tree-switchconv -Wall -c -o
test035.o
test035.c:1:1: error: ‘__GIMPLE’ only valid with ‘-fgimple’
1 | __GIMPLE a(argc) {
  | ^~~~
test035.c:1:10: error: return type defaults to ‘int’ [-Wimplicit-int]
1 | __GIMPLE a(argc) {
  |  ^
test035.c: In function ‘a’:
test035.c:1:10: error: type of ‘argc’ defaults to ‘int’ [-Wimplicit-int]
test035.c:5:3: internal compiler error: in gimple_build_switch_nlabels, at
gimple.cc:807
5 |   }
  |   ^
0x7e5713 gimple_build_switch_nlabels(unsigned int, tree_node*, tree_node*)
/root/gdbtest/gcc/obj/../gcc/gcc/gimple.cc:807
0x7e5713 gimple_build_switch_nlabels(unsigned int, tree_node*, tree_node*)
/root/gdbtest/gcc/obj/../gcc/gcc/gimple.cc:804
0xd09040 gimple_build_switch(tree_node*, tree_node*, vec const&)
/root/gdbtest/gcc/obj/../gcc/gcc/gimple.cc:827
0xa64ac1 c_parser_gimple_switch_stmt
/root/gdbtest/gcc/obj/../gcc/gcc/c/gimple-parser.cc:2552
0xa64ac1 c_parser_gimple_compound_statement
/root/gdbtest/gcc/obj/../gcc/gcc/c/gimple-parser.cc:440
0xa64d61 c_parser_parse_gimple_body(c_parser*, char*, c_declspec_il,
profile_count)
/root/gdbtest/gcc/obj/../gcc/gcc/c/gimple-parser.cc:253
0xa505a4 c_parser_declaration_or_fndef
/root/gdbtest/gcc/obj/../gcc/gcc/c/c-parser.cc:3011
0xa5af4b c_parser_external_declaration
/root/gdbtest/gcc/obj/../gcc/gcc/c/c-parser.cc:2046
0xa5b935 c_parser_translation_unit
/root/gdbtest/gcc/obj/../gcc/gcc/c/c-parser.cc:1900
0xa5b935 c_parse_file()
/root/gdbtest/gcc/obj/../gcc/gcc/c/c-parser.cc:26889
0xad3a51 c_common_parse_file()
/root/gdbtest/gcc/obj/../gcc/gcc/c-family/c-opts.cc:1311
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See  for instructions.

***

Also ICE on trunk, compiler explorer:https://godbolt.org/z/5sYY7a47c

***

[Bug c/115786] New: ICE: Segmentation fault (add_stmt at ./gcc/gcc/c/c-decl.cc:689 and c_parser_declaration_or_fndef at ./gcc/gcc/c/c-parser.cc:3027)

2024-07-04 Thread iamanonymous.cs at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115786

Bug ID: 115786
   Summary: ICE: Segmentation fault (add_stmt  at
./gcc/gcc/c/c-decl.cc:689 and
c_parser_declaration_or_fndef at
./gcc/gcc/c/c-parser.cc:3027)
   Product: gcc
   Version: 15.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: iamanonymous.cs at gmail dot com
  Target Milestone: ---
Target: x86_64

***
The compiler produces a segfault during add_stmt  at ./gcc/gcc/c/c-decl.cc:689
and  c_parser_declaration_or_fndef at ./gcc/gcc/c/c-parser.cc:3027 when
compiling the provided code with the specified options. 
The issue can also be reproduced on Compiler Explorer.

***
OS and Platform:
# uname -a
Linux ubuntu 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023
x86_64 x86_64 x86_64 GNU/Linux
***
# gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/root/gdbtest/gcc/gcc-15/libexec/gcc/x86_64-pc-linux-gnu/15.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /root/gdbtest/gcc/obj/../gcc/configure
--prefix=/root/gdbtest/gcc/gcc-15 --enable-languages=c,c++,fortran,go
--disable-multilib
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 15.0.0 20240509 (experimental) (GCC) 
***
Program:
# cat test000.c
a() {
  void __GIMPLE b()


***
Command Lines:
# gcc test000.c -fdump-tree-gimple -fdump-tree-all -O2 -Wall -c -o test000.o
test000.c:1:1: error: return type defaults to ‘int’ [-Wimplicit-int]
1 | a() {
  | ^
test000.c: In function ‘a’:
test000.c:2:8: error: ‘__GIMPLE’ only valid with ‘-fgimple’
2 |   void __GIMPLE b()
  |^~~~
test000.c: In function ‘b’:
test000.c:3: error: expected ‘{’ at end of input
test000.c:2:3: internal compiler error: Segmentation fault
2 |   void __GIMPLE b()
  |   ^~~~
0x10a70ff crash_signal
/root/gdbtest/gcc/obj/../gcc/gcc/toplev.cc:319
0x9cbf89 add_stmt(tree_node*)
/root/gdbtest/gcc/obj/../gcc/gcc/c/c-decl.cc:689
0xa505d9 c_parser_declaration_or_fndef
/root/gdbtest/gcc/obj/../gcc/gcc/c/c-parser.cc:3027
0xa24935 c_parser_compound_statement_nostart
/root/gdbtest/gcc/obj/../gcc/gcc/c/c-parser.cc:7135
0xa4e304 c_parser_compound_statement
/root/gdbtest/gcc/obj/../gcc/gcc/c/c-parser.cc:6531
0xa5067f c_parser_declaration_or_fndef
/root/gdbtest/gcc/obj/../gcc/gcc/c/c-parser.cc:3017
0xa5af4b c_parser_external_declaration
/root/gdbtest/gcc/obj/../gcc/gcc/c/c-parser.cc:2046
0xa5b935 c_parser_translation_unit
/root/gdbtest/gcc/obj/../gcc/gcc/c/c-parser.cc:1900
0xa5b935 c_parse_file()
/root/gdbtest/gcc/obj/../gcc/gcc/c/c-parser.cc:26889
0xad3a51 c_common_parse_file()
/root/gdbtest/gcc/obj/../gcc/gcc/c-family/c-opts.cc:1311
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See  for instructions.

***

Also ICE on trunk, compiler explorer:https://godbolt.org/z/TYndM71e7

***

[Bug c++/115623] New: ICE: Segmentation fault ( in contains_struct_check and finish_for_cond for cpp)

2024-06-24 Thread iamanonymous.cs at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115623

Bug ID: 115623
   Summary: ICE: Segmentation fault  ( in contains_struct_check
and finish_for_cond for cpp)
   Product: gcc
   Version: 15.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: iamanonymous.cs at gmail dot com
  Target Milestone: ---
Target: x86_64

***
The compiler produces a segfault during contains_struct_check  when compiling
the provided code with the specified options. 
The issue can also be reproduced on Compiler Explorer.

***
OS and Platform:
# uname -a
Linux ubuntu 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023
x86_64 x86_64 x86_64 GNU/Linux
***
# g++ -v
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/root/gdbtest/gcc/gcc-15/libexec/gcc/x86_64-pc-linux-gnu/15.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /root/gdbtest/gcc/obj/../gcc/configure
--prefix=/root/gdbtest/gcc/gcc-15 --enable-languages=c,c++,fortran,go
--disable-multilib
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 15.0.0 20240509 (experimental) (GCC) 
***
Program:
# cat 1.c

void f (char *a, int i)
{
#pragma GCC novector
  for (;;i++)
a[i] *= 2;
}




***
Command Lines:
# g++ 1.c -O3 -Wpedantic -Wall -Wextra -Wconversion -Wshadow -Wunused
-Woverloaded-virtual -Wpedantic -Wsign-conversion -Wmisleading-indentation
-Wduplicated-cond -Wnull-dereference -Wdouble-promotion -c -o 1.o
1.c: In function ‘void f(char*, int)’:
1.c:4:8: internal compiler error: Segmentation fault
4 |   for (;;i++)
  |^
0x13a93af crash_signal
/root/gdbtest/gcc/obj/../gcc/gcc/toplev.cc:319
0xd22180 contains_struct_check(tree_node*, tree_node_structure_enum, char
const*, int, char const*)
/root/gdbtest/gcc/obj/../gcc/gcc/tree.h:3769
0xd22180 finish_for_cond(tree_node*, tree_node*, bool, tree_node*, bool)
/root/gdbtest/gcc/obj/../gcc/gcc/cp/semantics.cc:1506
0xc840c4 cp_parser_c_for
/root/gdbtest/gcc/obj/../gcc/gcc/cp/parser.cc:14088
0xc840c4 cp_parser_for
/root/gdbtest/gcc/obj/../gcc/gcc/cp/parser.cc:14056
0xc840c4 cp_parser_iteration_statement
/root/gdbtest/gcc/obj/../gcc/gcc/cp/parser.cc:14690
0xc50ec5 cp_parser_pragma
/root/gdbtest/gcc/obj/../gcc/gcc/cp/parser.cc:51340
0xc84977 cp_parser_statement
/root/gdbtest/gcc/obj/../gcc/gcc/cp/parser.cc:12843
0xc59807 cp_parser_statement_seq_opt
/root/gdbtest/gcc/obj/../gcc/gcc/cp/parser.cc:13427
0xc59a2f cp_parser_compound_statement
/root/gdbtest/gcc/obj/../gcc/gcc/cp/parser.cc:13281
0xc7ccd5 cp_parser_function_body
/root/gdbtest/gcc/obj/../gcc/gcc/cp/parser.cc:26072
0xc7ccd5 cp_parser_ctor_initializer_opt_and_function_body
/root/gdbtest/gcc/obj/../gcc/gcc/cp/parser.cc:26123
0xc8241e cp_parser_function_definition_after_declarator
/root/gdbtest/gcc/obj/../gcc/gcc/cp/parser.cc:32903
0xc835be cp_parser_function_definition_from_specifiers_and_declarator
/root/gdbtest/gcc/obj/../gcc/gcc/cp/parser.cc:32820
0xc835be cp_parser_init_declarator
/root/gdbtest/gcc/obj/../gcc/gcc/cp/parser.cc:23451
0xc5668f cp_parser_simple_declaration
/root/gdbtest/gcc/obj/../gcc/gcc/cp/parser.cc:15958
0xc8ffea cp_parser_declaration
/root/gdbtest/gcc/obj/../gcc/gcc/cp/parser.cc:15631
0xc90fea cp_parser_toplevel_declaration
/root/gdbtest/gcc/obj/../gcc/gcc/cp/parser.cc:15652
0xc90fea cp_parser_translation_unit
/root/gdbtest/gcc/obj/../gcc/gcc/cp/parser.cc:5284
0xc90fea c_parse_file()
/root/gdbtest/gcc/obj/../gcc/gcc/cp/parser.cc:51440
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.


***

Also ICE on trunk, compiler explorer:https://godbolt.org/z/zY8bvPj3T

***

[Bug c++/115620] New: internal compiler error: output_operand: invalid expression as operand

2024-06-24 Thread iamanonymous.cs at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115620

Bug ID: 115620
   Summary: internal compiler error: output_operand: invalid
expression as operand
   Product: gcc
   Version: 15.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: iamanonymous.cs at gmail dot com
  Target Milestone: ---
Target: x86_64

***
The compiler produces an internal error during tsubst_pack_expansion when
compiling the provided code with the specified options. 
The issue can also be reproduced on Compiler Explorer.

***
OS and Platform:
# uname -a
Linux ubuntu 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023
x86_64 x86_64 x86_64 GNU/Linux
***
# g++ -v
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/root/gdbtest/gcc/gcc-15/libexec/gcc/x86_64-pc-linux-gnu/15.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /root/gdbtest/gcc/obj/../gcc/configure
--prefix=/root/gdbtest/gcc/gcc-15 --enable-languages=c,c++,fortran,go
--disable-multilib
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 15.0.0 20240509 (experimental) (GCC) 
***
Program:
# cat code_0.cpp

#include 
#include 
#include 

[[maybe_unused]] constexpr inline static auto lpartial =
[](auto fn, auto... t0) constexpr noexcept {
  return [=](auto... rest) constexpr noexcept
requires requires { fn(t0..., rest...); }
  { return fn(t0..., rest...); };
};

[[maybe_unused]] constexpr inline static auto fix =
[](auto self) constexpr noexcept {
  return [=](auto... args) constexpr noexcept
requires requires { self(self, args...); }
  { return self(self, args...); };
};

[[maybe_unused]] constexpr inline static auto currify0 =
[](auto self, auto v, auto fn) constexpr noexcept {
  return [=](auto... as) constexpr noexcept
requires(
(v.value > sizeof...(as) && requires { lpartial(fn, as...); }) ||
(v.value == sizeof...(as) && requires { fn(as...); }))
  {
if constexpr (v.value > sizeof...(as))
  return self(self, std::integral_constant{}, lpartial(fn, as...));
else
  return fn(as...);
  };
};

[[maybe_unused]] constexpr static inline auto plus =
[](auto x, auto y) constexpr noexcept
  requires requires { x + y; }
{ return x + y; };

#undef lambda_body

[[maybe_unused]] constexpr static inline auto plus_ =
fix(currify0)(std::integral_constant{}, plus);




***
Command Lines:
# g++ code_0.cpp -O3 -Wpedantic -Wall -Wextra -Wconversion -Wshadow
-Wnon-virtual-dtor -Wold-style-cast -Wcast-align -Wunused -Woverloaded-virtual
-Wpedantic -Wsign-conversion -Wmisleading-indentation -Wduplicated-cond
-Wnull-dereference -Wdouble-promotion -Wformat=2 -Wno-unused-parameter -c -o
code_0.o
code_0.cpp:8:9: warning: identifier ‘requires’ is a keyword in C++20
[-Wc++20-compat]
8 | requires requires { fn(t0..., rest...); }
  | ^~~~
code_0.cpp: In lambda function:
code_0.cpp:8:9: error: ‘requires’ only available with ‘-std=c++20’ or
‘-fconcepts’
code_0.cpp:8:18: error: ‘requires’ was not declared in this scope
8 | requires requires { fn(t0..., rest...); }
  |  ^~~~
code_0.cpp:8:50: error: expected ‘;’ before ‘{’ token
8 | requires requires { fn(t0..., rest...); }
  |  ^
  |  ;
9 |   { return fn(t0..., rest...); };
  |   ~   
code_0.cpp:9:26: error: ‘rest’ was not declared in this scope
9 |   { return fn(t0..., rest...); };
  |  ^~~~
code_0.cpp: In lambda function:
code_0.cpp:15:9: error: ‘requires’ only available with ‘-std=c++20’ or
‘-fconcepts’
   15 | requires requires { self(self, args...); }
  | ^~~~
code_0.cpp:15:18: error: ‘requires’ was not declared in this scope
   15 | requires requires { self(self, args...); }
  |  ^~~~
code_0.cpp:15:51: error: expected ‘;’ before ‘{’ token
   15 | requires requires { self(self, args...); }
  |   ^
  |   ;
   16 |   { return self(self, args...); };
  |   ~
code_0.cpp:16:27: error: ‘args’ was not declared in this scope
  

[Bug c++/115599] New: ICE: qsort checking failed during GIMPLE pass: reassoc (error: qsort comparator non-negative on sorted output: 150142972)

2024-06-23 Thread iamanonymous.cs at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115599

Bug ID: 115599
   Summary: ICE: qsort checking failed during GIMPLE pass: reassoc
(error: qsort comparator non-negative on sorted
output: 150142972)
   Product: gcc
   Version: 15.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: iamanonymous.cs at gmail dot com
  Target Milestone: ---
Target: x86_64

***
The compiler produces an internal error during during GIMPLE pass: reassoc
compiling the provided code with the specified options. 
The issue can also be reproduced on Compiler Explorer.

***
OS and Platform:
# uname -a
Linux ubuntu 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023
x86_64 x86_64 x86_64 GNU/Linux
***
# gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/root/gdbtest/gcc/gcc-15/libexec/gcc/x86_64-pc-linux-gnu/15.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /root/gdbtest/gcc/obj/../gcc/configure
--prefix=/root/gdbtest/gcc/gcc-15 --enable-languages=c,c++,fortran,go
--disable-multilib
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 15.0.0 20240509 (experimental) (GCC) 
***
Program: Please refer to the attachment. 

***

Command Lines: g++ f.cpp -O1  -std=c++2a -Wall -Wextra -pedantic
-fsanitize=undefined -c -o f.o
: In function 'void tf_4_foo()':
:213:79: warning: division by zero [-Wdiv-by-zero]
  213 | if 0 ? 0 : ((0 ? 0 : ((0 ? 0 :
(tf_4_var_6))) / 0) / 0) {
  | 
~^~~
:213:84: warning: division by zero [-Wdiv-by-zero]
  213 | if 0 ? 0 : ((0 ? 0 : ((0 ? 0 :
(tf_4_var_6))) / 0) / 0) {
  |
~~~^~~
:215:1798: warning: division by zero [-Wdiv-by-zero]
  215 |   if bool) (((0 ? 0 : ((0 ? 0 : bool) 
..
..
..
..
..
((bool) (tf_4_var_246))) : ((unsigned int) bool) (((*(tf_4_ptr_152)) ?
(tf_4_array_4 [1]) : (tf_4_var_2 ? (((tf_4_var_178) ? ((int) (tf_4_var_72))
: ((int) (tf_4_var_150 : ((int) (((bool) (tf_4_var_34)) && ((bool)
(tf_4_var_94) : ((unsigned int) ((int) (((bool) bool) bool)
(4095U)) ? ((int) (tf_4_var_72)) : (-1 ? bool) (-31)) ? ((int)
(tf_4_var_218)) : ((int) (tf_4_array_2 [2] : ((int) (((bool) (-1)) &&
((bool) (4095U))) || (((bool) bool) (tf_4_var_56)) ? ((unsigned int)
((int) (tf_4_var_148))) : (*(tf_4_ptr_8) || (((bool) (tf_4_var_148)) ||
((bool) (tf_4_array_4 [2])); }
:209:28: error: qsort comparator non-negative on sorted output:
2147418113
  209 |   void tf_4_foo () {
  |^~~~
during GIMPLE pass: reassoc
:209:28: internal compiler error: qsort checking failed
0x26cfeec internal_error(char const*, ...)
???:0
0x2715408 gcc_qsort(void*, unsigned long, unsigned long, int (*)(void const*,
void const*))
???:0
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.
Compiler returned: 1
***

Also ICE on trunk, compiler explorer:https://godbolt.org/z/7xoGq3T4h

***

[Bug c++/115598] ICE: in build_call_a, at cp/call.cc:370

2024-06-23 Thread iamanonymous.cs at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115598

Anonymous  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |DUPLICATE

--- Comment #1 from Anonymous  ---
*** This bug has been marked as a duplicate of bug 115501 ***

*** This bug has been marked as a duplicate of bug 115501 ***

[Bug c++/115501] [13/14/15 Regression] ICE: in build_call_a with dynamic_cast after invalid definition of __cxxabiv1::__dynamic_cast since r13-3299

2024-06-23 Thread iamanonymous.cs at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115501

--- Comment #9 from Anonymous  ---
*** Bug 115598 has been marked as a duplicate of this bug. ***

[Bug c++/115598] New: ICE: in build_call_a, at cp/call.cc:370

2024-06-23 Thread iamanonymous.cs at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115598

Bug ID: 115598
   Summary: ICE: in build_call_a, at cp/call.cc:370
   Product: gcc
   Version: 15.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: iamanonymous.cs at gmail dot com
  Target Milestone: ---
Target: x86_64

***
The compiler produces an internal error during build_call_a when compiling the
provided code with the specified options. 
The issue can also be reproduced on Compiler Explorer.

***
OS and Platform:
# uname -a
Linux ubuntu 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023
x86_64 x86_64 x86_64 GNU/Linux
***
# g++ -v
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/root/gdbtest/gcc/gcc-15/libexec/gcc/x86_64-pc-linux-gnu/15.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /root/gdbtest/gcc/obj/../gcc/configure
--prefix=/root/gdbtest/gcc/gcc-15 --enable-languages=c,c++,fortran,go
--disable-multilib
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 15.0.0 20240509 (experimental) (GCC) 
***
Program:
# cat 2.ii

namespace std
{
  class exception
  {
virtual ~exception() throw();
  };
}
namespace std __attribute__((__visibility__("default")))
{
  template , typename
_Alloc = allocator<_CharT>>
  class basic_string;
  typedef basic_string string;
}
namespace boost
{
  class exception
  {
  };
}
namespace __cxxabiv1
{
  extern "C" void *__dynamic_cast(const void *__src_ptr, const
__class_type_info *__src_type, const __class_type_info *__dst_type, ptrdiff_t
__src2dst);
  inline std::string diagnostic_information_impl(boost::exception const *be,
std::exception const *se, bool with_what)
  {
if (!be)
  be = dynamic_cast(se);
  }
}

***
Command Lines:
# g++ 2.ii  -Werror -O2 -ftrapv -fstack-protector-strong -o -c 2.o
\2.ii:10:49: error: ‘char_traits’ does not name a type
   10 |   template ,
typename _Alloc = allocator<_CharT>>
  | ^~~
2.ii:10:60: error: expected ‘>’ before ‘<’ token
   10 |   template ,
typename _Alloc = allocator<_CharT>>
  |^
2.ii:12:28: error: template argument 2 is invalid
   12 |   typedef basic_string string;
  |^
2.ii:22:64: error: ‘__class_type_info’ does not name a type
   22 |   extern "C" void *__dynamic_cast(const void *__src_ptr, const
__class_type_info *__src_type, const __class_type_info *__dst_type, ptrdiff_t
__src2dst);
  |   
^
2.ii:22:101: error: ‘__class_type_info’ does not name a type
   22 |   extern "C" void *__dynamic_cast(const void *__src_ptr, const
__class_type_info *__src_type, const __class_type_info *__dst_type, ptrdiff_t
__src2dst);
  |
^
2.ii:22:132: error: ‘ptrdiff_t’ has not been declared
   22 |   extern "C" void *__dynamic_cast(const void *__src_ptr, const
__class_type_info *__src_type, const __class_type_info *__dst_type, ptrdiff_t
__src2dst);
  |
   ^
: error: conflicting declaration of C function ‘void*
__cxxabiv1::__dynamic_cast(const void*, const __class_type_info*, const
__class_type_info*, long int)’
2.ii:22:20: note: previous declaration ‘void* __cxxabiv1::__dynamic_cast(const
void*, const int*, const int*, int)’
   22 |   extern "C" void *__dynamic_cast(const void *__src_ptr, const
__class_type_info *__src_type, const __class_type_info *__dst_type, ptrdiff_t
__src2dst);
  |^~
2.ii: In function ‘std::string __cxxabiv1::diagnostic_information_impl(const
boost::exception*, const std::exception*, bool)’:
2.ii:26:53: internal compiler error: in build_call_a, at cp/call.cc:370
   26 |   be = dynamic_cast(se);
  | ^
0x7958c9 build_call_a(tree_node*, int, tree_node**)
/root/gdbtest/gcc/obj/../gcc/gcc/cp/call.cc:370
0xaa4a20 build_cxx_call(tree_node*, int, tree_node**, int, tree_node*)
/root/gdbtest/gcc/obj/../gcc/gcc/cp/call.cc:11083
0xcf87e6 build_dynamic_cast_1
/root/gdbtest/gcc/obj/../gcc/gcc/cp/rtti.cc:797
0xcf87e6 build_dynamic_cast(unsigned int, tree_node*, 

[Bug middle-end/115595] New: ICE: in expand_call_tm, at trans-mem.cc:2546 with attribute optimize and noipa

2024-06-23 Thread iamanonymous.cs at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115595

Bug ID: 115595
   Summary: ICE: in expand_call_tm, at trans-mem.cc:2546 with
attribute optimize and noipa
   Product: gcc
   Version: 15.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: middle-end
  Assignee: unassigned at gcc dot gnu.org
  Reporter: iamanonymous.cs at gmail dot com
  Target Milestone: ---

ICE on trunk.
Compiler Explorer: https://godbolt.org/z/bevrv3Gcs

***
OS and Platform:
$ uname -a:
Linux ubuntu 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023
x86_64 x86_64 x86_64 GNU/Linux
***
gcc version:
Using built-in specs.
COLLECT_GCC=/root/gcc_set/trunk-48a320a/bin/gcc
COLLECT_LTO_WRAPPER=/root/gcc_set/trunk-48a320a/libexec/gcc/x86_64-pc-linux-gnu/15.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/root/gcc_set/trunk-48a320a
--with-gmp=/root/build_essential --with-mpfr=/root/build_essential
--with-mpc=/root/build_essential --enable-languages=c,c++ --disable-multilib
--with-sanitizer=address,undefined,thread,leak --enable-coverage
--disable-bootstrap
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 15.0.0 20240426 (experimental) (GCC) 

***
Program:
$ cat mutant.c
int a;
__attribute__((optimize(1), noipa)) void b() {
  __transaction_atomic {
if (a)
  __transaction_cancel;
  }
}

***
Command Lines:
$ gcc -fsanitize=thread -fgnu-tm mutant.c
during GIMPLE pass: tmmark
mutant.c: In function ‘b’:
mutant.c:2:42: internal compiler error: in expand_call_tm, at trans-mem.cc:2546
2 | __attribute__((optimize(1), noipa)) void b() {
  |  ^
0x1e577fa expand_call_tm
../../gcc/gcc/trans-mem.cc:2546
0x1e57fb1 expand_block_tm
../../gcc/gcc/trans-mem.cc:2651
0x1e5a18c execute_tm_mark
../../gcc/gcc/trans-mem.cc:3129
0x1e5a344 execute
../../gcc/gcc/trans-mem.cc:3176
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See  for instructions.

[Bug c++/115588] New: ICE: in tsubst_stmt, at cp/pt.cc:18527

2024-06-22 Thread iamanonymous.cs at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115588

Bug ID: 115588
   Summary: ICE: in tsubst_stmt, at cp/pt.cc:18527
   Product: gcc
   Version: 15.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: iamanonymous.cs at gmail dot com
  Target Milestone: ---
Target: x86_64

***
The compiler produces an internal error during the tsubst_lambda_expr when
compiling the provided code with the specified options. 
The issue can also be reproduced on Compiler Explorer.

***
OS and Platform:
# uname -a
Linux ubuntu 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023
x86_64 x86_64 x86_64 GNU/Linux
***
# g++ -v
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/root/gdbtest/gcc/gcc-15/libexec/gcc/x86_64-pc-linux-gnu/15.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /root/gdbtest/gcc/obj/../gcc/configure
--prefix=/root/gdbtest/gcc/gcc-15 --enable-languages=c,c++,fortran,go
--disable-multilib
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 15.0.0 20240509 (experimental) (GCC) 
***
Program:
# cat t.c

template 
int f (int n)
{
  int x[1][n];

  return [x[0]] /* () { return 0; } */; 
}

int i = f<1>(1);



***
Command Lines:
# g++ t.c -flto -fwhole-program -g -gdwarf-4 -ggdb3 -grecord-gcc-switches
-fanalyzer -fdump-analyzer -Wno-analyzer-nul
l-dereference -Wno-analyzer-use-after-free -c -o t.o
t.c: In function ‘int f(int)’:
t.c:6:12: error: expected ‘,’ before ‘[’ token
6 |   return [x[0]] /* () { return 0; } */;
  |^
  |,
t.c:6:12: error: expected identifier before ‘[’ token
t.c: In lambda function:
t.c:6:39: error: expected ‘{’ before ‘;’ token
6 |   return [x[0]] /* () { return 0; } */;
  |   ^
t.c: In instantiation of ‘int f(int) [with int N = 1]’:
t.c:9:13:   required from here
9 | int i = f<1>(1);
  | ^~~
t.c:6:10: sorry, unimplemented: capture of variably-modified type ‘int [1][n]’
that is not an N3639 array of runtime bound
6 |   return [x[0]] /* () { return 0; } */;
  |  ^~
t.c:6:10: note: because the array element type ‘int [n]’ has variable size
t.c:6:15: internal compiler error: in tsubst_stmt, at cp/pt.cc:18514
6 |   return [x[0]] /* () { return 0; } */;
  |   ^
0x8308a0 tsubst_stmt
/root/gdbtest/gcc/obj/../gcc/gcc/cp/pt.cc:18514
0xce1718 tsubst_stmt
/root/gdbtest/gcc/obj/../gcc/gcc/cp/pt.cc:18410
0xce1718 tsubst_lambda_expr(tree_node*, tree_node*, int, tree_node*)
/root/gdbtest/gcc/obj/../gcc/gcc/cp/pt.cc:19850
0xcbe1a0 tsubst_expr(tree_node*, tree_node*, int, tree_node*)
/root/gdbtest/gcc/obj/../gcc/gcc/cp/pt.cc:21757
0xcc4837 tsubst_stmt
/root/gdbtest/gcc/obj/../gcc/gcc/cp/pt.cc:19482
0xcc6446 tsubst_stmt
/root/gdbtest/gcc/obj/../gcc/gcc/cp/pt.cc:18434
0xcc6106 tsubst_stmt
/root/gdbtest/gcc/obj/../gcc/gcc/cp/pt.cc:18410
0xcc6106 tsubst_stmt
/root/gdbtest/gcc/obj/../gcc/gcc/cp/pt.cc:18424
0xcc6bee tsubst_stmt
/root/gdbtest/gcc/obj/../gcc/gcc/cp/pt.cc:18797
0xce0b52 tsubst_stmt
/root/gdbtest/gcc/obj/../gcc/gcc/cp/pt.cc:18410
0xce0b52 instantiate_body
/root/gdbtest/gcc/obj/../gcc/gcc/cp/pt.cc:27107
0xcc4425 instantiate_decl(tree_node*, bool, bool)
/root/gdbtest/gcc/obj/../gcc/gcc/cp/pt.cc:27392
0xcf0c4b instantiate_pending_templates(int)
/root/gdbtest/gcc/obj/../gcc/gcc/cp/pt.cc:27468
0xb8cc67 c_parse_final_cleanups()
/root/gdbtest/gcc/obj/../gcc/gcc/cp/decl2.cc:5195
0xddf3a0 c_common_parse_file()
/root/gdbtest/gcc/obj/../gcc/gcc/c-family/c-opts.cc:1329
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.


***

Also ICE on trunk, compiler explorer:https://godbolt.org/z/4j14rxbfr

***

[Bug c/115573] New: ICE: verify_flow_info failed with no_reorder attribute

2024-06-20 Thread iamanonymous.cs at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115573

Bug ID: 115573
   Summary: ICE: verify_flow_info failed with no_reorder attribute
   Product: gcc
   Version: 15.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: iamanonymous.cs at gmail dot com
  Target Milestone: ---

ICE on trunk.
Compiler Explorer: https://godbolt.org/z/8sbP3Ydh6

***
OS and Platform:
$ uname -a:
Linux ubuntu 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023
x86_64 x86_64 x86_64 GNU/Linux
***
gcc version:
Using built-in specs.
COLLECT_GCC=/root/gcc_set/trunk-48a320a/bin/gcc
COLLECT_LTO_WRAPPER=/root/gcc_set/trunk-48a320a/libexec/gcc/x86_64-pc-linux-gnu/15.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/root/gcc_set/trunk-48a320a
--with-gmp=/root/build_essential --with-mpfr=/root/build_essential
--with-mpc=/root/build_essential --enable-languages=c,c++ --disable-multilib
--with-sanitizer=address,undefined,thread,leak --enable-coverage
--disable-bootstrap
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 15.0.0 20240426 (experimental) (GCC) 

***
Program:
$ cat mutant.c
int a;
__attribute__((no_reorder)) int b() {
  __label__ d, e;
  void f(int c) { goto *c ? & : & }
d:
  f(a);
e:
}

***
Command Lines:
$ gcc -O2 mutant.c
mutant.c: In function ‘f’:
mutant.c:4:40: error: basic block 2 edge lists are corrupted
4 |   void f(int c) { goto *c ? & : & }
  |^
during RTL pass: cprop
mutant.c:4:40: internal compiler error: verify_flow_info failed
0x117ca2f verify_flow_info()
../../gcc/gcc/cfghooks.cc:287
0x116b814 checking_verify_flow_info()
../../gcc/gcc/cfghooks.h:214
0x11a913e commit_edge_insertions()
../../gcc/gcc/cfgrtl.cc:2155
0x45abf2f bypass_conditional_jumps
../../gcc/gcc/cprop.cc:1744
0x45ac80c one_cprop_pass
../../gcc/gcc/cprop.cc:1895
0x45acadd execute_rtl_cprop
../../gcc/gcc/cprop.cc:1940
0x45accf0 execute
../../gcc/gcc/cprop.cc:1980
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See  for instructions.

[Bug c++/115572] internal compiler error: in dependent_type_p, at cp/pt.cc:28020

2024-06-20 Thread iamanonymous.cs at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115572

--- Comment #1 from Anonymous  ---
***
The compiler produces an internal error in lookup_template_class when compiling
the provided code with the specified options. 
The issue can also be reproduced on Compiler Explorer.

***
OS and Platform:
# uname -a
Linux ubuntu 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023
x86_64 x86_64 x86_64 GNU/Linux
***
# g++ -v
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/root/gdbtest/gcc/gcc-15/libexec/gcc/x86_64-pc-linux-gnu/15.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /root/gdbtest/gcc/obj/../gcc/configure
--prefix=/root/gdbtest/gcc/gcc-15 --enable-languages=c,c++,fortran,go
--disable-multilib
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 15.0.0 20240509 (experimental) (GCC) 
***
Program:
# cat source_code_1.cpp

template 
auto f(Ts...) {
  [] { enum class e : Ts {}; };
}

int main() {
  f(0, true);
}


***
Command Lines:
# g++ source_code_1.cpp  -std=c++2a -Wall -Wextra -pedantic
-fsanitize=undefined -fsanitize=address -O2 -c -o source_code_1.o
source_code_1.cpp: In instantiation of ‘auto f(Ts ...) [with Ts = {int,
bool}]’:
source_code_1.cpp:7:4:   required from here
7 |   f(0, true);
  |   ~^
source_code_1.cpp:3:19: internal compiler error: in dependent_type_p, at
cp/pt.cc:28020
3 |   [] { enum class e : Ts {}; };
  |   ^
0x825d35 dependent_type_p(tree_node*)
/root/gdbtest/gcc/obj/../gcc/gcc/cp/pt.cc:28020
0xb55fd3 start_enum(tree_node*, tree_node*, tree_node*, tree_node*, bool,
bool*)
/root/gdbtest/gcc/obj/../gcc/gcc/cp/decl.cc:17113
0xcde80b lookup_template_class(tree_node*, tree_node*, tree_node*, tree_node*,
int)
/root/gdbtest/gcc/obj/../gcc/gcc/cp/pt.cc:10268
0xcd2cd0 tsubst(tree_node*, tree_node*, int, tree_node*)
/root/gdbtest/gcc/obj/../gcc/gcc/cp/pt.cc:16265
0xccf2d4 tsubst_decl
/root/gdbtest/gcc/obj/../gcc/gcc/cp/pt.cc:15435
0xcc77e4 tsubst_stmt
/root/gdbtest/gcc/obj/../gcc/gcc/cp/pt.cc:18541
0xcc6106 tsubst_stmt
/root/gdbtest/gcc/obj/../gcc/gcc/cp/pt.cc:18410
0xcc6106 tsubst_stmt
/root/gdbtest/gcc/obj/../gcc/gcc/cp/pt.cc:18424
0xcc6bee tsubst_stmt
/root/gdbtest/gcc/obj/../gcc/gcc/cp/pt.cc:18797
0xce1718 tsubst_stmt
/root/gdbtest/gcc/obj/../gcc/gcc/cp/pt.cc:18410
0xce1718 tsubst_lambda_expr(tree_node*, tree_node*, int, tree_node*)
/root/gdbtest/gcc/obj/../gcc/gcc/cp/pt.cc:19850
0xcbe1a0 tsubst_expr(tree_node*, tree_node*, int, tree_node*)
/root/gdbtest/gcc/obj/../gcc/gcc/cp/pt.cc:21757
0xcc4837 tsubst_stmt
/root/gdbtest/gcc/obj/../gcc/gcc/cp/pt.cc:19482
0xcc55cc tsubst_stmt
/root/gdbtest/gcc/obj/../gcc/gcc/cp/pt.cc:18442
0xcc6106 tsubst_stmt
/root/gdbtest/gcc/obj/../gcc/gcc/cp/pt.cc:18410
0xcc6106 tsubst_stmt
/root/gdbtest/gcc/obj/../gcc/gcc/cp/pt.cc:18424
0xcc6bee tsubst_stmt
/root/gdbtest/gcc/obj/../gcc/gcc/cp/pt.cc:18797
0xce0b52 tsubst_stmt
/root/gdbtest/gcc/obj/../gcc/gcc/cp/pt.cc:18410
0xce0b52 instantiate_body
/root/gdbtest/gcc/obj/../gcc/gcc/cp/pt.cc:27107
0xcc4425 instantiate_decl(tree_node*, bool, bool)
/root/gdbtest/gcc/obj/../gcc/gcc/cp/pt.cc:27392
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.

***

Also ICE on trunk, compiler explorer:https://godbolt.org/z/7aPr9fWxn

***

[Bug c++/115572] New: internal compiler error: in dependent_type_p, at cp/pt.cc:28020

2024-06-20 Thread iamanonymous.cs at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115572

Bug ID: 115572
   Summary: internal compiler error: in dependent_type_p, at
cp/pt.cc:28020
   Product: gcc
   Version: 15.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: iamanonymous.cs at gmail dot com
  Target Milestone: ---
Target: x86_64

[Bug c++/115560] New: ICE: in type_dependent_expression_p, at cp/pt.cc:28576

2024-06-20 Thread iamanonymous.cs at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115560

Bug ID: 115560
   Summary: ICE: in type_dependent_expression_p, at cp/pt.cc:28576
   Product: gcc
   Version: 15.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: iamanonymous.cs at gmail dot com
  Target Milestone: ---
Target: x86_64

***
The compiler produces an internal error in type_dependent_expression_p when
compiling the provided code with the specified options. 
The issue can also be reproduced on Compiler Explorer.

***
OS and Platform:
# uname -a
Linux ubuntu 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023
x86_64 x86_64 x86_64 GNU/Linux
***
# g++ -v
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/root/gdbtest/gcc/gcc-15/libexec/gcc/x86_64-pc-linux-gnu/15.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /root/gdbtest/gcc/obj/../gcc/configure
--prefix=/root/gdbtest/gcc/gcc-15 --enable-languages=c,c++,fortran,go
--disable-multilib
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 15.0.0 20240509 (experimental) (GCC) 
***
Program:
# cat source_code_1.cpp

struct C { void f(auto) noexcept; };
void C::f(auto) noexcept(C::x) {}


***
Command Lines:
# g++ source_code_1.cpp  -std=c++2a -Wall -Wextra -pedantic
-fsanitize=undefined -fsanitize=address -O2 -c -o source_code_1.o
source_code_1.cpp:3:29: error: ‘x’ is not a member of ‘C’
3 | void C::f(auto) noexcept(C::x) {}
  | ^
source_code_1.cpp:3:6: error: declaration of ‘void C::f(auto:2)’ has a
different exception specifier
3 | void C::f(auto) noexcept(C::x) {}
  |  ^
source_code_1.cpp:2:17: note: from previous declaration ‘void C::f(auto:1)
noexcept’
2 | struct C { void f(auto) noexcept; };
  | ^
source_code_1.cpp:3:30: internal compiler error: in
type_dependent_expression_p, at cp/pt.cc:28576
3 | void C::f(auto) noexcept(C::x) {}
  |  ^
0x82608a type_dependent_expression_p(tree_node*)
/root/gdbtest/gcc/obj/../gcc/gcc/cp/pt.cc:28576
0xcac924 instantiation_dependent_r
/root/gdbtest/gcc/obj/../gcc/gcc/cp/pt.cc:28781
0x16e163c walk_tree_1(tree_node**, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set >*,
tree_node* (*)(tree_node**, int*, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set >*))
/root/gdbtest/gcc/obj/../gcc/gcc/tree.cc:11468
0x16e4db5 walk_tree_without_duplicates_1(tree_node**, tree_node*
(*)(tree_node**, int*, void*), void*, tree_node* (*)(tree_node**, int*,
tree_node* (*)(tree_node**, int*, void*), void*, hash_set >*))
/root/gdbtest/gcc/obj/../gcc/gcc/tree.cc:11728
0xca8299 instantiation_dependent_uneval_expression_p(tree_node*)
/root/gdbtest/gcc/obj/../gcc/gcc/cp/pt.cc:28810
0xca8299 instantiation_dependent_expression_p(tree_node*)
/root/gdbtest/gcc/obj/../gcc/gcc/cp/pt.cc:28820
0xca832c uses_template_parms(tree_node*)
/root/gdbtest/gcc/obj/../gcc/gcc/cp/pt.cc:11129
0xb5e638 duplicate_decls(tree_node*, tree_node*, bool, bool)
/root/gdbtest/gcc/obj/../gcc/gcc/cp/decl.cc:2662
0xb628c6 grokfndecl
/root/gdbtest/gcc/obj/../gcc/gcc/cp/decl.cc:11094
0xb69a7b grokdeclarator(cp_declarator const*, cp_decl_specifier_seq*,
decl_context, int, tree_node**)
/root/gdbtest/gcc/obj/../gcc/gcc/cp/decl.cc:15114
0xb6d066 start_function(cp_decl_specifier_seq*, cp_declarator const*,
tree_node*)
/root/gdbtest/gcc/obj/../gcc/gcc/cp/decl.cc:18212
0xc83107 cp_parser_function_definition_from_specifiers_and_declarator
/root/gdbtest/gcc/obj/../gcc/gcc/cp/parser.cc:32780
0xc83107 cp_parser_init_declarator
/root/gdbtest/gcc/obj/../gcc/gcc/cp/parser.cc:23451
0xc5668f cp_parser_simple_declaration
/root/gdbtest/gcc/obj/../gcc/gcc/cp/parser.cc:15958
0xc8ffea cp_parser_declaration
/root/gdbtest/gcc/obj/../gcc/gcc/cp/parser.cc:15631
0xc90fea cp_parser_toplevel_declaration
/root/gdbtest/gcc/obj/../gcc/gcc/cp/parser.cc:15652
0xc90fea cp_parser_translation_unit
/root/gdbtest/gcc/obj/../gcc/gcc/cp/parser.cc:5284
0xc90fea c_parse_file()
/root/gdbtest/gcc/obj/../gcc/gcc/cp/parser.cc:51440
0xddf371 c_common_parse_file()
/root/gdbtest/gcc/obj/../gcc/gcc/c-family/c-opts.cc:1311
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See  for 

[Bug c/115549] New: ICE: tree check: expected tree that contains ‘decl common’ structure, have ‘error_mark’ in common_handle_aligned_attribute, at c-family/c-attribs.cc:2665 with invalid aligned attri

2024-06-19 Thread iamanonymous.cs at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115549

Bug ID: 115549
   Summary: ICE: tree check: expected tree that contains ‘decl
common’ structure, have ‘error_mark’ in
common_handle_aligned_attribute, at
c-family/c-attribs.cc:2665 with invalid aligned
attribute
   Product: gcc
   Version: 15.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: iamanonymous.cs at gmail dot com
  Target Milestone: ---

ICE on trunk.
Compiler Explorer: https://godbolt.org/z/zcab6cfWj

***
OS and Platform:
$ uname -a:
Linux ubuntu 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023
x86_64 x86_64 x86_64 GNU/Linux
***
gcc version:
Using built-in specs.
COLLECT_GCC=/root/gcc_set/trunk-48a320a/bin/gcc
COLLECT_LTO_WRAPPER=/root/gcc_set/trunk-48a320a/libexec/gcc/x86_64-pc-linux-gnu/15.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/root/gcc_set/trunk-48a320a
--with-gmp=/root/build_essential --with-mpfr=/root/build_essential
--with-mpc=/root/build_essential --enable-languages=c,c++ --disable-multilib
--with-sanitizer=address,undefined,thread,leak --enable-coverage
--disable-bootstrap
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 15.0.0 20240426 (experimental) (GCC) 

***
Program:
$ cat mutant.c
__attribute__((aligned, optimize(s),)0) s()

***
Command Lines:
$ gcc mutant.c
mutant.c:1:34: error: ‘s’ undeclared here (not in a function)
1 | __attribute__((aligned, optimize(s),)0) s()
  |  ^
mutant.c:1:38: error: expected ‘)’ before numeric constant
1 | __attribute__((aligned, optimize(s),)0) s()
  |  ^
  |  )
mutant.c:1:1: internal compiler error: tree check: expected tree that contains
‘decl common’ structure, have ‘error_mark’ in common_handle_aligned_attribute,
at c-family/c-attribs.cc:2665
1 | __attribute__((aligned, optimize(s),)0) s()
  | ^
0x25433e9 tree_contains_struct_check_failed(tree_node const*,
tree_node_structure_enum, char const*, int, char const*)
../../gcc/gcc/tree.cc:9130
0xd34731 contains_struct_check(tree_node*, tree_node_structure_enum, char
const*, int, char const*)
../../gcc/gcc/tree.h:3770
0x10360bf common_handle_aligned_attribute
../../gcc/gcc/c-family/c-attribs.cc:2665
0x103692a handle_aligned_attribute
../../gcc/gcc/c-family/c-attribs.cc:2750
0xd2acd9 decl_attributes(tree_node**, tree_node*, int, tree_node*)
../../gcc/gcc/attribs.cc:900
0xd598f1 c_decl_attributes
../../gcc/gcc/c/c-decl.cc:5497
0xd795ab start_function(c_declspecs*, c_declarator*, tree_node*)
../../gcc/gcc/c/c-decl.cc:10483
0xe40891 c_parser_declaration_or_fndef
../../gcc/gcc/c/c-parser.cc:2912
0xe3c6ed c_parser_external_declaration
../../gcc/gcc/c/c-parser.cc:2046
0xe3bbd7 c_parser_translation_unit
../../gcc/gcc/c/c-parser.cc:1900
0xeccd02 c_parse_file()
../../gcc/gcc/c/c-parser.cc:26889
0xfe8faa c_common_parse_file()
../../gcc/gcc/c-family/c-opts.cc:1311
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See  for instructions.

[Bug c/115548] New: ICE: verify_cgraph_node failed with attribute malloc and simd enabled

2024-06-19 Thread iamanonymous.cs at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115548

Bug ID: 115548
   Summary: ICE: verify_cgraph_node failed with attribute malloc
and simd enabled
   Product: gcc
   Version: 15.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: iamanonymous.cs at gmail dot com
  Target Milestone: ---

Also ICE on trunk.
Compiler Explorer: https://godbolt.org/z/1q9nc3acK

***
OS and Platform:
$ uname -a:
Linux ubuntu 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023
x86_64 x86_64 x86_64 GNU/Linux
***
gcc version:
Using built-in specs.
COLLECT_GCC=/root/gcc_set/trunk-48a320a/bin/gcc
COLLECT_LTO_WRAPPER=/root/gcc_set/trunk-48a320a/libexec/gcc/x86_64-pc-linux-gnu/15.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/root/gcc_set/trunk-48a320a
--with-gmp=/root/build_essential --with-mpfr=/root/build_essential
--with-mpc=/root/build_essential --enable-languages=c,c++ --disable-multilib
--with-sanitizer=address,undefined,thread,leak --enable-coverage
--disable-bootstrap
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 15.0.0 20240426 (experimental) (GCC) 

***
Program:
$ cat mutant.c
__attribute__((malloc, simd)) int *a() {}

***
Command Lines:
$ gcc mutant.c
mutant.c:1:1: error: malloc attribute should be used for a function that
returns a pointer
1 | __attribute__((malloc, simd)) int *a() {}
  | ^
_ZGVeM8_a/8 (a.simdclone.7)
  Type: function definition analyzed
  Visibility: externally_visible semantic_interposition no_reorder asm_written
public artificial
  References: 
  Referring: 
  Availability: available
  Function flags: decl_is_malloc
  Called by: 
  Calls: 
mutant.c:1:1: internal compiler error: verify_cgraph_node failed
0x11fec4c cgraph_node::verify_node()
../../gcc/gcc/cgraph.cc:3956
0x11d1c0a symtab_node::verify()
../../gcc/gcc/symtab.cc:1362
0x11d22bd symtab_node::verify_symtab_nodes()
../../gcc/gcc/symtab.cc:1482
0x1219e99 symbol_table::compile()
../../gcc/gcc/cgraphunit.cc:2420
0x121a6f3 symbol_table::finalize_compilation_unit()
../../gcc/gcc/cgraphunit.cc:2589
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See  for instructions.

[Bug c/115530] New: ICE: in verify_loop_structure, at cfgloop.cc:1741 with simd attribute

2024-06-17 Thread iamanonymous.cs at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115530

Bug ID: 115530
   Summary: ICE: in verify_loop_structure, at cfgloop.cc:1741 with
simd attribute
   Product: gcc
   Version: 15.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: iamanonymous.cs at gmail dot com
  Target Milestone: ---

Compiler Explorer: https://godbolt.org/z/c4qPbxcr6

***
OS and Platform:
$ uname -a:
Linux ubuntu 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023
x86_64 x86_64 x86_64 GNU/Linux
***
gcc version:
Using built-in specs.
COLLECT_GCC=/root/gcc_set/trunk-48a320a/bin/gcc
COLLECT_LTO_WRAPPER=/root/gcc_set/trunk-48a320a/libexec/gcc/x86_64-pc-linux-gnu/15.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/root/gcc_set/trunk-48a320a
--with-gmp=/root/build_essential --with-mpfr=/root/build_essential
--with-mpc=/root/build_essential --enable-languages=c,c++ --disable-multilib
--with-sanitizer=address,undefined,thread,leak --enable-coverage
--disable-bootstrap
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 15.0.0 20240426 (experimental) (GCC) 

***
Program:
$ cat mutant.c
void *malloc();
__attribute__((simd)) int a() {
  int *b = malloc();
  __transaction_atomic { b[5] = 3; }
  return b[5];
}

***
Command Lines:
$ gcc -fgnu-tm -O mutant.c
mutant.c: In function ‘a’:
mutant.c:3:12: warning: too few arguments to built-in function ‘malloc’
expecting 1 [-Wbuiltin-declaration-mismatch]
3 |   int *b = malloc();
  |^~
mutant.c:1:7: note: declared here
1 | void *malloc();
  |   ^~
mutant.c: In function ‘a.simdclone.0’:
mutant.c:2:27: error: size of loop 1 should be 8, not 9
2 | __attribute__((simd)) int a() {
  |   ^
during GIMPLE pass: tmmark
mutant.c:2:27: internal compiler error: in verify_loop_structure, at
cfgloop.cc:1741
0x118afec verify_loop_structure()
../../gcc/gcc/cfgloop.cc:1741
0x1b99d62 execute_function_todo
../../gcc/gcc/passes.cc:2105
0x1b97b22 do_per_function
../../gcc/gcc/passes.cc:1688
0x1b9a04c execute_todo
../../gcc/gcc/passes.cc:2143
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See  for instructions.

[Bug c++/115510] New: ICE : Segmentation fault in build_new_method_call and finish_call_expr

2024-06-16 Thread iamanonymous.cs at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115510

Bug ID: 115510
   Summary: ICE : Segmentation fault  in build_new_method_call
and finish_call_expr
   Product: gcc
   Version: 15.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: iamanonymous.cs at gmail dot com
  Target Milestone: ---
Target: x86_64

***
The compiler produces an internal error during build_new_method_call  and
finish_call_expr when compiling the provided code with the specified options. 
The issue can also be reproduced on Compiler Explorer.

***
OS and Platform:
# uname -a
Linux ubuntu 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023
x86_64 x86_64 x86_64 GNU/Linux
***
# g++ -v
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/root/gdbtest/gcc/gcc-15/libexec/gcc/x86_64-pc-linux-gnu/15.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /root/gdbtest/gcc/obj/../gcc/configure
--prefix=/root/gdbtest/gcc/gcc-15 --enable-languages=c,c++,fortran,go
--disable-multilib
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 15.0.0 20240509 (experimental) (GCC) 
***
Program:
# cat main.ii

class a {b(({
a  = ;
class {d(){
  c.b()


***
Command Lines:
# g++ main.ii -std=c++2a -Wall -Wextra -pedantic -fsanitize=address,undefined
-fno-omit-frame-pointer -g -O2 -Wshadow -Wnon-virtual-dtor -Wold-style-cast
-Wcast-align -Wunused -Woverloaded-virtual -Wpedantic -Wconversion
-Wsign-conversion -Wmisleading-indentation -Wduplicated-cond
-Wduplicated-branches -Wlogical-op -Wnull-dereference -Wuseless-cast
-Wdouble-promotion -Wformat=2 -c -o main.o
main.ii:1:20: error: expected identifier before ‘(’ token
1 | class a {b(({
  |^
main.ii:1:21: error: expected ‘)’ before ‘{’ token
1 | class a {b(({
  |~^
  | )
main.ii:1:21: error: expected ‘)’ before ‘{’ token
1 | class a {b(({
  |   ~ ^
  | )
main.ii:1:18: error: ISO C++ forbids declaration of ‘b’ with no type
[-fpermissive]
1 | class a {b(({
  |  ^
main.ii:5:9: error: expected ‘;’ after class definition
5 | 
  | ^
  | ;
main.ii: In member function ‘int a::b(...)’:
main.ii:2:12: error: expected primary-expression before ‘;’ token
2 | a  = ;
  |^
main.ii:3:24: error: ISO C++ forbids declaration of ‘d’ with no type
[-fpermissive]
3 | class {d(){
  |^
main.ii:5:7: error: expected ‘;’ after class definition
5 | 
  |   ^
  |   ;
main.ii: In member function ‘int a::b(...)d()’:
main.ii:4:10: error: use of local variable with automatic storage from
containing function
4 |   c.b()
  |   ~~~^~
main.ii:2:8: note: ‘a& c’ declared here
2 | a  = ;
  |^
main.ii:4:10: internal compiler error: Segmentation fault
4 |   c.b()
  |   ~~~^~
0x13a93af crash_signal
/root/gdbtest/gcc/obj/../gcc/gcc/toplev.cc:319
0xaaac6b build_this_conversion
/root/gdbtest/gcc/obj/../gcc/gcc/cp/call.cc:2386
0xaab84d add_function_candidate
/root/gdbtest/gcc/obj/../gcc/gcc/cp/call.cc:2564
0xaad031 add_candidates
/root/gdbtest/gcc/obj/../gcc/gcc/cp/call.cc:6724
0xab75c8 add_candidates
/root/gdbtest/gcc/obj/../gcc/gcc/cp/call.cc:6536
0xab75c8 build_new_method_call(tree_node*, tree_node*, vec**, tree_node*, int, tree_node**, int)
/root/gdbtest/gcc/obj/../gcc/gcc/cp/call.cc:11723
0xd0b682 finish_call_expr(tree_node*, vec**, bool,
bool, int)
/root/gdbtest/gcc/obj/../gcc/gcc/cp/semantics.cc:2989
0xc69c1f cp_parser_postfix_expression
/root/gdbtest/gcc/obj/../gcc/gcc/cp/parser.cc:8178
0xc44eeb cp_parser_binary_expression
/root/gdbtest/gcc/obj/../gcc/gcc/cp/parser.cc:10398
0xc45c54 cp_parser_assignment_expression
/root/gdbtest/gcc/obj/../gcc/gcc/cp/parser.cc:10742
0xc461f4 cp_parser_expression
/root/gdbtest/gcc/obj/../gcc/gcc/cp/parser.cc:10909
0xc4c927 cp_parser_expression_statement
/root/gdbtest/gcc/obj/../gcc/gcc/cp/parser.cc:13175
0xc8515b cp_parser_statement
/root/gdbtest/gcc/obj/../gcc/gcc/cp/parser.cc:12952
0xc59807 cp_parser_statement_seq_opt
/root/gdbtest/gcc/obj/../gcc/gcc/cp/parser.cc:13427
0xc59a2f 

[Bug c/115509] New: ICE: in set_underlying_type, at c-family/c-common.cc:8613 with attribute aligned and sentinel

2024-06-16 Thread iamanonymous.cs at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115509

Bug ID: 115509
   Summary: ICE: in set_underlying_type, at
c-family/c-common.cc:8613 with attribute aligned and
sentinel
   Product: gcc
   Version: 15.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: iamanonymous.cs at gmail dot com
  Target Milestone: ---

Compiler Explorer: https://godbolt.org/z/da8Txxbs9

***
OS and Platform:
$ uname -a:
Linux ubuntu 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023
x86_64 x86_64 x86_64 GNU/Linux
***
gcc version:
Using built-in specs.
COLLECT_GCC=/root/gcc_set/trunk-48a320a/bin/gcc
COLLECT_LTO_WRAPPER=/root/gcc_set/trunk-48a320a/libexec/gcc/x86_64-pc-linux-gnu/15.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/root/gcc_set/trunk-48a320a
--with-gmp=/root/build_essential --with-mpfr=/root/build_essential
--with-mpc=/root/build_essential --enable-languages=c,c++ --disable-multilib
--with-sanitizer=address,undefined,thread,leak --enable-coverage
--disable-bootstrap
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 15.0.0 20240426 (experimental) (GCC) 

***
Program:
$ cat mutant.c
__attribute__((aligned, sentinel)) typedef (*a)();

***
Command Lines:
$ gcc mutant.c
mutant.c:1:46: error: type defaults to ‘int’ in declaration of ‘a’
[-Wimplicit-int]
1 | __attribute__((aligned, sentinel)) typedef (*a)();
  |  ^
mutant.c:1:1: warning: ‘sentinel’ attribute requires prototypes with named
arguments [-Wattributes]
1 | __attribute__((aligned, sentinel)) typedef (*a)();
  | ^
mutant.c:1:1: internal compiler error: in set_underlying_type, at
c-family/c-common.cc:8613
0xf793db set_underlying_type(tree_node*)
../../gcc/gcc/c-family/c-common.cc:8613
0xd50e3f pushdecl(tree_node*)
../../gcc/gcc/c/c-decl.cc:3524
0xd5ad62 start_decl(c_declarator*, c_declspecs*, bool, tree_node*, bool,
unsigned int*)
../../gcc/gcc/c/c-decl.cc:5705
0xe3fd91 c_parser_declaration_or_fndef
../../gcc/gcc/c/c-parser.cc:2766
0xe3c6ed c_parser_external_declaration
../../gcc/gcc/c/c-parser.cc:2046
0xe3bbd7 c_parser_translation_unit
../../gcc/gcc/c/c-parser.cc:1900
0xeccd02 c_parse_file()
../../gcc/gcc/c/c-parser.cc:26889
0xfe8faa c_common_parse_file()
../../gcc/gcc/c-family/c-opts.cc:1311
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See  for instructions.

[Bug c/115501] New: ICE: in build_call_a, at cp/call.cc:370

2024-06-14 Thread iamanonymous.cs at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115501

Bug ID: 115501
   Summary: ICE: in build_call_a, at cp/call.cc:370
   Product: gcc
   Version: 15.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: iamanonymous.cs at gmail dot com
  Target Milestone: ---
Target: x86_64

***
The compiler produces an internal error when compiling the provided code with
the specified options. 
The issue can also be reproduced on Compiler Explorer.

***
OS and Platform:
# uname -a
Linux ubuntu 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023
x86_64 x86_64 x86_64 GNU/Linux
***
# g++ -v
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/root/gdbtest/gcc/gcc-15/libexec/gcc/x86_64-pc-linux-gnu/15.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /root/gdbtest/gcc/obj/../gcc/configure
--prefix=/root/gdbtest/gcc/gcc-15 --enable-languages=c,c++,fortran,go
--disable-multilib
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 15.0.0 20240509 (experimental) (GCC) 
***
Program:
# 2.ii

namespace std
{
  class exception
  {
virtual ~exception() throw();
  };
}
namespace std __attribute__((__visibility__("default")))
{
  template , typename
_Alloc = allocator<_CharT>>
  class basic_string;
  typedef basic_string string;
}
namespace boost
{
  class exception
  {
  };
}
namespace __cxxabiv1
{
  extern "C" void *__dynamic_cast(const void *__src_ptr, const
__class_type_info *__src_type, const __class_type_info *__dst_type, ptrdiff_t
__src2dst);
  inline std::string diagnostic_information_impl(boost::exception const *be,
std::exception const *se, bool with_what)
  {
if (!be)
  be = dynamic_cast(se);
  }
}

***
Command Lines:
# g++ 2.ii  -std=c++17 -O2 -Wall -Wextra -pedantic -Wshadow -Wnon-virtual-dtor
-Wold-style-cast -Wcast-align -Woverloaded-virtual -Wconversion
-Wsign-conversion -Wmisleading-indentation -Wduplicated-cond
-Wduplicated-branches -Wlogical-op -Wnull-dereference -Wuseless-cast
-Wdouble-promotion -Wformat=2 -Wnoexcept -fstack-protector-strong
-D_GLIBCXX_ASSERTIONS -fvisibility=hidden -fvisibility-inlines-hidden -o -c 2.o
2.ii:10:49: error: ‘char_traits’ does not name a type
   10 |   template ,
typename _Alloc = allocator<_CharT>>
  | ^~~
2.ii:10:60: error: expected ‘>’ before ‘<’ token
   10 |   template ,
typename _Alloc = allocator<_CharT>>
  |^
2.ii:12:28: error: template argument 2 is invalid
   12 |   typedef basic_string string;
  |^
2.ii:22:64: error: ‘__class_type_info’ does not name a type
   22 |   extern "C" void *__dynamic_cast(const void *__src_ptr, const
__class_type_info *__src_type, const __class_type_info *__dst_type, ptrdiff_t
__src2dst);
  |   
^
2.ii:22:101: error: ‘__class_type_info’ does not name a type
   22 |   extern "C" void *__dynamic_cast(const void *__src_ptr, const
__class_type_info *__src_type, const __class_type_info *__dst_type, ptrdiff_t
__src2dst);
  |
^
2.ii:22:132: error: ‘ptrdiff_t’ has not been declared
   22 |   extern "C" void *__dynamic_cast(const void *__src_ptr, const
__class_type_info *__src_type, const __class_type_info *__dst_type, ptrdiff_t
__src2dst);
  |
   ^
: error: conflicting declaration of C function ‘void*
__cxxabiv1::__dynamic_cast(const void*, const __class_type_info*, const
__class_type_info*, long int)’
2.ii:22:20: note: previous declaration ‘void* __cxxabiv1::__dynamic_cast(const
void*, const int*, const int*, int)’
   22 |   extern "C" void *__dynamic_cast(const void *__src_ptr, const
__class_type_info *__src_type, const __class_type_info *__dst_type, ptrdiff_t
__src2dst);
  |^~
2.ii: In function ‘std::string __cxxabiv1::diagnostic_information_impl(const
boost::exception*, const std::exception*, bool)’:
2.ii:26:53: internal compiler error: in build_call_a, at cp/call.cc:370
   26 |   be = dynamic_cast(se);
  | ^
0x7958c9 build_call_a(tree_node*, int, tree_node**)

[Bug c/115489] New: ICE: tree check: expected class 'type', have 'exceptional' (error_mark) in create_tmp_from_val, at gimplify.cc:589

2024-06-14 Thread iamanonymous.cs at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115489

Bug ID: 115489
   Summary: ICE: tree check: expected class 'type', have
'exceptional' (error_mark) in create_tmp_from_val, at
gimplify.cc:589
   Product: gcc
   Version: 15.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: iamanonymous.cs at gmail dot com
  Target Milestone: ---
Target: x86_64

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

***
OS and Platform:
# uname -a
Linux ubuntu 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023
x86_64 x86_64 x86_64 GNU/Linux
***
# gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/root/gdbtest/gcc/gcc-15/libexec/gcc/x86_64-pc-linux-gnu/15.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /root/gdbtest/gcc/obj/../gcc/configure
--prefix=/root/gdbtest/gcc/gcc-15 --enable-languages=c,c++,fortran,go
--disable-multilib
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 15.0.0 20240509 (experimental) (GCC) 
***
Program: Please refer to the attachment. 

***
Command Lines:
# gcc bug892.c -O3 -Wall -Wextra -pedantic -fsanitize=address,undefined
-fstack-protector-strong -march=native -fvisibility=hidden -std=c17 -c -o
bug892.o



bug892.c: In function ‘func_64’:
bug892.c:347:17: internal compiler error: tree check: expected class ‘type’,
have ‘exceptional’ (error_mark) in create_tmp_from_val, at gimplify.cc:589
  347 | l_724[2][1] &=
(safe_rshift_func_int16_t_s_s((safe_mul_func_int16_t_s_s(l_705,
(safe_sub_func_uint64_t_u_u(8UL, (l_709 = ((*l_708) = 0L)),
(((safe_mul_func_uint16_t_u_u(((**g_601)++), (--(*l_714 &
(safe_sub_func_int16_t_s_s((_161 == (l_719 = (void*)0)), ((void*)0 !=
g_720 != (*g_135;
  |   
~^
0x8bbf2a tree_class_check_failed(tree_node const*, tree_code_class, char
const*, int, char const*)
/root/gdbtest/gcc/obj/../gcc/gcc/tree.cc:9045
0x7f33a6 tree_class_check(tree_node*, tree_code_class, char const*, int, char
const*)
/root/gdbtest/gcc/obj/../gcc/gcc/tree.h:3779
0x7f33a6 create_tmp_from_val
/root/gdbtest/gcc/obj/../gcc/gcc/gimplify.cc:589
0x7f33a6 lookup_tmp_var
/root/gdbtest/gcc/obj/../gcc/gcc/gimplify.cc:612
0xd68b1a internal_get_tmp_var
/root/gdbtest/gcc/obj/../gcc/gcc/gimplify.cc:667
0xd6ecce get_initialized_tmp_var(tree_node*, gimple**, gimple**, bool)
/root/gdbtest/gcc/obj/../gcc/gcc/gimplify.cc:711
0xd6ecce gimplify_save_expr
/root/gdbtest/gcc/obj/../gcc/gcc/gimplify.cc:6817
0xd640dd gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
/root/gdbtest/gcc/obj/../gcc/gcc/gimplify.cc:18188
0xd85c17 gimplify_stmt(tree_node**, gimple**)
/root/gdbtest/gcc/obj/../gcc/gcc/gimplify.cc:7581
0xd85c17 gimplify_compound_expr
/root/gdbtest/gcc/obj/../gcc/gcc/gimplify.cc:6766
0xd63f7b gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
/root/gdbtest/gcc/obj/../gcc/gcc/gimplify.cc:17877
0xd663a6 gimplify_stmt(tree_node**, gimple**)
/root/gdbtest/gcc/obj/../gcc/gcc/gimplify.cc:7581
0xd64e33 gimplify_statement_list
/root/gdbtest/gcc/obj/../gcc/gcc/gimplify.cc:2249
0xd64e33 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
/root/gdbtest/gcc/obj/../gcc/gcc/gimplify.cc:18332
0xd663a6 gimplify_stmt(tree_node**, gimple**)
/root/gdbtest/gcc/obj/../gcc/gcc/gimplify.cc:7581
0xd674a6 gimplify_bind_expr
/root/gdbtest/gcc/obj/../gcc/gcc/gimplify.cc:1641
0xd64064 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
/root/gdbtest/gcc/obj/../gcc/gcc/gimplify.cc:18088
0xd663a6 gimplify_stmt(tree_node**, gimple**)
/root/gdbtest/gcc/obj/../gcc/gcc/gimplify.cc:7581
0xd64e33 gimplify_statement_list
/root/gdbtest/gcc/obj/../gcc/gcc/gimplify.cc:2249
0xd64e33 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
/root/gdbtest/gcc/obj/../gcc/gcc/gimplify.cc:18332
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See 

[Bug c++/115472] New: ICE :tree check expected class 'type', have 'exceptional' (error_mark) in check_goto_1, at cpdecl.cc4007

2024-06-13 Thread iamanonymous.cs at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115472

Bug ID: 115472
   Summary: ICE :tree check expected class 'type', have
'exceptional' (error_mark) in check_goto_1, at
cpdecl.cc4007
   Product: gcc
   Version: 15.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: iamanonymous.cs at gmail dot com
  Target Milestone: ---
Target: x86_64

***
I encountered an internal compiler error (ICE) while compiling the following
code snippet using GCC trunk with the provided compilation options.
The ICE occurred in check_goto_1, at cpdecl.cc4007.
The issue can also be reproduced on Compiler Explorer.
Please let me know if you need any further information to resolve this issue.

***
OS and Platform:
# uname -a
Linux ubuntu 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023
x86_64 x86_64 x86_64 GNU/Linux
***
# g++ -v
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/root/gdbtest/gcc/gcc-15/libexec/gcc/x86_64-pc-linux-gnu/15.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /root/gdbtest/gcc/obj/../gcc/configure
--prefix=/root/gdbtest/gcc/gcc-15 --enable-languages=c,c++,fortran,go
--disable-multilib
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 15.0.0 20240509 (experimental) (GCC) 
***
Program:
# interpret.ii

int a(void) {
  &
b:
  c;
  goto * 0
}

***
Command Lines:
# g++ interpret.ii -O3 -Wall -Wextra -std=c11 -pedantic
-fsanitize=undefined,address -fstack-protector-all -D_FORTIFY_SOURCE=2
-fno-strict-aliasing -Wshadow -Wstrict-aliasing=2 -fno-omit-frame-pointer
-freport-bug -c -o interpret.o
cc1plus: warning: command-line option ‘-std=c11’ is valid for C/ObjC but not
for C++
interpret.ii: In function ‘int a()’:
interpret.ii:2:5: warning: taking the address of a label is non-standard
[-Wpedantic]
2 |   &
  | ^
interpret.ii:2:3: warning: statement has no effect [-Wunused-value]
2 |   &
  |   ^~~
interpret.ii:4:3: error: ‘c’ was not declared in this scope
4 |   c;
  |   ^
interpret.ii:5:3: warning: ISO C++ forbids computed gotos [-Wpedantic]
5 |   goto * 0
  |   ^~~~
interpret.ii:5:10: internal compiler error: tree check: expected class ‘type’,
have ‘exceptional’ (error_mark) in check_goto_1, at cp/decl.cc:4004
5 |   goto * 0
  |  ^
0x99e778 tree_class_check_failed(tree_node const*, tree_code_class, char
const*, int, char const*)
/root/gdbtest/gcc/obj/../gcc/gcc/tree.cc:9045
0x7cab4f tree_class_check(tree_node*, tree_code_class, char const*, int, char
const*)
/root/gdbtest/gcc/obj/../gcc/gcc/tree.h:3779
0x7cab4f check_goto_1(named_label_entry*, bool)
/root/gdbtest/gcc/obj/../gcc/gcc/cp/decl.cc:4004
0xb72b89 check_goto(tree_node*)
/root/gdbtest/gcc/obj/../gcc/gcc/cp/decl.cc:4042
0xd04969 finish_goto_stmt(tree_node*)
/root/gdbtest/gcc/obj/../gcc/gcc/cp/semantics.cc:840
0xc85c05 cp_parser_jump_statement
/root/gdbtest/gcc/obj/../gcc/gcc/cp/parser.cc:14914
0xc85c05 cp_parser_statement
/root/gdbtest/gcc/obj/../gcc/gcc/cp/parser.cc:12743
0xc59807 cp_parser_statement_seq_opt
/root/gdbtest/gcc/obj/../gcc/gcc/cp/parser.cc:13427
0xc59a2f cp_parser_compound_statement
/root/gdbtest/gcc/obj/../gcc/gcc/cp/parser.cc:13281
0xc7ccd5 cp_parser_function_body
/root/gdbtest/gcc/obj/../gcc/gcc/cp/parser.cc:26072
0xc7ccd5 cp_parser_ctor_initializer_opt_and_function_body
/root/gdbtest/gcc/obj/../gcc/gcc/cp/parser.cc:26123
0xc8241e cp_parser_function_definition_after_declarator
/root/gdbtest/gcc/obj/../gcc/gcc/cp/parser.cc:32903
0xc835be cp_parser_function_definition_from_specifiers_and_declarator
/root/gdbtest/gcc/obj/../gcc/gcc/cp/parser.cc:32820
0xc835be cp_parser_init_declarator
/root/gdbtest/gcc/obj/../gcc/gcc/cp/parser.cc:23451
0xc5668f cp_parser_simple_declaration
/root/gdbtest/gcc/obj/../gcc/gcc/cp/parser.cc:15958
0xc8ffea cp_parser_declaration
/root/gdbtest/gcc/obj/../gcc/gcc/cp/parser.cc:15631
0xc90fea cp_parser_toplevel_declaration
/root/gdbtest/gcc/obj/../gcc/gcc/cp/parser.cc:15652
0xc90fea cp_parser_translation_unit
/root/gdbtest/gcc/obj/../gcc/gcc/cp/parser.cc:5284
0xc90fea c_parse_file()
/root/gdbtest/gcc/obj/../gcc/gcc/cp/parser.cc:51440
0xddf371 c_common_parse_file()
/root/gdbtest/gcc/obj/../gcc/gcc/c-family/c-opts.cc:1311
Please submit a full bug report, with preprocessed 

[Bug c++/115469] New: ICE :tree check expected class 'type', have 'exceptional' (error_mark) in poplevel_named_label_1, at cpdecl.cc579

2024-06-12 Thread iamanonymous.cs at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115469

Bug ID: 115469
   Summary: ICE :tree check expected class 'type', have
'exceptional' (error_mark) in poplevel_named_label_1,
at cpdecl.cc579
   Product: gcc
   Version: 15.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: iamanonymous.cs at gmail dot com
  Target Milestone: ---
Target: x86_64

***
I encountered an internal compiler error (ICE) while compiling the following
code snippet using GCC trunk with the provided compilation options.
The ICE occurred in poplevel_named_label_1 at cp/decl.cc:579. 
The issue can also be reproduced on Compiler Explorer.
Please let me know if you need any further information to resolve this issue.

***
OS and Platform:
# uname -a
Linux ubuntu 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023
x86_64 x86_64 x86_64 GNU/Linux
***
# g++ -v
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/root/gdbtest/gcc/gcc-15/libexec/gcc/x86_64-pc-linux-gnu/15.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /root/gdbtest/gcc/obj/../gcc/configure
--prefix=/root/gdbtest/gcc/gcc-15 --enable-languages=c,c++,fortran,go
--disable-multilib
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 15.0.0 20240509 (experimental) (GCC) 
***
Program:
# cat 1.ii

int fn1() { int **c; b = &   goto * 0}

***
Command Lines:
# g++ 1.ii -O3 -Wall -Wextra -std=c11 -pedantic -fsanitize=undefined
-fstack-protector-all -D_FORTIFY_SOURCE=2 -freport-bug -o -c 1.o
cc1plus: warning: command-line option ‘-std=c11’ is valid for C/ObjC but not
for C++
1.ii: In function ‘int fn1()’:
1.ii:1:22: error: ‘b’ was not declared in this scope
1 | int fn1() { int **c; b = &   goto * 0}
  |  ^
1.ii:1:28: warning: taking the address of a label is non-standard [-Wpedantic]
1 | int fn1() { int **c; b = &   goto * 0}
  |^
1.ii:1:33: warning: ISO C++ forbids computed gotos [-Wpedantic]
1 | int fn1() { int **c; b = &   goto * 0}
  | ^~~~
1.ii:1:41: error: expected ‘;’ before ‘}’ token
1 | int fn1() { int **c; b = &   goto * 0}
  | ^
  | ;
1.ii:1:41: internal compiler error: tree check: expected class ‘type’, have
‘exceptional’ (error_mark) in poplevel_named_label_1, at cp/decl.cc:579
0x99e778 tree_class_check_failed(tree_node const*, tree_code_class, char
const*, int, char const*)
/root/gdbtest/gcc/obj/../gcc/gcc/tree.cc:9045
0x7d7cca tree_class_check(tree_node*, tree_code_class, char const*, int, char
const*)
/root/gdbtest/gcc/obj/../gcc/gcc/tree.h:3779
0x7d7cca poplevel_named_label_1(named_label_entry**, cp_binding_level*)
/root/gdbtest/gcc/obj/../gcc/gcc/cp/decl.cc:579
0xb735f8 void hash_table::traverse_noresize(cp_binding_level*)
/root/gdbtest/gcc/obj/../gcc/gcc/cp/decl.cc:650
0xb735f8 void hash_table::traverse(cp_binding_level*)
/root/gdbtest/gcc/obj/../gcc/gcc/hash-table.h:1194
0xb735f8 poplevel(int, int, int)
/root/gdbtest/gcc/obj/../gcc/gcc/cp/decl.cc:650
0xd04842 do_poplevel(tree_node*)
/root/gdbtest/gcc/obj/../gcc/gcc/cp/semantics.cc:651
0xd07599 finish_compound_stmt(tree_node*)
/root/gdbtest/gcc/obj/../gcc/gcc/cp/semantics.cc:1996
0xc59a4c cp_parser_compound_statement
/root/gdbtest/gcc/obj/../gcc/gcc/cp/parser.cc:13287
0xc7ccd5 cp_parser_function_body
/root/gdbtest/gcc/obj/../gcc/gcc/cp/parser.cc:26072
0xc7ccd5 cp_parser_ctor_initializer_opt_and_function_body
/root/gdbtest/gcc/obj/../gcc/gcc/cp/parser.cc:26123
0xc8241e cp_parser_function_definition_after_declarator
/root/gdbtest/gcc/obj/../gcc/gcc/cp/parser.cc:32903
0xc835be cp_parser_function_definition_from_specifiers_and_declarator
/root/gdbtest/gcc/obj/../gcc/gcc/cp/parser.cc:32820
0xc835be cp_parser_init_declarator
/root/gdbtest/gcc/obj/../gcc/gcc/cp/parser.cc:23451
0xc5668f cp_parser_simple_declaration
/root/gdbtest/gcc/obj/../gcc/gcc/cp/parser.cc:15958
0xc8ffea cp_parser_declaration
/root/gdbtest/gcc/obj/../gcc/gcc/cp/parser.cc:15631
0xc90fea cp_parser_toplevel_declaration
/root/gdbtest/gcc/obj/../gcc/gcc/cp/parser.cc:15652
0xc90fea cp_parser_translation_unit
/root/gdbtest/gcc/obj/../gcc/gcc/cp/parser.cc:5284
0xc90fea c_parse_file()

[Bug tree-optimization/115455] New: ICE: verify_flow_info failed during GIMPLE pass: cfg

2024-06-11 Thread iamanonymous.cs at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115455

Bug ID: 115455
   Summary: ICE: verify_flow_info failed during GIMPLE pass: cfg
   Product: gcc
   Version: 15.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: iamanonymous.cs at gmail dot com
  Target Milestone: ---
Target: x86_64

***
The compiler produces an internal error during the cfg GIMPLE pass when
compiling the provided code. 
The issue can also be reproduced on Compiler Explorer.
***
OS and Platform:
# uname -a
Linux ubuntu 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023
x86_64 x86_64 x86_64 GNU/Linux
***
# gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/root/gdbtest/gcc/gcc-15/libexec/gcc/x86_64-pc-linux-gnu/15.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /root/gdbtest/gcc/obj/../gcc/configure
--prefix=/root/gdbtest/gcc/gcc-15 --enable-languages=c,c++,fortran,go
--disable-multilib
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 15.0.0 20240509 (experimental) (GCC) 
***
Program:
# cat bugfunc.c

void f(void)
{
  void p(void)
  {
  __label__ l1;
  void q(void)
  {
goto l1;
  }

  l1:;
  }
  p();
}
int
main (void)
{
  f();
  return 0;
}   


***
Command Lines:
# gcc bugfunc.c -std=c11 -fvisibility=hidden -fsanitize=address -fno-
omit-frame-pointer -fno-common -fstrict-aliasing -fstack-protector-strong
-fno-exceptions -fno-rtti -fpic -ffunction-sections -fdata-sections -Werror 
-Wall -Wextra  -Wno-unused-parameter -Wno-c++98-compat
-Wno-c++98-compat-pedantic -Wno-missing-noreturn -Wno-missing-prototypes
-Wno-missing-field-initializers -Wno-cast-align -Wno-nested-anon-types
-Wno-vla-extension -Wno-vla-extension -o bugfunc
cc1: error: command-line option ‘-fno-rtti’ is valid for C++/D/ObjC++ but not
for C [-Werror]
bugfunc.c: In function ‘p’:
bugfunc.c:3:8: error: label ‘({anonymous})’ has incorrect context in bb 4
3 |   void p(void)
  |^
during GIMPLE pass: cfg
bugfunc.c:3:8: internal compiler error: verify_flow_info failed
0xb633de verify_flow_info()
/root/gdbtest/gcc/obj/../gcc/gcc/cfghooks.cc:287
0x10fa16c checking_verify_flow_info()
/root/gdbtest/gcc/obj/../gcc/gcc/cfghooks.h:214
0x10fa16c cleanup_tree_cfg_noloop
/root/gdbtest/gcc/obj/../gcc/gcc/tree-cfgcleanup.cc:1154
0x10fa16c cleanup_tree_cfg(unsigned int)
/root/gdbtest/gcc/obj/../gcc/gcc/tree-cfgcleanup.cc:1205
0x10f1ba4 execute_build_cfg
/root/gdbtest/gcc/obj/../gcc/gcc/tree-cfg.cc:379
0x10f1ba4 execute
/root/gdbtest/gcc/obj/../gcc/gcc/tree-cfg.cc:413
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.

***
Also ICE on trunk, compiler explorer:https://godbolt.org/z/KsWE7h7zE
***

[Bug c++/115431] New: ICE: tree check: expected tree that contains ‘decl common’ structure, have ‘error_mark’ in decl_template_parm_check, at cp/cp-tree.h:5131

2024-06-11 Thread iamanonymous.cs at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115431

Bug ID: 115431
   Summary: ICE: tree check: expected tree that contains ‘decl
common’ structure, have ‘error_mark’ in
decl_template_parm_check, at cp/cp-tree.h:5131
   Product: gcc
   Version: 15.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: iamanonymous.cs at gmail dot com
  Target Milestone: ---
Target: x86_64

***
Internal Compiler Error (ICE) when compiling a specific C++ code with GCC.
The error message specifically indicates an issue in decl_template_parm_check
at cp/cp-tree.h:5131.
***
OS and Platform:
# uname -a
Linux ubuntu 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023
x86_64 x86_64 x86_64 GNU/Linux
***
#g++ -v
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/root/gdbtest/gcc/gcc-15/libexec/gcc/x86_64-pc-linux-gnu/15.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /root/gdbtest/gcc/obj/../gcc/configure
--prefix=/root/gdbtest/gcc/gcc-15 --enable-languages=c,c++,fortran,go
--disable-multilib
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 15.0.0 20240509 (experimental) (GCC) 
***
Program:
# cat constrained.ii

template  struct c {c( b)
} template  struct d : c {
  c::c;
} template  d(b)->d;
d a = [] < e f


***
Command Lines:
# g++  -Wall -Wextra -pedantic -Werror -O2 -g -fsanitize=address,undefined
-fno-omit-frame-pointer  -o bug.out constrained.ii
constrained.ii:1:45: error: expected ‘;’ at end of member declaration
1 | template  struct c {c( b)
  | ^
  |  ;
constrained.ii:2:2: error: expected ‘;’ after struct definition
2 | } template  struct d : c {
  |  ^
  |  ;
constrained.ii:3:3: error: access declarations are deprecated in favor of
using-declarations; suggestion: add the ‘using’ keyword [-Werror=deprecated]
3 |   c::c;
  |   ^~~~
constrained.ii:4:2: error: expected ‘;’ after struct definition
4 | } template  d(b)->d;
  |  ^
  |  ;
constrained.ii:5:10: error: lambda templates are only available with
‘-std=c++20’ or ‘-std=gnu++20’ [-Werror=c++20-extensions]
5 | d a = [] < e f
  |  ^
constrained.ii:5:12: error: ‘e’ has not been declared
5 | d a = [] < e f
  |^
constrained.ii:5:15: error: expected ‘>’ at end of input
5 | d a = [] < e f
  |   ^
constrained.ii: In lambda function:
constrained.ii:5:15: error: expected ‘{’ at end of input
constrained.ii: At global scope:
constrained.ii:3:9: internal compiler error: tree check: expected tree that
contains ‘decl common’ structure, have ‘error_mark’ in
decl_template_parm_check, at cp/cp-tree.h:5131
3 |   c::c;
  | ^
0x99ed98 tree_contains_struct_check_failed(tree_node const*,
tree_node_structure_enum, char const*, int, char const*)
/root/gdbtest/gcc/obj/../gcc/gcc/tree.cc:9169
0x7f386f contains_struct_check(tree_node const*, tree_node_structure_enum, char
const*, int, char const*)
/root/gdbtest/gcc/obj/../gcc/gcc/tree.h:4058
0x7f386f decl_template_parm_check(tree_node const*, char const*, int, char
const*)
/root/gdbtest/gcc/obj/../gcc/gcc/cp/cp-tree.h:5131
0x7f386f write_closure_template_head
/root/gdbtest/gcc/obj/../gcc/gcc/cp/mangle.cc:1964
0x7f386f write_closure_type_name
/root/gdbtest/gcc/obj/../gcc/gcc/cp/mangle.cc:1993
0x7f386f write_unqualified_name
/root/gdbtest/gcc/obj/../gcc/gcc/cp/mangle.cc:1591
0xbc78df write_nested_name
/root/gdbtest/gcc/obj/../gcc/gcc/cp/mangle.cc:1280
0xbc7e12 write_class_enum_type
/root/gdbtest/gcc/obj/../gcc/gcc/cp/mangle.cc:3096
0xbc7e12 write_type
/root/gdbtest/gcc/obj/../gcc/gcc/cp/mangle.cc:2515
0xbc715b write_template_args
/root/gdbtest/gcc/obj/../gcc/gcc/cp/mangle.cc:3228
0xbc756f write_prefix
/root/gdbtest/gcc/obj/../gcc/gcc/cp/mangle.cc:1342
0xbc756f write_prefix
/root/gdbtest/gcc/obj/../gcc/gcc/cp/mangle.cc:1293
0xbc78d7 write_nested_name
/root/gdbtest/gcc/obj/../gcc/gcc/cp/mangle.cc:1279
0xbc5276 write_encoding
/root/gdbtest/gcc/obj/../gcc/gcc/cp/mangle.cc:938
0xbc541b write_mangled_name
/root/gdbtest/gcc/obj/../gcc/gcc/cp/mangle.cc:820
0xbcb4e0 mangle_decl_string
/root/gdbtest/gcc/obj/../gcc/gcc/cp/mangle.cc:4420
0xbcb6ca get_mangled_id

[Bug c/115426] New: ICE in execute_todo, at passes.cc:2138

2024-06-10 Thread iamanonymous.cs at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115426

Bug ID: 115426
   Summary: ICE in execute_todo, at passes.cc:2138
   Product: gcc
   Version: 15.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: iamanonymous.cs at gmail dot com
  Target Milestone: ---
Target: x86_64

***
The compiler produces an internal error when compiling the provided code with
the specified options. 
The issue occurs during the GIMPLE pass (walloca), causing an internal compiler
error in the execute_todo function at passes.cc:2138.
***
OS and Platform:
# uname -a
Linux ubuntu 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023
x86_64 x86_64 x86_64 GNU/Linux
***
# gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/root/gdbtest/gcc/gcc-15/libexec/gcc/x86_64-pc-linux-gnu/15.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /root/gdbtest/gcc/obj/../gcc/configure
--prefix=/root/gdbtest/gcc/gcc-15 --enable-languages=c,c++,fortran,go
--disable-multilib
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 15.0.0 20240509 (experimental) (GCC) 
***
Program:
# cat fam-asm.c

 #include 
 #include  

 _Complex float fcs(_Complex float x) {
  float ixy;
  float diff, sum;
  _Complex float r;
  __asm__("fmul %s[ixy], %s[xr], %s[yr]\n"
  "\tfsub %s[diff], %s[xr], %s[yr]\n"
  "\tfadd %s[sum],  %s[xr], %s[yr]\n"
  "\tfmul %s[rr],  %s[diff], %s[sum]\n"
  "\tfadd %s[ri],  %s[ixy], %s[ixy]\n"
  : [ixy] "=" (ixy), [diff] "=" (diff), [sum] "=w" (sum), [rr] "=w"
(__real__ r), [ri] "=w" (__imag__ r)
  : [xr] "w" (__real__ x), [yr] "w"( __imag__ x)
  : );
  return r;
 }

 int main(int argc, char *argv[])
 {
  _Complex float i = 0.0f + I * 1.0f;
  _Complex float i2 = fcs(i);
  printf("%f+i%f\n", __real__ i2, __imag__ i2);
 }


***
Command Lines:
# gcc fam-asm.c -Wall -Wextra  -o fam-asm.out
fam-asm.c: In function ‘main’:
fam-asm.c:19:15: warning: unused parameter ‘argc’ [-Wunused-parameter]
   19 |  int main(int argc, char *argv[])
  |   ^~~~
fam-asm.c:19:27: warning: unused parameter ‘argv’ [-Wunused-parameter]
   19 |  int main(int argc, char *argv[])
  | ~~^~
during GIMPLE pass: walloca
fam-asm.c: In function ‘fcs’:
fam-asm.c:24:2: internal compiler error: in execute_todo, at passes.cc:2138
   24 |  }
  |  ^
0x839f1b execute_todo
/root/gdbtest/gcc/obj/../gcc/gcc/passes.cc:2138
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.

***

Also ICE on trunk, compiler explorer:https://godbolt.org/z/soaoeW5z7

***

[Bug c++/115412] New: ICE: canonical types differ for identical types ‘stdis_sametypename fooTtype, U’ and ‘stdis_sameT, U’

2024-06-10 Thread iamanonymous.cs at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115412

Bug ID: 115412
   Summary: ICE: canonical types differ for identical types
‘stdis_sametypename fooTtype, U’ and ‘stdis_sameT, U’
   Product: gcc
   Version: 15.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: iamanonymous.cs at gmail dot com
  Target Milestone: ---

***
The compiler produces an internal error when compiling the provided code with
the specified options. 
The issue involves canonical types differing for identical types during
template instantiation.
***
OS and Platform:
# uname -a
Linux ubuntu 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023
x86_64 x86_64 x86_64 GNU/Linux
***
# g++ -v
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/root/gdbtest/gcc/gcc-15/libexec/gcc/x86_64-pc-linux-gnu/15.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /root/gdbtest/gcc/obj/../gcc/configure
--prefix=/root/gdbtest/gcc/gcc-15 --enable-languages=c,c++,fortran,go
--disable-multilib
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 15.0.0 20240509 (experimental) (GCC) 
***
Program:
# cat main.cpp

 #include 

 template
 struct foo {
 using type = T;

 template<
 typename U
 , typename std::enable_if<
 std::is_same::value
 , int
 >::type = 0
 >
 void bar(U&&);
 };

 template
 template<
 typename U
 , typename std::enable_if<
 std::is_same::type, U>::value
 , int
 >::type
 >
 void foo::bar(U&&) {}

 int
 main()
 {}



***
Command Lines:
# g++ main.cpp -O1 -c -o main.out

main.cpp:25:22: internal compiler error: canonical types differ for identical
types ‘std::is_same::type, U>’ and ‘std::is_same’
   25 |  void foo::bar(U&&) {}
  |  ^
0xd499c9 comptypes(tree_node*, tree_node*, int)
/root/gdbtest/gcc/obj/../gcc/gcc/cp/typeck.cc:1710
0xd3cf8b cp_tree_equal(tree_node*, tree_node*)
/root/gdbtest/gcc/obj/../gcc/gcc/cp/tree.cc:4309
0xc9c3da template_args_equal(tree_node*, tree_node*)
/root/gdbtest/gcc/obj/../gcc/gcc/cp/pt.cc:9473
0xc9c105 template_args_equal(tree_node*, tree_node*)
/root/gdbtest/gcc/obj/../gcc/gcc/cp/pt.cc:9418
0xc9c105 comp_template_args(tree_node*, tree_node*, tree_node**, tree_node**)
/root/gdbtest/gcc/obj/../gcc/gcc/cp/pt.cc:9499
0xd49826 structural_comptypes
/root/gdbtest/gcc/obj/../gcc/gcc/cp/typeck.cc:1522
0xd4993d comptypes(tree_node*, tree_node*, int)
/root/gdbtest/gcc/obj/../gcc/gcc/cp/typeck.cc:1703
0xd49748 structural_comptypes
/root/gdbtest/gcc/obj/../gcc/gcc/cp/typeck.cc:1590
0xc99b2f comp_template_parms(tree_node const*, tree_node const*)
/root/gdbtest/gcc/obj/../gcc/gcc/cp/pt.cc:3349
0xb8361a check_classfn(tree_node*, tree_node*, tree_node*)
/root/gdbtest/gcc/obj/../gcc/gcc/cp/decl2.cc:878
0xb627e3 grokfndecl
/root/gdbtest/gcc/obj/../gcc/gcc/cp/decl.cc:11045
0xb69a7b grokdeclarator(cp_declarator const*, cp_decl_specifier_seq*,
decl_context, int, tree_node**)
/root/gdbtest/gcc/obj/../gcc/gcc/cp/decl.cc:15114
0xb6d066 start_function(cp_decl_specifier_seq*, cp_declarator const*,
tree_node*)
/root/gdbtest/gcc/obj/../gcc/gcc/cp/decl.cc:18212
0xc83107 cp_parser_function_definition_from_specifiers_and_declarator
/root/gdbtest/gcc/obj/../gcc/gcc/cp/parser.cc:32780
0xc83107 cp_parser_init_declarator
/root/gdbtest/gcc/obj/../gcc/gcc/cp/parser.cc:23451
0xc8ae60 cp_parser_single_declaration
/root/gdbtest/gcc/obj/../gcc/gcc/cp/parser.cc:33420
0xc8b01c cp_parser_template_declaration_after_parameters
/root/gdbtest/gcc/obj/../gcc/gcc/cp/parser.cc:32973
0xc8b900 cp_parser_explicit_template_declaration
/root/gdbtest/gcc/obj/../gcc/gcc/cp/parser.cc:33246
0xc8b2e5 cp_parser_template_declaration_after_export
/root/gdbtest/gcc/obj/../gcc/gcc/cp/parser.cc:33265
0xc8b2e5 cp_parser_template_declaration_after_parameters
/root/gdbtest/gcc/obj/../gcc/gcc/cp/parser.cc:32959
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.

***
Also ICE on trunk, compiler explorer: https://godbolt.org/z/nzKP3Eovr


[Bug c/115411] New: ICE : in expand_call, at calls.cc:3668

2024-06-10 Thread iamanonymous.cs at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115411

Bug ID: 115411
   Summary: ICE : in expand_call, at calls.cc:3668
   Product: gcc
   Version: 15.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: iamanonymous.cs at gmail dot com
  Target Milestone: ---

***
The compiler produces an internal error during the expand RTL pass when
compiling the provided code with the specified options. 
This problem occurs on both gcc and g++.
The issue can also be reproduced on Compiler Explorer.

***
OS and Platform:
# uname -a
Linux ubuntu 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023
x86_64 x86_64 x86_64 GNU/Linux
***
# gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/root/gdbtest/gcc/gcc-15/libexec/gcc/x86_64-pc-linux-gnu/15.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /root/gdbtest/gcc/obj/../gcc/configure
--prefix=/root/gdbtest/gcc/gcc-15 --enable-languages=c,c++,fortran,go
--disable-multilib
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 15.0.0 20240509 (experimental) (GCC) 

# g++ -v
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/root/gdbtest/gcc/gcc-15/libexec/gcc/x86_64-pc-linux-gnu/15.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /root/gdbtest/gcc/obj/../gcc/configure
--prefix=/root/gdbtest/gcc/gcc-15 --enable-languages=c,c++,fortran,go
--disable-multilib
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 15.0.0 20240509 (experimental) (GCC) 
***
Program:
# z2.cc

typedef struct { char c[0x4001]; } s;
void f (s);
int g (s *x)
{
  f (*x);
}

***
Command Lines:
For g++:
# g++ z2.cc  -Werror -O2 -ftrapv -fstack-protector-strong -o z2.out
/root/gdbtest/gcctest/gcc_llvm/gcc/z2.cc: In function ‘int g(s*)’:
/root/gdbtest/gcctest/gcc_llvm/gcc/z2.cc:6:1: error: no return statement in
function returning non-void [-Werror=return-type]
6 | }
  | ^
/root/gdbtest/gcctest/gcc_llvm/gcc/z2.cc:5:5: sorry, unimplemented: passing too
large argument on stack
5 |   f (*x);
  |   ~~^~~~
during RTL pass: expand
/root/gdbtest/gcctest/gcc_llvm/gcc/z2.cc:5:5: internal compiler error: in
expand_call, at calls.cc:3668
0x894771 expand_call(tree_node*, rtx_def*, int)
/root/gdbtest/gcc/obj/../gcc/gcc/calls.cc:3668
0xf8fe8e expand_expr_real_1(tree_node*, rtx_def*, machine_mode,
expand_modifier, rtx_def**, bool)
/root/gdbtest/gcc/obj/../gcc/gcc/expr.cc:12364
0xe65f8d expand_expr(tree_node*, rtx_def*, machine_mode, expand_modifier)
/root/gdbtest/gcc/obj/../gcc/gcc/expr.h:316
0xe65f8d expand_call_stmt
/root/gdbtest/gcc/obj/../gcc/gcc/cfgexpand.cc:2884
0xe65f8d expand_gimple_stmt_1
/root/gdbtest/gcc/obj/../gcc/gcc/cfgexpand.cc:3951
0xe65f8d expand_gimple_stmt
/root/gdbtest/gcc/obj/../gcc/gcc/cfgexpand.cc:4093
0xe66a47 expand_gimple_basic_block
/root/gdbtest/gcc/obj/../gcc/gcc/cfgexpand.cc:6149
0xe686c6 execute
/root/gdbtest/gcc/obj/../gcc/gcc/cfgexpand.cc:6888
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.

For gcc:
# gcc z2.cc  -Werror -O2 -ftrapv -fstack-protector-strong -o z2.out
z2.cc: In function ‘int g(s*)’:
z2.cc:6:1: error: no return statement in function returning non-void
[-Werror=return-type]
6 | }
  | ^
z2.cc:5:5: sorry, unimplemented: passing too large argument on stack
5 |   f (*x);
  |   ~~^~~~
during RTL pass: expand
z2.cc:5:5: internal compiler error: in expand_call, at calls.cc:3668
0x894771 expand_call(tree_node*, rtx_def*, int)
/root/gdbtest/gcc/obj/../gcc/gcc/calls.cc:3668
0xf8fe8e expand_expr_real_1(tree_node*, rtx_def*, machine_mode,
expand_modifier, rtx_def**, bool)
/root/gdbtest/gcc/obj/../gcc/gcc/expr.cc:12364
0xe65f8d expand_expr(tree_node*, rtx_def*, machine_mode, expand_modifier)
/root/gdbtest/gcc/obj/../gcc/gcc/expr.h:316
0xe65f8d expand_call_stmt
/root/gdbtest/gcc/obj/../gcc/gcc/cfgexpand.cc:2884
0xe65f8d expand_gimple_stmt_1
/root/gdbtest/gcc/obj/../gcc/gcc/cfgexpand.cc:3951
0xe65f8d expand_gimple_stmt
/root/gdbtest/gcc/obj/../gcc/gcc/cfgexpand.cc:4093
0xe66a47 expand_gimple_basic_block
/root/gdbtest/gcc/obj/../gcc/gcc/cfgexpand.cc:6149
0xe686c6 execute
/root/gdbtest/gcc/obj/../gcc/gcc/cfgexpand.cc:6888
Please submit a full bug report, with 

[Bug c++/115173] New: GCC hang and memory exhaustion issue with complex nested initializer lists in C++ std::string construction

2024-05-21 Thread iamanonymous.cs at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115173

Bug ID: 115173
   Summary: GCC hang and memory exhaustion issue with complex
nested initializer lists in C++ std::string
construction
   Product: gcc
   Version: 13.1.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: iamanonymous.cs at gmail dot com
  Target Milestone: ---

The following code snippet triggers a hang issue:

$ cat bug.cpp

#include 

struct string { string(std::initializer_list) { } };

void f() {
  string({});
}
void g() {
  string(string({}); 
}
void h() {
  string(string({}));
}
void i() {
  string(string(string({}));
}
void j() {
 
string(string(string(string(string(string(string(string(string(string(string(string(string(string(string(string(string(string(string(string(string(string(string(string(string(string(string(string(string(string(string(string(string(string(string(string(string(string(string(string(string(string(string(string(string(string(string(string(string(string(string(>)
{ } };

void f() {
  auto y =
  {
string(Equation()) 
  }; 
}

I observed that when attempting to compile this code using GCC, the compilation
process hangs indefinitely. Additionally, the RAM usage continuously increases,
leading to excessive consumption of system resources.

However, it is worth noting that when using LLVM as the compiler, the code
compiles quickly and produces the expected compilation output.

We have found that this issue still persists in the latest version of GCC(see
https://godbolt.org/z/oKKe5WK9v)

The command we used is(no error output):

g++ bug.cpp



The GCC version:

$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-linux-gnu/13/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu
13.1.0-8ubuntu1~20.04.2' --with-bugurl=file:///usr/share/doc/gcc-13/README.Bugs
--enable-languages=c,ada,c++,go,d,fortran,objc,obj-c++,m2,rust --prefix=/usr
--with-gcc-major-version-only --program-suffix=-13
--program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id
--libexecdir=/usr/libexec --without-included-gettext --enable-threads=posix
--libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug
--enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new
--enable-gnu-unique-object --disable-vtable-verify --enable-plugin
--enable-default-pie --with-system-zlib --enable-libphobos-checking=release
--with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch
--disable-werror --enable-cet --with-arch-32=i686 --with-abi=m64
--with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic
--enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu
--target=x86_64-linux-gnu
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 13.1.0 (Ubuntu 13.1.0-8ubuntu1~20.04.2) 


[Bug sanitizer/114956] New: Segmentation fault with -fsanitize=address -fsanitize=null -O2 when attribute no_sanitize_address is enabled

2024-05-05 Thread iamanonymous.cs at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114956

Bug ID: 114956
   Summary: Segmentation fault with -fsanitize=address
-fsanitize=null -O2 when attribute no_sanitize_address
is enabled
   Product: gcc
   Version: 15.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: sanitizer
  Assignee: unassigned at gcc dot gnu.org
  Reporter: iamanonymous.cs at gmail dot com
CC: dodji at gcc dot gnu.org, dvyukov at gcc dot gnu.org,
jakub at gcc dot gnu.org, kcc at gcc dot gnu.org
  Target Milestone: ---

Compiler Explorer: https://godbolt.org/z/33rbWdf49

***
gcc version:
$ gcc -v
Using built-in specs.
COLLECT_GCC=/home/gcc_set/gcc-trunk/bin/gcc
COLLECT_LTO_WRAPPER=/home/gcc_set/gcc-trunk/libexec/gcc/aarch64-unknown-linux-gnu/15.0.0/lto-wrapper
Target: aarch64-unknown-linux-gnu
Configured with: ../gcc/configure --prefix=/home/gcc_set/gcc-trunk
--with-gmp=/home/build_essential --with-mpfr=/home/build_essential
--with-mpc=/home/build_essential --enable-languages=c,c++ --disable-multilib
--with-sanitizer=address,undefined,thread,leakcd CC=gcc CXX=g++
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 15.0.0 20240430 (experimental) (GCC)

git version: 22b20ac6c6aead2d3f36c413a77dd0b80adfec39
***
Program:
$ cat mutant.c
int **a;
__attribute__((always_inline)) int *c() {
  int b[1];
  b;
}
__attribute__((no_sanitize_address)) static char d() { *a = c(); }
void e() { d(); }

***
Command Lines:
$ gcc -fsanitize=address -fsanitize=null -O2 -c mutant.c
mutant.c:2:37: warning: 'always_inline' function might not be inlinable unless
also declared 'inline' [-Wattributes]
2 | __attribute__((always_inline)) int *c() {
  | ^
during GIMPLE pass: sanopt
mutant.c: In function 'd.isra':
mutant.c:6:50: internal compiler error: Segmentation fault
6 | __attribute__((no_sanitize_address)) static char d() { *a = c(); }
  |  ^
0xf2d49b crash_signal
../../gcc/gcc/toplev.cc:319
0xf3fcfc contains_struct_check(tree_node*, tree_node_structure_enum, char
const*, int, char const*)
../../gcc/gcc/tree.h:3769
0xf3fcfc build_shadow_mem_access
../../gcc/gcc/asan.cc:2552
0xf4b90f asan_expand_mark_ifn(gimple_stmt_iterator*)
../../gcc/gcc/asan.cc:3854
0xf5f6bf execute
../../gcc/gcc/sanopt.cc:1379
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See  for instructions

[Bug analyzer/114899] New: Segmentation fault with -fsanitize=undefined and -fanalyzer since r14-2029-g0e466e978c7

2024-04-30 Thread iamanonymous.cs at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114899

Bug ID: 114899
   Summary: Segmentation fault with -fsanitize=undefined and
-fanalyzer since r14-2029-g0e466e978c7
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: analyzer
  Assignee: dmalcolm at gcc dot gnu.org
  Reporter: iamanonymous.cs at gmail dot com
  Target Milestone: ---

Compiler Explorer: https://godbolt.org/z/v8c4csjTE

Bisected to r14-2029-g0e466e978c7

***
OS and Platform:
$ uname -a:
Linux ubuntu 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023
x86_64 x86_64 x86_64 GNU/Linux
***
gcc version:
$ gcc -v
Using built-in specs.
COLLECT_GCC=/root/gcc_set/202404101100/bin/gcc
COLLECT_LTO_WRAPPER=/root/gcc_set/202404101100/libexec/gcc/x86_64-pc-linux-gnu/14.0.1/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/root/gcc_set/202404101100
--with-gmp=/root/build_essential --with-mpfr=/root/build_essential
--with-mpc=/root/build_essential --enable-languages=c,c++ --disable-multilib
--with-sanitizer=address,undefined,thread,leak
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 14.0.1 20240410 (experimental) (GCC) 

git version: 0774240b4df9a9bc48ce33a9625788e402498f5a
***
Program:
$ cat mutant.c
void a() {
  int *b = __builtin_malloc(0);
  int *c = b - 1;
  ++*c;
}

***
Command Lines:
$ gcc -fsanitize=undefined -fanalyzer -c mutant.c
mutant.c: In function ‘a’:
mutant.c:3:3: warning: heap-based buffer underwrite [CWE-124]
[-Wanalyzer-out-of-bounds]
3 |   ++*c;
  |   ^~~~
  ‘a’: events 1-2
|
|2 |   int *b = __builtin_malloc(0), *c = b - 1;
|  |^~~
|  ||
|  |(1) capacity: 0 bytes
|3 |   ++*c;
|  |     
|  |   |
|  |   (2) out-of-bounds write from byte -4 till byte -1 but region
starts at byte 0
|
during IPA pass: analyzer
mutant.c:3:3: internal compiler error: Segmentation fault
3 |   ++*c;
  |   ^~~~
0x1043a4f crash_signal
../../gcc/gcc/toplev.cc:319
0x216f0e6
ana::written_svalue_spatial_item::get_label_string(text_art::style_manager&)
const
../../gcc/gcc/analyzer/access-diagram.cc:1632
0x216f290 ana::written_svalue_spatial_item::make_table(ana::bit_to_table_map
const&, text_art::style_manager&) const
../../gcc/gcc/analyzer/access-diagram.cc:1620
0x2170348 ana::access_diagram_impl::access_diagram_impl(ana::access_operation
const&, diagnostic_event_id_t, text_art::style_manager&, text_art::theme
const&, ana::logger*)
../../gcc/gcc/analyzer/access-diagram.cc:2131
0x2165157 std::enable_if::value,
std::unique_ptr > >::type
make_unique(ana::access_operation const&, diagnostic_event_id_t&,
text_art::style_manager&, text_art::theme const&, ana::logger*&)
../../gcc/gcc/make-unique.h:41
0x2165157 ana::access_diagram::access_diagram(ana::access_operation const&,
diagnostic_event_id_t, text_art::style_manager&, text_art::theme const&,
ana::logger*)
../../gcc/gcc/analyzer/access-diagram.cc:2679
0x2176727 ana::out_of_bounds::make_access_diagram(ana::access_operation const&,
text_art::style_manager&, text_art::theme const&, ana::logger*) const
../../gcc/gcc/analyzer/bounds-checking.cc:208
0x2176727 ana::out_of_bounds::maybe_show_diagram(ana::logger*) const
../../gcc/gcc/analyzer/bounds-checking.cc:187
0x2176c51
ana::concrete_buffer_underwrite::emit(ana::diagnostic_emission_context&)
../../gcc/gcc/analyzer/bounds-checking.cc:694
0x219c5c1 ana::diagnostic_manager::emit_saved_diagnostic(ana::exploded_graph
const&, ana::saved_diagnostic&)
../../gcc/gcc/analyzer/diagnostic-manager.cc:1617
0x21a02ed ana::dedupe_winners::emit_best(ana::diagnostic_manager*,
ana::exploded_graph const&)
../../gcc/gcc/analyzer/diagnostic-manager.cc:1472
0x219cb35 ana::diagnostic_manager::emit_saved_diagnostics(ana::exploded_graph
const&)
../../gcc/gcc/analyzer/diagnostic-manager.cc:1524
0x1453c7b ana::impl_run_checkers(ana::logger*)
../../gcc/gcc/analyzer/engine.cc:6227
0x1454bb6 ana::run_checkers()
../../gcc/gcc/analyzer/engine.cc:6308
0x1443a98 execute
../../gcc/gcc/analyzer/analyzer-pass.cc:87
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See  for instructions.

[Bug analyzer/114897] ICE in get_or_create_widening_svalue, at analyzer/region-model-manager.cc:1336 since r13-3077-gbfca9505f6f

2024-04-30 Thread iamanonymous.cs at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114897

--- Comment #1 from Anonymous  ---
There is another case that triggers the ICE in replay_call_summary_cluster, at
analyzer/store.cc:3374

Also bisected to r13-3077-gbfca9505f6f

Compiler Explorer: https://godbolt.org/z/Wh5MGf739

Program:
$ cat mutant.c
__attribute__((__vector_size__(sizeof(float float a;
int b;
void c();
void d() {
  for (; b;)
if (a[b])
  c();
}
void e() {
  d();
  d();
}

***
Command Lines:
$ gcc -fsanitize=undefined -fanalyzer -fanalyzer-call-summaries -c mutant.c
during IPA pass: analyzer
mutant.c: In function ‘e’:
mutant.c:10:3: internal compiler error: in replay_call_summary_cluster, at
analyzer/store.cc:3374
   10 |   d();
  |   ^~~
0x8921e5 ana::store::replay_call_summary_cluster(ana::call_summary_replay&,
ana::store const&, ana::region const*)
../../gcc/gcc/analyzer/store.cc:3374
0x14e1864 ana::store::replay_call_summary(ana::call_summary_replay&, ana::store
const&)
../../gcc/gcc/analyzer/store.cc:3318
0x149174b ana::region_model::replay_call_summary(ana::call_summary_replay&,
ana::region_model const&)
../../gcc/gcc/analyzer/region-model.cc:5635
0x14723eb ana::program_state::replay_call_summary(ana::call_summary_replay&,
ana::program_state const&)
../../gcc/gcc/analyzer/program-state.cc:1635
0x1458743 ana::call_summary_edge_info::update_state(ana::program_state*,
ana::exploded_edge const*, ana::region_model_context*) const
../../gcc/gcc/analyzer/engine.cc:1633
0x1450d9a ana::exploded_graph::process_node(ana::exploded_node*)
../../gcc/gcc/analyzer/engine.cc:4241
0x145166a ana::exploded_graph::process_worklist()
../../gcc/gcc/analyzer/engine.cc:3516
0x1453c4b ana::impl_run_checkers(ana::logger*)
../../gcc/gcc/analyzer/engine.cc:6210
0x1454bb6 ana::run_checkers()
../../gcc/gcc/analyzer/engine.cc:6308
0x1443a98 execute
../../gcc/gcc/analyzer/analyzer-pass.cc:87
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See  for instructions.

[Bug analyzer/114897] New: ICE in get_or_create_widening_svalue, at analyzer/region-model-manager.cc:1336 since r13-3077-gbfca9505f6f

2024-04-30 Thread iamanonymous.cs at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114897

Bug ID: 114897
   Summary: ICE in get_or_create_widening_svalue, at
analyzer/region-model-manager.cc:1336 since
r13-3077-gbfca9505f6f
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: analyzer
  Assignee: dmalcolm at gcc dot gnu.org
  Reporter: iamanonymous.cs at gmail dot com
  Target Milestone: ---

Compiler Explorer: https://godbolt.org/z/WMK1K7cMs

Bisected to r13-3077-gbfca9505f6f

***
OS and Platform:
$ uname -a:
Linux ubuntu 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023
x86_64 x86_64 x86_64 GNU/Linux
***
gcc version:
$ gcc -v
Using built-in specs.
COLLECT_GCC=/root/gcc_set/202404101100/bin/gcc
COLLECT_LTO_WRAPPER=/root/gcc_set/202404101100/libexec/gcc/x86_64-pc-linux-gnu/14.0.1/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/root/gcc_set/202404101100
--with-gmp=/root/build_essential --with-mpfr=/root/build_essential
--with-mpc=/root/build_essential --enable-languages=c,c++ --disable-multilib
--with-sanitizer=address,undefined,thread,leak
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 14.0.1 20240410 (experimental) (GCC) 

git version: 0774240b4df9a9bc48ce33a9625788e402498f5a
***
Program:
$ cat mutant.c
int a, b;
char *c;
char *e(char *f) {
  while (a) {
unsigned d = *f++;
  }
  return b ? f : 0;
}
void g() {
  c = e(c);
  e(c);
}

***
Command Lines:
$ gcc -fanalyzer -fanalyzer-call-summaries -c mutant.c
during IPA pass: analyzer
mutant.c: In function ‘g’:
mutant.c:11:3: internal compiler error: in get_or_create_widening_svalue, at
analyzer/region-model-manager.cc:1336
   11 |   e(c);
  |   ^~~~
0x88f731 ana::region_model_manager::get_or_create_widening_svalue(tree_node*,
ana::function_point const&, ana::svalue const*, ana::svalue const*)
../../gcc/gcc/analyzer/region-model-manager.cc:1336
0x217b2aa ana::call_summary_replay::convert_svalue_from_summary(ana::svalue
const*)
../../gcc/gcc/analyzer/call-summary.cc:236
0x219584b ana::replay_fact_visitor::on_fact(ana::svalue const*, tree_code,
ana::svalue const*)
../../gcc/gcc/analyzer/constraint-manager.cc:3273
0x2189728 ana::constraint_manager::for_each_fact(ana::fact_visitor*) const
../../gcc/gcc/analyzer/constraint-manager.cc:3240
0x2189958
ana::constraint_manager::replay_call_summary(ana::call_summary_replay&,
ana::constraint_manager const&)
../../gcc/gcc/analyzer/constraint-manager.cc:3307
0x1491770 ana::region_model::replay_call_summary(ana::call_summary_replay&,
ana::region_model const&)
../../gcc/gcc/analyzer/region-model.cc:5640
0x14723eb ana::program_state::replay_call_summary(ana::call_summary_replay&,
ana::program_state const&)
../../gcc/gcc/analyzer/program-state.cc:1635
0x1458743 ana::call_summary_edge_info::update_state(ana::program_state*,
ana::exploded_edge const*, ana::region_model_context*) const
../../gcc/gcc/analyzer/engine.cc:1633
0x1450d9a ana::exploded_graph::process_node(ana::exploded_node*)
../../gcc/gcc/analyzer/engine.cc:4241
0x145166a ana::exploded_graph::process_worklist()
../../gcc/gcc/analyzer/engine.cc:3516
0x1453c4b ana::impl_run_checkers(ana::logger*)
../../gcc/gcc/analyzer/engine.cc:6210
0x1454bb6 ana::run_checkers()
../../gcc/gcc/analyzer/engine.cc:6308
0x1443a98 execute
../../gcc/gcc/analyzer/analyzer-pass.cc:87
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See  for instructions.

[Bug c++/114858] New: Compilation Hang and Excessive RAM Consumption in GCC

2024-04-25 Thread iamanonymous.cs at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114858

Bug ID: 114858
   Summary: Compilation Hang and Excessive RAM Consumption in GCC
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: iamanonymous.cs at gmail dot com
  Target Milestone: ---

The following code snippet triggers a hang issue:

$ cat bug.cpp

template  void g(F);
template 
auto h(A &&... a) -> decltype(g(0,
(g)(a)...))
{
  h([] {});
}

int main() { 
  h(); 
  return 0; 
}

I observed that when attempting to compile this code using GCC, the compilation
process hangs indefinitely, without providing any output or indicating
successful compilation. Additionally, the RAM usage continuously increases,
leading to excessive consumption of system resources.

However, it is worth noting that when using LLVM as the compiler, the code
compiles quickly and produces the expected compilation output.

We have found that this issue still persists in the latest version of GCC(see
https://godbolt.org/z/P1c7f664f)

The command we used is(no error output):

g++ bug.cpp



The GCC version:

$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/home/cTest/gcc/myinstall/libexec/gcc/x86_64-linux-gnu/14.0.1/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../configure -v --build=x86_64-linux-gnu
--host=x86_64-linux-gnu --target=x86_64-linux-gnu --enable-checking=no
--enable-languages=c,c++ --disable-multilib --prefix=/home/cTest/gcc/myinstall
--disable-bootstrap
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 14.0.1 20240329 (experimental) (GCC) 


[Bug analyzer/114778] ICE: in get_region_for_local, at analyzer/region.cc:1366

2024-04-22 Thread iamanonymous.cs at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114778

--- Comment #3 from Anonymous  ---
(In reply to David Malcolm from comment #1)
> Thanks for filing this.
> 
> It's failing this assertion in frame_region::get_region_for_local :
> 
> 1421  case VAR_DECL:
> 1422gcc_assert (!is_global_var (expr));
> 1423/* Fall through.  */
> 1424  case PARM_DECL:
> 1425  case RESULT_DECL:
> 1426gcc_assert (DECL_CONTEXT (expr) == m_fun.decl);
> 1427break;
> 
> (gdb) pt expr
>   type  size 
> unit-size 
> align:64 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type
> 0x7fffea664000 precision:64 min  max
> >
> used unsigned ignored DI ../../src/pr114778.c:6:5 size  0x7fffea644f48 64> unit-size 
> align:64 warn_if_not_align:0 context >
> 
> (gdb) p m_fun.decl
> $1 = 
> 
> Looks like another ICE due to GCC's nested functions extension for C, which
> the analyzer doesn't yet support.

Thank you for your answer to this issue!

[Bug analyzer/114798] New: ICE: in convert_svalue_from_summary_1, at analyzer/call-summary.cc:290

2024-04-21 Thread iamanonymous.cs at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114798

Bug ID: 114798
   Summary: ICE: in convert_svalue_from_summary_1, at
analyzer/call-summary.cc:290
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: analyzer
  Assignee: dmalcolm at gcc dot gnu.org
  Reporter: iamanonymous.cs at gmail dot com
  Target Milestone: ---

Compiler Explorer: https://godbolt.org/z/5GE3xG7zM

***
OS and Platform:
$ uname -a:
Linux ubuntu 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023
x86_64 x86_64 x86_64 GNU/Linux
***
gcc version:
$ gcc -v
Using built-in specs.
COLLECT_GCC=/root/gcc_set/202404101100/bin/gcc
COLLECT_LTO_WRAPPER=/root/gcc_set/202404101100/libexec/gcc/x86_64-pc-linux-gnu/14.0.1/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/root/gcc_set/202404101100
--with-gmp=/root/build_essential --with-mpfr=/root/build_essential
--with-mpc=/root/build_essential --enable-languages=c,c++ --disable-multilib
--with-sanitizer=address,undefined,thread,leak
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 14.0.1 20240410 (experimental) (GCC) 

git version: 0774240b4df9a9bc48ce33a9625788e402498f5a
***
Program:
$ cat mutant.c
_Bool b() {}
void c() {
  int d;
  void check(_Bool a) {
_Bool e;
if (a && e)
  __builtin_abort();
_Bool f = b(d);
if (a && f)
  __builtin_abort();
  }
  check(1);
  check(0);
}

***
Command Lines:
$ gcc -fanalyzer -fanalyzer-call-summaries -c mutant.c
during IPA pass: analyzer
mutant.c: In function ‘c’:
mutant.c:12:3: internal compiler error: in convert_svalue_from_summary_1, at
analyzer/call-summary.cc:290
   12 |   check(1);
  |   ^~~~
0x933c67 ana::call_summary_replay::convert_svalue_from_summary_1(ana::svalue
const*)
../../gcc/gcc/analyzer/call-summary.cc:290
0x217b2aa ana::call_summary_replay::convert_svalue_from_summary(ana::svalue
const*)
../../gcc/gcc/analyzer/call-summary.cc:236
0x219584b ana::replay_fact_visitor::on_fact(ana::svalue const*, tree_code,
ana::svalue const*)
../../gcc/gcc/analyzer/constraint-manager.cc:3273
0x2189728 ana::constraint_manager::for_each_fact(ana::fact_visitor*) const
../../gcc/gcc/analyzer/constraint-manager.cc:3240
0x2189958
ana::constraint_manager::replay_call_summary(ana::call_summary_replay&,
ana::constraint_manager const&)
../../gcc/gcc/analyzer/constraint-manager.cc:3307
0x1491770 ana::region_model::replay_call_summary(ana::call_summary_replay&,
ana::region_model const&)
../../gcc/gcc/analyzer/region-model.cc:5640
0x14723eb ana::program_state::replay_call_summary(ana::call_summary_replay&,
ana::program_state const&)
../../gcc/gcc/analyzer/program-state.cc:1635
0x1458743 ana::call_summary_edge_info::update_state(ana::program_state*,
ana::exploded_edge const*, ana::region_model_context*) const
../../gcc/gcc/analyzer/engine.cc:1633
0x1450d9a ana::exploded_graph::process_node(ana::exploded_node*)
../../gcc/gcc/analyzer/engine.cc:4241
0x145166a ana::exploded_graph::process_worklist()
../../gcc/gcc/analyzer/engine.cc:3516
0x1453c4b ana::impl_run_checkers(ana::logger*)
../../gcc/gcc/analyzer/engine.cc:6210
0x1454bb6 ana::run_checkers()
../../gcc/gcc/analyzer/engine.cc:6308
0x1443a98 execute
../../gcc/gcc/analyzer/analyzer-pass.cc:87
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See  for instructions.

[Bug analyzer/114778] New: ICE: internal compiler error: in get_region_for_local, at analyzer/region.cc:1366

2024-04-18 Thread iamanonymous.cs at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114778

Bug ID: 114778
   Summary: ICE: internal compiler error: in get_region_for_local,
at analyzer/region.cc:1366
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: analyzer
  Assignee: dmalcolm at gcc dot gnu.org
  Reporter: iamanonymous.cs at gmail dot com
  Target Milestone: ---

Compiler Explorer: https://godbolt.org/z/r3E89h944

***
OS and Platform:
$ uname -a:
Linux ubuntu 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023
x86_64 x86_64 x86_64 GNU/Linux
***
gcc version:
$ gcc -v
Using built-in specs.
COLLECT_GCC=/root/gcc_set/202404101100/bin/gcc
COLLECT_LTO_WRAPPER=/root/gcc_set/202404101100/libexec/gcc/x86_64-pc-linux-gnu/14.0.1/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/root/gcc_set/202404101100
--with-gmp=/root/build_essential --with-mpfr=/root/build_essential
--with-mpc=/root/build_essential --enable-languages=c,c++ --disable-multilib
--with-sanitizer=address,undefined,thread,leak
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 14.0.1 20240410 (experimental) (GCC) 

git version: 0774240b4df9a9bc48ce33a9625788e402498f5a
***
Program:
$ cat mutant.c
int b;
int a(char *c) { return c[9]; }
void d() {
  struct e {
char g[b]
  } f(struct e arg) {
a(arg.g);
  }
  if (f != 'd')
;
}

***
Command Lines:
$ gcc -fanalyzer -c mutant.c
mutant.c: In function ‘d’:
mutant.c:6:3: warning: no semicolon at end of struct or union
6 |   } f(struct e arg) {
  |   ^
mutant.c:9:9: warning: comparison between pointer and integer
9 |   if (f != 'd')
  | ^~
during IPA pass: analyzer
mutant.c: In function ‘a’:
mutant.c:2:26: internal compiler error: in get_region_for_local, at
analyzer/region.cc:1366
2 | int a(char *c) { return c[9]; }
  | ~^~~
0x88c303 ana::frame_region::get_region_for_local(ana::region_model_manager*,
tree_node*, ana::region_model_context const*) const
../../gcc/gcc/analyzer/region.cc:1366
0x14815a2 ana::region_model::get_lvalue(ana::path_var,
ana::region_model_context*) const
../../gcc/gcc/analyzer/region-model.cc:2466
0x148541a ana::region_model::get_rvalue_1(ana::path_var,
ana::region_model_context*) const
../../gcc/gcc/analyzer/region-model.cc:2532
0x1481ccc ana::region_model::get_rvalue(ana::path_var,
ana::region_model_context*) const
../../gcc/gcc/analyzer/region-model.cc:2610
0x2173639 ana::region_model::check_region_bounds(ana::region const*,
ana::access_direction, ana::svalue const*, ana::region_model_context*) const
../../gcc/gcc/analyzer/bounds-checking.cc:1396
0x147f3c9 ana::region_model::check_region_access(ana::region const*,
ana::access_direction, ana::svalue const*, ana::region_model_context*) const
../../gcc/gcc/analyzer/region-model.cc:3095
0x147f3c9 ana::region_model::check_region_access(ana::region const*,
ana::access_direction, ana::svalue const*, ana::region_model_context*) const
../../gcc/gcc/analyzer/region-model.cc:3084
0x147f3c9 ana::region_model::check_region_for_read(ana::region const*,
ana::region_model_context*) const
../../gcc/gcc/analyzer/region-model.cc:3129
0x147f3c9 ana::region_model::check_region_for_read(ana::region const*,
ana::region_model_context*) const
../../gcc/gcc/analyzer/region-model.cc:3126
0x147f3c9 ana::region_model::get_store_value(ana::region const*,
ana::region_model_context*) const
../../gcc/gcc/analyzer/region-model.cc:2690
0x1481ccc ana::region_model::get_rvalue(ana::path_var,
ana::region_model_context*) const
../../gcc/gcc/analyzer/region-model.cc:2610
0x148664c ana::region_model::on_assignment(gassign const*,
ana::region_model_context*)
../../gcc/gcc/analyzer/region-model.cc:1244
0x144daf0 ana::exploded_node::on_stmt(ana::exploded_graph&, ana::supernode
const*, gimple const*, ana::program_state*, ana::uncertainty_t*, bool*,
ana::path_context*)
../../gcc/gcc/analyzer/engine.cc:1515
0x1450915 ana::exploded_graph::process_node(ana::exploded_node*)
../../gcc/gcc/analyzer/engine.cc:4125
0x145166a ana::exploded_graph::process_worklist()
../../gcc/gcc/analyzer/engine.cc:3516
0x1453c4b ana::impl_run_checkers(ana::logger*)
../../gcc/gcc/analyzer/engine.cc:6210
0x1454bb6 ana::run_checkers()
../../gcc/gcc/analyzer/engine.cc:6308
0x1443a98 execute
../../gcc/gcc/analyzer/analyzer-pass.cc:87
Please submit a full bug report, with preprocessed source (by using
-freport-bug).

[Bug sanitizer/114687] New: ICE: in edge_before_returns_twice_call, at gimple-iterator.cc:981

2024-04-10 Thread iamanonymous.cs at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114687

Bug ID: 114687
   Summary: ICE: in edge_before_returns_twice_call, at
gimple-iterator.cc:981
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: sanitizer
  Assignee: unassigned at gcc dot gnu.org
  Reporter: iamanonymous.cs at gmail dot com
CC: dodji at gcc dot gnu.org, dvyukov at gcc dot gnu.org,
jakub at gcc dot gnu.org, kcc at gcc dot gnu.org
  Target Milestone: ---

Compiler Explorer: https://godbolt.org/z/vPM1Gshzx

***
OS and Platform:
$ uname -a:
Linux ubuntu 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023
x86_64 x86_64 x86_64 GNU/Linux
***
gcc version:
$ gcc -v
Using built-in specs.
COLLECT_GCC=/root/gcc_set/202404101100/bin/gcc
COLLECT_LTO_WRAPPER=/root/gcc_set/202404101100/libexec/gcc/x86_64-pc-linux-gnu/14.0.1/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/root/gcc_set/202404101100
--with-gmp=/root/build_essential --with-mpfr=/root/build_essential
--with-mpc=/root/build_essential --enable-languages=c,c++ --disable-multilib
--with-sanitizer=address,undefined,thread,leak
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 14.0.1 20240410 (experimental) (GCC) 

git version: 0774240b4df9a9bc48ce33a9625788e402498f5a
***
Program:
$ cat mutant.c
int a;
int b(int);
__attribute__((pure, returns_twice)) int c() {
  a = 1;
  while (a)
a = 2;
  return a;
}
int e(void) {
  int d = c();
  b(d);
}

***
Command Lines:
$ gcc -fsanitize=address -O1 -c mutant.c
during GIMPLE pass: asan
mutant.c: In function ‘e’:
mutant.c:9:5: internal compiler error: in edge_before_returns_twice_call, at
gimple-iterator.cc:981
9 | int e(void) {
  | ^
0x792bf8 edge_before_returns_twice_call
../../gcc/gcc/gimple-iterator.cc:981
0xcb169e gsi_safe_insert_before(gimple_stmt_iterator*, gimple*)
../../gcc/gcc/gimple-iterator.cc:1054
0x1060c36 maybe_instrument_call
../../gcc/gcc/asan.cc:3032
0x1060c36 transform_statements
../../gcc/gcc/asan.cc:3118
0x1060fe7 asan_instrument
../../gcc/gcc/asan.cc:4262
0x1060fe7 execute
../../gcc/gcc/asan.cc:4303
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See  for instructions.

[Bug c++/114638] New: Hang and Memory Consumption Increase during Compilation with Recursive Template Instantiation

2024-04-08 Thread iamanonymous.cs at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114638

Bug ID: 114638
   Summary: Hang and Memory Consumption Increase during
Compilation with Recursive Template Instantiation
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: iamanonymous.cs at gmail dot com
  Target Milestone: ---

The following code snippet triggers a hang issue:

$ cat bug.cpp

struct Z
{
  Z () = default;
  Z (Z const &) = default;
  constexpr Z (Z &&) {}
};

template < typename T > 
constexpr int 
fn (T v)
{
  return fn (v);
}

auto t = fn (Z (Z (Z (Z (Z (Z (Z (Z (Z (Z (Z (Z (Z (Z (Z (Z (Z (Z (Z (Z (Z (Z
(Z (Z (Z (Z (Z (Z (Z (Z (Z (Z (Z (Z (Z (Z (Z (Z (Z (Z (Z (Z (Z (Z (Z (Z (Z (Z
(Z (Z (Z (Z (Z (Z (Z (Z (Z (Z (Z (Z (Z (Z (Z (Z (Z ());


The code with this syntax error should promptly output a compilation error
instead of hanging indefinitely and depleting memory resources. The command we
used is(no error output):

g++ bug.cpp



The GCC version:

$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/home/cTest/gcc/myinstall/libexec/gcc/x86_64-linux-gnu/14.0.1/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../configure -v --build=x86_64-linux-gnu
--host=x86_64-linux-gnu --target=x86_64-linux-gnu --enable-checking=no
--enable-languages=c,c++ --disable-multilib --prefix=/home/cTest/gcc/myinstall
--disable-bootstrap
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 14.0.1 20240329 (experimental) (GCC) 


[Bug c/114634] New: Crash Issue Encountered in GCC Compilation of Template Code with Aligned Attribute

2024-04-08 Thread iamanonymous.cs at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114634

Bug ID: 114634
   Summary: Crash Issue Encountered in GCC Compilation of Template
Code with Aligned Attribute
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: iamanonymous.cs at gmail dot com
  Target Milestone: ---

The following code snippet triggers a crash issue:


$ cat bug.cc

template  class A
{ enum { e __attribute__ ((aligned(16))) }; };



The error output is:

$ gcc bug.cc

internal compiler error: Segmentation fault
2 | { enum { e __attribute__ ((aligned(16))) }; };
  |^
0xedc273 crash_signal
../../gcc/toplev.cc:319
0x957dd7 diag_attr_exclusions
../../gcc/attribs.cc:471
0x95a5f7 decl_attributes(tree_node**, tree_node*, int, tree_node*)
../../gcc/attribs.cc:867
0x7ecc0e cplus_decl_attributes(tree_node**, tree_node*, int)
../../gcc/cp/decl2.cc:1880
0x7de1d1 build_enumerator(tree_node*, tree_node*, tree_node*, tree_node*,
unsigned int)
../../gcc/cp/decl.cc:17543
0x890bdc cp_parser_enumerator_definition
../../gcc/cp/parser.cc:21903
0x890bdc cp_parser_enumerator_list
../../gcc/cp/parser.cc:21823
0x890bdc cp_parser_enum_specifier
../../gcc/cp/parser.cc:21754
0x890bdc cp_parser_type_specifier
../../gcc/cp/parser.cc:20034
0x8916f1 cp_parser_decl_specifier_seq
../../gcc/cp/parser.cc:16590
0x8bfc4f cp_parser_member_declaration
../../gcc/cp/parser.cc:27984
0x88dec1 cp_parser_member_specification_opt
../../gcc/cp/parser.cc:27840
0x88dec1 cp_parser_class_specifier
../../gcc/cp/parser.cc:26845
0x890171 cp_parser_type_specifier
../../gcc/cp/parser.cc:20064
0x8916f1 cp_parser_decl_specifier_seq
../../gcc/cp/parser.cc:16590
0x8bd774 cp_parser_single_declaration
../../gcc/cp/parser.cc:33143
0x8bdbd3 cp_parser_template_declaration_after_parameters
../../gcc/cp/parser.cc:32799
0x8be4b9 cp_parser_explicit_template_declaration
../../gcc/cp/parser.cc:33072
0x8be4b9 cp_parser_template_declaration_after_export
../../gcc/cp/parser.cc:33091
0x8c1fad cp_parser_declaration
../../gcc/cp/parser.cc:15502


The GCC version:

$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/home/cTest/gcc/myinstall/libexec/gcc/x86_64-linux-gnu/14.0.1/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../configure -v --build=x86_64-linux-gnu
--host=x86_64-linux-gnu --target=x86_64-linux-gnu --enable-checking=no
--enable-languages=c,c++ --disable-multilib --prefix=/home/cTest/gcc/myinstall
--disable-bootstrap
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 14.0.1 20240329 (experimental) (GCC) 


[Bug tree-optimization/114095] New: ICE: in build2, at tree.cc:5097

2024-02-25 Thread iamanonymous.cs at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114095

Bug ID: 114095
   Summary: ICE: in build2, at tree.cc:5097
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: iamanonymous.cs at gmail dot com
  Target Milestone: ---

Compiler Explorer: https://godbolt.org/z/c4d5x6Eza

***
OS and Platform:
$ uname -a:
Linux ubuntu 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023
x86_64 x86_64 x86_64 GNU/Linux
***
gcc version:
$ gcc -v
Using built-in specs.
COLLECT_GCC=/root/gcc_set/2024020020942/bin/gcc
COLLECT_LTO_WRAPPER=/root/gcc_set/2024020020942/libexec/gcc/x86_64-pc-linux-gnu/14.0.1/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/root/gcc_set/2024020020942
--with-gmp=/root/build_essential --with-mpfr=/root/build_essential
--with-mpc=/root/build_essential --enable-languages=c,c++ --disable-multilib
--with-sanitizer=address,undefined,thread,leak
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 14.0.1 20240204 (experimental) (GCC)

git version: 8e6ebacc9e3cee0d2053fdaceda0ae052e34b777
***
Program:
$ cat mutant.c
__GIMPLE a(double *x) {
  b c;
  d = x_80 + c

***
Command Lines:
$ gcc mutant.c
mutant.c:1:1: error: ‘__GIMPLE’ only valid with ‘-fgimple’
1 | __GIMPLE a(double *x) {
  | ^~~~
mutant.c:1:10: error: return type defaults to ‘int’ [-Wimplicit-int]
1 | __GIMPLE a(double *x) {
  |  ^
mutant.c: In function ‘a’:
mutant.c:2:3: error: unknown type name ‘b’
2 |   b c;
  |   ^
mutant.c:3:3: error: ‘d’ undeclared (first use in this function)
3 |   d = x_80 + c
  |   ^
mutant.c:3:3: note: each undeclared identifier is reported only once for each
function it appears in
mutant.c:3:3: internal compiler error: in build2, at tree.cc:5097
0x869763 build2(tree_code, tree_node*, tree_node*, tree_node*)
../../gcc/gcc/tree.cc:5097
0x9f960f build2_loc(unsigned int, tree_code, tree_node*, tree_node*,
tree_node*)
../../gcc/gcc/tree.h:4750
0x9f960f c_parser_gimple_binary_expression
../../gcc/gcc/c/gimple-parser.cc:1068
0x9fa561 c_parser_gimple_statement
../../gcc/gcc/c/gimple-parser.cc:878
0x9fb2aa c_parser_gimple_compound_statement
../../gcc/gcc/c/gimple-parser.cc:669
0x9fcca1 c_parser_parse_gimple_body(c_parser*, char*, c_declspec_il,
profile_count)
../../gcc/gcc/c/gimple-parser.cc:253
0x9e8cd4 c_parser_declaration_or_fndef
../../gcc/gcc/c/c-parser.cc:3011
0x9f2f3b c_parser_external_declaration
../../gcc/gcc/c/c-parser.cc:2046
0x9f3925 c_parser_translation_unit
../../gcc/gcc/c/c-parser.cc:1900
0x9f3925 c_parse_file()
../../gcc/gcc/c/c-parser.cc:26815
0xa6ad51 c_common_parse_file()
../../gcc/gcc/c-family/c-opts.cc:1306
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See  for instructions.

[Bug tree-optimization/110251] [13/14 Regression] Hang at -O3 on x86_64-linux-gnu

2024-01-16 Thread iamanonymous.cs at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110251

--- Comment #15 from Anonymous  ---
(In reply to Andrew Pinski from comment #10)
> (In reply to Anonymous from comment #9)
> > (In reply to Andrew Pinski from comment #1)
> > > dom3 :
> > > ```
> > 
> > Could you please explain on how you to record this trace? Is there any
> > specific compilation option to enable this information? Thanks.
> 
> I used gdb to figure it out. Just stopped it a few times during the
> compiling and saw the backtrace was similar/stuck.

Got it. Thanks.

[Bug tree-optimization/110251] [13/14 Regression] Hang at -O3 on x86_64-linux-gnu

2024-01-16 Thread iamanonymous.cs at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110251

Anonymous  changed:

   What|Removed |Added

 CC||iamanonymous.cs at gmail dot 
com

--- Comment #9 from Anonymous  ---
(In reply to Andrew Pinski from comment #1)
> dom3 :
> ```
> #0  0x012add4b in irange::intersect (this=, v=...) at
> /home/apinski/src/upstream-gcc-git/gcc/gcc/value-range.cc:1523
> #1  0x01c93506 in Value_Range::intersect (r=...,
> this=0x7ffe17a0) at
> /home/apinski/src/upstream-gcc-git/gcc/gcc/value-range.h:541
> #2  gori_compute::compute_operand2_range (this=0x2f4dcd0, r=...,
> handler=..., lhs=..., name=0x779dc000, src=..., rel=) at
> /home/apinski/src/upstream-gcc-git/gcc/gcc/gimple-range-gori.cc:1267
> #3  0x01c946de in gori_compute::compute_operand1_and_operand2_range
> (this=0x2f4dcd0, r=..., handler=..., lhs=..., name=0x779dc000, src=...,
> rel=0x0) at
> /home/apinski/src/upstream-gcc-git/gcc/gcc/gimple-range-gori.cc:1296
> #4  0x01c9165b in gori_compute::compute_operand_range
> (this=0x2f4dcd0, r=..., stmt=0x776015d8, lhs=..., name=0x779dc000,
> src=..., rel=0x0) at
> /home/apinski/src/upstream-gcc-git/gcc/gcc/gimple-range-gori.cc:708
> #5  0x01c94028 in gori_compute::compute_operand_range (rel=0x0,
> src=..., name=0x779dc000, lhs=..., stmt=, r=...,
> this=0x2f4dcd0) at
> /home/apinski/src/upstream-gcc-git/gcc/gcc/value-range.h:757
> #6  gori_compute::compute_operand1_range (this=0x2f4dcd0, r=...,
> handler=..., lhs=..., name=0x779dc000, src=..., rel=0x0) at
> /home/apinski/src/upstream-gcc-git/gcc/gcc/gimple-range-gori.cc:1178
> #7  0x01c9159b in gori_compute::compute_operand_range
> (this=0x2f4dcd0, r=..., stmt=0x77601688, lhs=..., name=0x779dc000,
> src=..., rel=0x0) at
> /home/apinski/src/upstream-gcc-git/gcc/gcc/gimple-range-gori.cc:711
> #8  0x01c94028 in gori_compute::compute_operand_range (rel=0x0,
> src=..., name=0x779dc000, lhs=..., stmt=, r=...,
> this=0x2f4dcd0) at
> /home/apinski/src/upstream-gcc-git/gcc/gcc/value-range.h:757
> #9  gori_compute::compute_operand1_range (this=0x2f4dcd0, r=...,
> handler=..., lhs=..., name=0x779dc000, src=..., rel=0x0) at
> /home/apinski/src/upstream-gcc-git/gcc/gcc/gimple-range-gori.cc:1178
> #10 0x01c94757 in gori_compute::compute_operand1_and_operand2_range
> (this=0x2f4dcd0, r=..., handler=..., lhs=..., name=, src=...,
> rel=0x0) at
> /home/apinski/src/upstream-gcc-git/gcc/gcc/gimple-range-gori.cc:1300
> #11 0x01c9165b in gori_compute::compute_operand_range
> (this=0x2f4dcd0, r=..., stmt=0x776016e0, lhs=..., name=0x779dc000,
> src=..., rel=0x0) at
> /home/apinski/src/upstream-gcc-git/gcc/gcc/gimple-range-gori.cc:708
> #12 0x01c94028 in gori_compute::compute_operand_range (rel=0x0,
> src=..., name=0x779dc000, lhs=..., stmt=, r=...,
> this=0x2f4dcd0) at
> /home/apinski/src/upstream-gcc-git/gcc/gcc/value-range.h:757
> #13 gori_compute::compute_operand1_range (this=0x2f4dcd0, r=...,
> handler=..., lhs=..., name=0x779dc000, src=..., rel=0x0) at
> /home/apinski/src/upstream-gcc-git/gcc/gcc/gimple-range-gori.cc:1178
> #14 0x01c9159b in gori_compute::compute_operand_range
> (this=0x2f4dcd0, r=..., stmt=0x77601790, lhs=..., name=0x779dc000,
> src=..., rel=0x0) at
> /home/apinski/src/upstream-gcc-git/gcc/gcc/gimple-range-gori.cc:711
> #15 0x01c94028 in gori_compute::compute_operand_range (rel=0x0,
> src=..., name=0x779dc000, lhs=..., stmt=, r=...,
> this=0x2f4dcd0) at
> /home/apinski/src/upstream-gcc-git/gcc/gcc/value-range.h:757
> #16 gori_compute::compute_operand1_range (this=0x2f4dcd0, r=...,
> handler=..., lhs=..., name=0x779dc000, src=..., rel=0x0) at
> /home/apinski/src/upstream-gcc-git/gcc/gcc/gimple-range-gori.cc:1178
> #17 0x01c94757 in gori_compute::compute_operand1_and_operand2_range
> (this=0x2f4dcd0, r=..., handler=..., lhs=..., name=, src=...,
> rel=0x0) at
> /home/apinski/src/upstream-gcc-git/gcc/gcc/gimple-range-gori.cc:1300
> #18 0x01c9165b in gori_compute::compute_operand_range
> (this=0x2f4dcd0, r=..., stmt=0x776017e8, lhs=..., name=0x779dc000,
> src=..., rel=0x0) at
> /home/apinski/src/upstream-gcc-git/gcc/gcc/gimple-range-gori.cc:708
> #19 0x01c93552 in gori_compute::compute_operand_range (rel=0x0,
> src=..., name=0x779dc000, lhs=..., stmt=, r=...,
> this=0x2f4dcd0) at
> /home/apinski/src/upstream-gcc-git/gcc/gcc/value-range.h:757
> #20 gori_compute::compute_operand2_range (this=0x2f4dcd0, r=...,
> handler=..., lhs=..., name=0x779dc000, src=..., rel=) at
> /home/apinski/src/upstream-gcc-git/gcc/gcc/gimple-range-gori.cc:1276
> #21 0x01c946de in gori_compute::compute_operand1_and_operand2_range
> (this=0x2f4dcd0, r=..., handler=..., lhs=..., name=0x779dc000, src=...,
> rel=0x0) at
> 

[Bug tree-optimization/113285] New: ICE: verify_flow_info failed

2024-01-08 Thread iamanonymous.cs at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113285

Bug ID: 113285
   Summary: ICE: verify_flow_info failed
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: iamanonymous.cs at gmail dot com
  Target Milestone: ---

Compiler Explorer: https://godbolt.org/z/8Ebhao48a

***
OS and Platform:
$ uname -a:
Linux ubuntu 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023
x86_64 x86_64 x86_64 GNU/Linux
***
gcc version:
$ gcc -v
Using built-in specs.
COLLECT_GCC=/root/gcc_set/202311291030/bin/gcc
COLLECT_LTO_WRAPPER=/root/gcc_set/202311291030/libexec/gcc/x86_64-pc-linux-gnu/14.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/root/gcc_set/202311291030
--with-gmp=/root/build_essential --with-mpfr=/root/build_essential
--with-mpc=/root/build_essential --enable-languages=c,c++ --disable-multilib
--with-sanitizer=address,undefined,thread,leak
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 14.0.0 20231129 (experimental) (GCC) 

git version: 99fa0bfd63d97825c4221dcd3123940f1d0e6291
***
Program:
$ cat mutant.c
void f(void)
{
  void p(void)
  {
__label__ l1;
void q(void)
{
  goto l1;
}

l1:;
  }
  p();
}

***
Command Lines:
$ gcc mutant.c
mutant.c: In function ‘p’:
mutant.c:3:8: error: label ‘({anonymous})’ has incorrect context in bb 4
3 |   void p(void)
  |^
during GIMPLE pass: cfg
mutant.c:3:8: internal compiler error: verify_flow_info failed
0xae444e verify_flow_info()
../../gcc/gcc/cfghooks.cc:287
0x1066aac checking_verify_flow_info()
../../gcc/gcc/cfghooks.h:214
0x1066aac cleanup_tree_cfg_noloop
../../gcc/gcc/tree-cfgcleanup.cc:1154
0x1066aac cleanup_tree_cfg(unsigned int)
../../gcc/gcc/tree-cfgcleanup.cc:1205
0x105e6f4 execute_build_cfg
../../gcc/gcc/tree-cfg.cc:378
0x105e6f4 execute
../../gcc/gcc/tree-cfg.cc:412
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See  for instructions.

[Bug middle-end/113264] New: ICE:tree check: expected tree that contains 'common' structure, have 'integer_cst' in copy_list, at tree.cc:1427

2024-01-07 Thread iamanonymous.cs at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113264

Bug ID: 113264
   Summary: ICE:tree check: expected tree that contains 'common'
structure, have 'integer_cst' in copy_list, at
tree.cc:1427
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: middle-end
  Assignee: unassigned at gcc dot gnu.org
  Reporter: iamanonymous.cs at gmail dot com
  Target Milestone: ---

Compiler Explorer: https://godbolt.org/z/1bev4r9a4

***
OS and Platform:
$ uname -a:
Linux ubuntu 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023
x86_64 x86_64 x86_64 GNU/Linux
***
gcc version:
$ gcc -v
Using built-in specs.
COLLECT_GCC=/root/gcc_set/202311291030/bin/gcc
COLLECT_LTO_WRAPPER=/root/gcc_set/202311291030/libexec/gcc/x86_64-pc-linux-gnu/14.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/root/gcc_set/202311291030
--with-gmp=/root/build_essential --with-mpfr=/root/build_essential
--with-mpc=/root/build_essential --enable-languages=c,c++ --disable-multilib
--with-sanitizer=address,undefined,thread,leak
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 14.0.0 20231129 (experimental) (GCC) 

git version: 99fa0bfd63d97825c4221dcd3123940f1d0e6291
***
Program:
$ cat mutant.c
__attribute__((no_sanitize_address))
__attribute__((target_clones("arch=haswell", "default"))) int __tanh() {}
__typeof(__tanh) tanhf64 __attribute__((alias("__tanh")))
__attribute__((__copy__(__tanh)));

***
Command Lines:
$ gcc mutant.c
mutant.c:4:1: internal compiler error: tree check: expected tree that contains
‘common’ structure, have ‘integer_cst’ in copy_list, at tree.cc:1427
4 | __attribute__((__copy__(__tanh)));
  | ^
0x859d06 tree_contains_struct_check_failed(tree_node const*,
tree_node_structure_enum, char const*, int, char const*)
../../gcc/gcc/tree.cc:9126
0x860f78 contains_struct_check(tree_node*, tree_node_structure_enum, char
const*, int, char const*)
../../gcc/gcc/tree.h:3748
0x860f78 copy_list(tree_node*)
../../gcc/gcc/tree.cc:1427
0xa755a5 handle_copy_attribute
../../gcc/gcc/c-family/c-attribs.cc:3077
0x94ad5b decl_attributes(tree_node**, tree_node*, int, tree_node*)
../../gcc/gcc/attribs.cc:886
0x95139d c_decl_attributes
../../gcc/gcc/c/c-decl.cc:5425
0x9689f7 start_decl(c_declarator*, c_declspecs*, bool, tree_node*, bool,
unsigned int*)
../../gcc/gcc/c/c-decl.cc:5571
0x9d5757 c_parser_declaration_or_fndef
../../gcc/gcc/c/c-parser.cc:2766
0x9e168b c_parser_external_declaration
../../gcc/gcc/c/c-parser.cc:2046
0x9e2075 c_parser_translation_unit
../../gcc/gcc/c/c-parser.cc:1900
0x9e2075 c_parse_file()
../../gcc/gcc/c/c-parser.cc:26713
0xa564e1 c_common_parse_file()
../../gcc/gcc/c-family/c-opts.cc:1296
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See  for instructions.

[Bug debug/113057] New: Segmentation fault in dwarf2out.cc:941 with -O -fno-dwarf2-cfi-asm

2023-12-17 Thread iamanonymous.cs at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113057

Bug ID: 113057
   Summary: Segmentation fault in dwarf2out.cc:941 with -O
-fno-dwarf2-cfi-asm
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: debug
  Assignee: unassigned at gcc dot gnu.org
  Reporter: iamanonymous.cs at gmail dot com
  Target Milestone: ---

Compiler Explorer: https://godbolt.org/z/4ndYafjnT

***
OS and Platform:
$ uname -a:
Linux ubuntu 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023
x86_64 x86_64 x86_64 GNU/Linux
***
gcc version:
$ gcc -v
Using built-in specs.
COLLECT_GCC=/root/gcc_set/202311291030/bin/gcc
COLLECT_LTO_WRAPPER=/root/gcc_set/202311291030/libexec/gcc/x86_64-pc-linux-gnu/14.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/root/gcc_set/202311291030
--with-gmp=/root/build_essential --with-mpfr=/root/build_essential
--with-mpc=/root/build_essential --enable-languages=c,c++ --disable-multilib
--with-sanitizer=address,undefined,thread,leak
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 14.0.0 20231129 (experimental) (GCC) 

git version: 99fa0bfd63d97825c4221dcd3123940f1d0e6291
***
Program:
$ cat mutant.c
int __RTL (startwith ("final")) a () {
(function "" ) 
}

***
Command Lines:
$ gcc -O -fno-dwarf2-cfi-asm mutant.c
mutant.c:3:1: internal compiler error: Segmentation fault
3 | }
  | ^
0x101491f crash_signal
../../gcc/gcc/toplev.cc:316
0xb6efb7 vec::iterate(unsigned int,
dw_cfi_node**) const
../../gcc/gcc/vec.h:951
0xb6efb7 output_call_frame_info
../../gcc/gcc/dwarf2out.cc:941
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See  for instructions.

[Bug target/113043] New: ICE: in emit_move_insn, at expr.cc:4246

2023-12-15 Thread iamanonymous.cs at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113043

Bug ID: 113043
   Summary: ICE: in emit_move_insn, at expr.cc:4246
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: iamanonymous.cs at gmail dot com
  Target Milestone: ---

Compiler Explorer: https://godbolt.org/z/erY5Mrrso

***
OS and Platform:
$ uname -a:
Linux ubuntu 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023
x86_64 x86_64 x86_64 GNU/Linux
***
gcc version:
$ gcc -v
Using built-in specs.
COLLECT_GCC=/root/gcc_set/202311291030/bin/gcc
COLLECT_LTO_WRAPPER=/root/gcc_set/202311291030/libexec/gcc/x86_64-pc-linux-gnu/14.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/root/gcc_set/202311291030
--with-gmp=/root/build_essential --with-mpfr=/root/build_essential
--with-mpc=/root/build_essential --enable-languages=c,c++ --disable-multilib
--with-sanitizer=address,undefined,thread,leak
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 14.0.0 20231129 (experimental) (GCC) 

git version: 99fa0bfd63d97825c4221dcd3123940f1d0e6291
***
Program:
$ cat mutant.c
struct a {
  long b
};
__attribute__((interrupt)) void c(struct a *d) { 1 != d->b; }

***
Command Lines:
$ gcc -mx32 -mgeneral-regs-only -maddress-mode=long -fsanitize=undefined
mutant.c
mutant.c:3:1: warning: no semicolon at end of struct or union
3 | };
  | ^
during RTL pass: expand
mutant.c: In function ‘c’:
mutant.c:4:56: internal compiler error: in emit_move_insn, at expr.cc:4246
4 | __attribute__((interrupt)) void c(struct a *d) { 1 != d->b; }
  |   ~^~~
0x774d50 emit_move_insn(rtx_def*, rtx_def*)
../../gcc/gcc/expr.cc:4246
0xaddfec expand_gimple_stmt_1
../../gcc/gcc/cfgexpand.cc:4011
0xaddfec expand_gimple_stmt
../../gcc/gcc/cfgexpand.cc:4045
0xadec97 expand_gimple_basic_block
../../gcc/gcc/cfgexpand.cc:6101
0xae08f6 execute
../../gcc/gcc/cfgexpand.cc:6836
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See  for instructions.

[Bug tree-optimization/112939] New: ICE: verify_ssa failed with -O -ftrivial-auto-var-init=zero

2023-12-09 Thread iamanonymous.cs at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112939

Bug ID: 112939
   Summary: ICE: verify_ssa failed with -O
-ftrivial-auto-var-init=zero
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: iamanonymous.cs at gmail dot com
  Target Milestone: ---

Compiler Explorer: https://godbolt.org/z/4q74n5baY

***
OS and Platform:
$ uname -a:
Linux ubuntu 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023
x86_64 x86_64 x86_64 GNU/Linux
***
gcc version:
$ gcc -v
Using built-in specs.
COLLECT_GCC=/root/gcc_set/202311291030/bin/gcc
COLLECT_LTO_WRAPPER=/root/gcc_set/202311291030/libexec/gcc/x86_64-pc-linux-gnu/14.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/root/gcc_set/202311291030
--with-gmp=/root/build_essential --with-mpfr=/root/build_essential
--with-mpc=/root/build_essential --enable-languages=c,c++ --disable-multilib
--with-sanitizer=address,undefined,thread,leak
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 14.0.0 20231129 (experimental) (GCC) 

git version: 99fa0bfd63d97825c4221dcd3123940f1d0e6291
***
Program:
$ cat mutant.c
int i;

void f (void)
{
  for (;;)
  {
if (0)
  for (;;)
  {
int *a;
int *b = a;

 l1:
*b = (*b != 0) ? 0 : 2;
  }

if (i != 0)
  goto l1;
  }
}

***
Command Lines:
$ gcc -O -ftrivial-auto-var-init=zero mutant.c
mutant.c: In function ‘f’:
mutant.c:20:1: error: definition in block 5 does not dominate use in block 3
   20 | }
  | ^
for SSA_NAME: a_11 in statement:
# VUSE <.MEM_5>
_1 = *a_11;
during GIMPLE pass: fre
mutant.c:20:1: internal compiler error: verify_ssa failed
0x1283220 verify_ssa(bool, bool)
../../gcc/gcc/tree-ssa.cc:1203
0xee93a5 execute_function_todo
../../gcc/gcc/passes.cc:2095
0xee980e execute_todo
../../gcc/gcc/passes.cc:2142
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See  for instructions.

[Bug target/112913] New: ICE: in curr_insn_transform, at lra-constraints.cc:4308

2023-12-07 Thread iamanonymous.cs at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112913

Bug ID: 112913
   Summary: ICE: in curr_insn_transform, at
lra-constraints.cc:4308
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: iamanonymous.cs at gmail dot com
  Target Milestone: ---

***
OS and Platform:
$ uname -a:
Linux ubuntu 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023
x86_64 x86_64 x86_64 GNU/Linux
***
gcc version:
$ gcc -v
Using built-in specs.
COLLECT_GCC=/root/gcc_set/202311291030/bin/gcc
COLLECT_LTO_WRAPPER=/root/gcc_set/202311291030/libexec/gcc/x86_64-pc-linux-gnu/14.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/root/gcc_set/202311291030
--with-gmp=/root/build_essential --with-mpfr=/root/build_essential
--with-mpc=/root/build_essential --enable-languages=c,c++ --disable-multilib
--with-sanitizer=address,undefined,thread,leak
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 14.0.0 20231129 (experimental) (GCC) 

git version: 99fa0bfd63d97825c4221dcd3123940f1d0e6291
***
Program:
$ cat mutant.c
typedef unsigned short uint16_t;
uint16_t a;

void
function (uint16_t **p)
{
  a = **p;
}

***
Compiler explorer: 
Command Lines:
$ gcc -ffixed-rax -ffixed-rbx -ffixed-rcx -ffixed-rdx -ffixed-rdi -ffixed-rsi
-ffixed-r8 -ffixed-r9 -ffixed-r10 -ffixed-r11 -ffixed-r12 -ffixed-r13
-ffixed-r14 -fsanitize=address mutant.c
mutant.c: In function ‘function’:
mutant.c:8:1: error: unable to generate reloads for:
8 | }
  | ^
(insn 31 30 32 4 (set (reg:CCGC 17 flags)
(compare:CCGC (reg:QI 113 [ _21 ])
(reg:QI 109 [ _17 ]))) "mutant.c":7:7 9 {*cmpqi_1}
 (expr_list:REG_DEAD (reg:QI 113 [ _21 ])
(expr_list:REG_DEAD (reg:QI 109 [ _17 ])
(nil
during RTL pass: reload
mutant.c:8:1: internal compiler error: in curr_insn_transform, at
lra-constraints.cc:4308
0x7e504e _fatal_insn(char const*, rtx_def const*, char const*, int, char
const*)
../../gcc/gcc/rtl-error.cc:108
0x7bb7f8 curr_insn_transform
../../gcc/gcc/lra-constraints.cc:4308
0xe32206 lra_constraints(bool)
../../gcc/gcc/lra-constraints.cc:5511
0xe1d532 lra(_IO_FILE*)
../../gcc/gcc/lra.cc:2419
0xdd3241 do_reload
../../gcc/gcc/ira.cc:5973
0xdd3241 execute
../../gcc/gcc/ira.cc:6161
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.

Also ICE on trunk, compiler explorer: https://godbolt.org/z/q1YT7vKzh

[Bug target/112903] New: ICE: in df_scan_verify, at df-scan.cc:4239 with -O -fdump-rtl-pro_and_epilogue

2023-12-07 Thread iamanonymous.cs at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112903

Bug ID: 112903
   Summary: ICE: in df_scan_verify, at df-scan.cc:4239 with -O
-fdump-rtl-pro_and_epilogue
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: iamanonymous.cs at gmail dot com
  Target Milestone: ---

***
OS and Platform:
$ uname -a:
Linux ubuntu 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023
x86_64 x86_64 x86_64 GNU/Linux
***
gcc version:
$ gcc -v
Using built-in specs.
COLLECT_GCC=/root/gcc_set/202311291030/bin/gcc
COLLECT_LTO_WRAPPER=/root/gcc_set/202311291030/libexec/gcc/x86_64-pc-linux-gnu/14.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/root/gcc_set/202311291030
--with-gmp=/root/build_essential --with-mpfr=/root/build_essential
--with-mpc=/root/build_essential --enable-languages=c,c++ --disable-multilib
--with-sanitizer=address,undefined,thread,leak
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 14.0.0 20231129 (experimental) (GCC) 

git version: 99fa0bfd63d97825c4221dcd3123940f1d0e6291
***
Program:
$ cat mutant.c
int __RTL (startwith ("pro_and_epilogue")) a ()
{
(function ""
  (insn-chain
(block 2
  (edge-from b )
  (cnote 6 [bb 2] NOTE_INSN_BASIC_BLOCK)
  (cjump_insn 0 (set (pc)
(if_then_else (ge (reg flags)
(const_int 0))
(label_ref 16)
(pc))) )
) (block 3
  (cnote 1 [bb 3] NOTE_INSN_BASIC_BLOCK)
  (cjump_insn 9 (set (pc)
(label_ref 20)) )
) (block 4
  (edge-from 2)
  (clabel 16 2)
  (cnote 7 [bb 4] NOTE_INSN_BASIC_BLOCK)
) (block 5
  (edge-from 4 (flags "FALLTHRU"))
  (edge-from 3)
  (clabel 20 3)
  (cnote 21 [bb 5] NOTE_INSN_BASIC_BLOCK)
  (edge-to exit (flags "FALLTHRU"))
) ) )  
}

***
Command Lines:
$ gcc -O -fdump-rtl-pro_and_epilogue mutant.c
during RTL pass: dse2
mutant.c: In function ‘a’:
mutant.c:28:1: internal compiler error: in df_scan_verify, at df-scan.cc:4239
   28 | }
  | ^
0x76308c df_scan_verify()
../../gcc/gcc/df-scan.cc:4239
0xb3d8f4 df_verify()
../../gcc/gcc/df-core.cc:1834
0xb3d8f4 df_analyze_1
../../gcc/gcc/df-core.cc:1221
0x1dfbc79 rest_of_handle_dse
../../gcc/gcc/dse.cc:3711
0x1dfbc79 execute
../../gcc/gcc/dse.cc:3787
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.


Also ICE on trunk, compiler explorer: https://godbolt.org/z/ooM769Yvd

[Bug tree-optimization/112898] New: ICE: in make_ssa_name_fn, at tree-ssanames.cc:354 with -O2 -finstrument-functions-once

2023-12-07 Thread iamanonymous.cs at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112898

Bug ID: 112898
   Summary: ICE: in make_ssa_name_fn, at tree-ssanames.cc:354 with
-O2 -finstrument-functions-once
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: iamanonymous.cs at gmail dot com
  Target Milestone: ---

***
OS and Platform:
$ uname -a:
Linux ubuntu 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023
x86_64 x86_64 x86_64 GNU/Linux
***
gcc version:
$ gcc -v
Using built-in specs.
COLLECT_GCC=/root/gcc_set/202311291030/bin/gcc
COLLECT_LTO_WRAPPER=/root/gcc_set/202311291030/libexec/gcc/x86_64-pc-linux-gnu/14.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/root/gcc_set/202311291030
--with-gmp=/root/build_essential --with-mpfr=/root/build_essential
--with-mpc=/root/build_essential --enable-languages=c,c++ --disable-multilib
--with-sanitizer=address,undefined,thread,leak
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 14.0.0 20231129 (experimental) (GCC) 

git version: 99fa0bfd63d97825c4221dcd3123940f1d0e6291
***
Program:
$ cat mutant.c
void func(int n)
{
struct T { int x[n]; };
struct T *t = __builtin_malloc(sizeof *t);
}

***
Command Lines:
$ gcc -O2 -finstrument-functions-once mutant.c
during GIMPLE pass: fnsplit
In function ‘func.part.0’:
cc1: internal compiler error: in make_ssa_name_fn, at tree-ssanames.cc:354
0x848332 make_ssa_name_fn(function*, tree_node*, gimple*, unsigned int)
../../gcc/gcc/tree-ssanames.cc:354
0x109c94b make_ssa_name(tree_node*, gimple*)
../../gcc/gcc/tree-ssanames.h:98
0x109c94b remap_ssa_name
../../gcc/gcc/tree-inline.cc:237
0x10a0462 copy_tree_body_r(tree_node**, int*, void*)
../../gcc/gcc/tree-inline.cc:1226
0x1343f4c walk_tree_1(tree_node**, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set >*,
tree_node* (*)(tree_node**, int*, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set >*))
../../gcc/gcc/tree.cc:11420
0x13440a4 walk_tree_1(tree_node**, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set >*,
tree_node* (*)(tree_node**, int*, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set >*))
../../gcc/gcc/tree.cc:11654
0x109ad43 remap_type_1
../../gcc/gcc/tree-inline.cc:596
0x109b6c3 remap_type(tree_node*, copy_body_data*)
../../gcc/gcc/tree-inline.cc:713
0x109b805 remap_decl(tree_node*, copy_body_data*)
../../gcc/gcc/tree-inline.cc:377
0x109af15 remap_type_1
../../gcc/gcc/tree-inline.cc:562
0x109b6c3 remap_type(tree_node*, copy_body_data*)
../../gcc/gcc/tree-inline.cc:713
0x109b805 remap_decl(tree_node*, copy_body_data*)
../../gcc/gcc/tree-inline.cc:377
0x109daf4 remap_decls
../../gcc/gcc/tree-inline.cc:762
0x109de54 remap_block
../../gcc/gcc/tree-inline.cc:820
0x109df25 remap_blocks
../../gcc/gcc/tree-inline.cc:839
0x10a5e1b tree_function_versioning(tree_node*, tree_node*,
vec*, ipa_param_adjustments*, bool,
bitmap_head*, basic_block_def*)
../../gcc/gcc/tree-inline.cc:6310
0xb27bfe cgraph_node::create_version_clone_with_body(vec, vec*, ipa_param_adjustments*,
bitmap_head*, basic_block_def*, char const*, tree_node*, bool)
../../gcc/gcc/cgraphclones.cc:1073
0x1ef4f48 split_function
../../gcc/gcc/ipa-split.cc:1376
0x1ef8f62 execute_split_functions
../../gcc/gcc/ipa-split.cc:1886
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.

Also ICE on trunk, compiler explorer: https://godbolt.org/z/P4sdPancG

[Bug debug/112878] New: ICE: in ctf_add_slice, at ctfc.cc:499 with -std=c23 -gctf1

2023-12-06 Thread iamanonymous.cs at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112878

Bug ID: 112878
   Summary: ICE: in ctf_add_slice, at ctfc.cc:499 with -std=c23
-gctf1
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: debug
  Assignee: unassigned at gcc dot gnu.org
  Reporter: iamanonymous.cs at gmail dot com
  Target Milestone: ---

***
OS and Platform:
$ uname -a:
Linux ubuntu 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023
x86_64 x86_64 x86_64 GNU/Linux
***
gcc version:
$ gcc -v
Using built-in specs.
COLLECT_GCC=/root/gcc_set/202311291030/bin/gcc
COLLECT_LTO_WRAPPER=/root/gcc_set/202311291030/libexec/gcc/x86_64-pc-linux-gnu/14.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/root/gcc_set/202311291030
--with-gmp=/root/build_essential --with-mpfr=/root/build_essential
--with-mpc=/root/build_essential --enable-languages=c,c++ --disable-multilib
--with-sanitizer=address,undefined,thread,leak
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 14.0.0 20231129 (experimental) (GCC) 

git version: 99fa0bfd63d97825c4221dcd3123940f1d0e6291
***
Program:
$ cat mutant.c
struct {
  _BitInt(282) a : 280;
} b;

***
Command Lines:
$ gcc -std=c23 -gctf1 mutant.c
mutant.c:3:1: internal compiler error: in ctf_add_slice, at ctfc.cc:499
3 | } b;
  | ^
0x8d0e95 ctf_add_slice(ctf_container*, unsigned int, unsigned long, unsigned
int, unsigned int, die_struct*)
../../gcc/gcc/ctfc.cc:499
0xb6a770 gen_ctf_sou_type
../../gcc/gcc/dwarf2ctf.cc:617
0xb69fb7 gen_ctf_type
../../gcc/gcc/dwarf2ctf.cc:892
0xb6aa61 ctf_do_die(die_struct*)
../../gcc/gcc/dwarf2ctf.cc:978
0xbbc62b ctf_debug_do_cu
../../gcc/gcc/dwarf2out.cc:32985
0xbbc62b ctf_debug_do_cu
../../gcc/gcc/dwarf2out.cc:32978
0xbbc62b dwarf2out_early_finish
../../gcc/gcc/dwarf2out.cc:33114
0xb2411f symbol_table::finalize_compilation_unit()
../../gcc/gcc/cgraphunit.cc:2578
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.

Also ICE on trunk, compiler explorer: https://godbolt.org/z/8ozb8MrPr

[Bug debug/112875] New: ICE: in lra_eliminate_regs_1, at lra-eliminations.cc:670 with -Oz -frounding-math -fno-dce -fno-trapping-math -fno-tree-dce -fno-tree-dse -g

2023-12-05 Thread iamanonymous.cs at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112875

Bug ID: 112875
   Summary: ICE: in lra_eliminate_regs_1, at
lra-eliminations.cc:670 with -Oz -frounding-math
-fno-dce -fno-trapping-math -fno-tree-dce
-fno-tree-dse -g
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: debug
  Assignee: unassigned at gcc dot gnu.org
  Reporter: iamanonymous.cs at gmail dot com
  Target Milestone: ---

***
OS and Platform:
$ uname -a:
Linux ubuntu 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023
x86_64 x86_64 x86_64 GNU/Linux
***
gcc version:
$ gcc -v
Using built-in specs.
COLLECT_GCC=/root/gcc_set/202311291030/bin/gcc
COLLECT_LTO_WRAPPER=/root/gcc_set/202311291030/libexec/gcc/x86_64-pc-linux-gnu/14.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/root/gcc_set/202311291030
--with-gmp=/root/build_essential --with-mpfr=/root/build_essential
--with-mpc=/root/build_essential --enable-languages=c,c++ --disable-multilib
--with-sanitizer=address,undefined,thread,leak
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 14.0.0 20231129 (experimental) (GCC) 

git version: 99fa0bfd63d97825c4221dcd3123940f1d0e6291
***
Program:
$ cat mutant.c
long a, f;
int b, c, d, g, h, i, j;
char e;
void k(long, int l, char t) {
  char m = b, n = g, o = 0;
  int p, q, r = h;
  long s = g;
  if (f) {
q = t + (float)16777217;
o = ~0;
  }
  if (e) {
d = g + a;
if (d % (a % l)) {
  p = d;
  n = b;
}
if (l) {
  i = b;
  r = a;
  p = h;
}
if (s)
  s = q;
c = f;
e += t;
a = p;
  }
  j = r % n;
  s += g / 0xc000 + !o;
}

***
Compiler explorer: 
Command Lines:
$ gcc -Oz -frounding-math -fno-dce -fno-trapping-math -fno-tree-dce
-fno-tree-dse -g mutant.c
during RTL pass: reload
mutant.c: In function ‘k’:
mutant.c:31:1: internal compiler error: in lra_eliminate_regs_1, at
lra-eliminations.cc:670
   31 | }
  | ^
0x7bbb24 lra_eliminate_regs_1(rtx_insn*, rtx_def*, machine_mode, bool, bool,
poly_int<1u, long>, bool)
../../gcc/gcc/lra-eliminations.cc:670
0xe38f0e lra_eliminate_regs_1(rtx_insn*, rtx_def*, machine_mode, bool, bool,
poly_int<1u, long>, bool)
../../gcc/gcc/lra-eliminations.cc:446
0xe38c08 lra_eliminate_regs_1(rtx_insn*, rtx_def*, machine_mode, bool, bool,
poly_int<1u, long>, bool)
../../gcc/gcc/lra-eliminations.cc:613
0xe396c4 eliminate_regs_in_insn(rtx_insn*, bool, bool, poly_int<1u, long>)
../../gcc/gcc/lra-eliminations.cc:1046
0xe3a029 process_insn_for_elimination
../../gcc/gcc/lra-eliminations.cc:1375
0xe3a029 lra_eliminate(bool, bool)
../../gcc/gcc/lra-eliminations.cc:1473
0xe1d759 lra(_IO_FILE*)
../../gcc/gcc/lra.cc:2553
0xdd3241 do_reload
../../gcc/gcc/ira.cc:5973
0xdd3241 execute
../../gcc/gcc/ira.cc:6161
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.

Also ICE on trunk, compiler explorer: https://godbolt.org/z/39PEKqEzc

[Bug target/112860] New: ICE: in expand_expr_real_2, at expr.cc:10620 with -O0 -fgimple -mavx512f

2023-12-05 Thread iamanonymous.cs at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112860

Bug ID: 112860
   Summary: ICE: in expand_expr_real_2, at expr.cc:10620 with -O0
-fgimple -mavx512f
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: iamanonymous.cs at gmail dot com
  Target Milestone: ---

***
OS and Platform:
$ uname -a:
Linux ubuntu 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023
x86_64 x86_64 x86_64 GNU/Linux
***
gcc version:
$ gcc -v
Using built-in specs.
COLLECT_GCC=/root/gcc_set/202311291030/bin/gcc
COLLECT_LTO_WRAPPER=/root/gcc_set/202311291030/libexec/gcc/x86_64-pc-linux-gnu/14.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/root/gcc_set/202311291030
--with-gmp=/root/build_essential --with-mpfr=/root/build_essential
--with-mpc=/root/build_essential --enable-languages=c,c++ --disable-multilib
--with-sanitizer=address,undefined,thread,leak
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 14.0.0 20231129 (experimental) (GCC) 

git version: 99fa0bfd63d97825c4221dcd3123940f1d0e6291
***
Program:
$ cat mutant.c
typedef _Bool sbool1 __attribute__((signed_bool_precision(1)));
typedef int v16si __attribute__((vector_size(64)));
typedef v16si v16sim __attribute__((vector_mask));
typedef long v16di __attribute__((vector_size(128)));

void __GIMPLE (ssa,guessed_local(118111600),startwith("slp"))
bar (int * restrict a, int * restrict d, int * restrict e)
{
  int * vectp_14;
  v16si * vectp_e_13;
  v16si vect_iftmp_12;
  v16sim mask__75_11;
  v16sim mask__74_10;
  v16si vect__6_9;
  v16si vect__1_8;
  int * vectp_7;
  v16si * vectp_a_6;
  int _2;
  int _5;
  int _7;
  int _9;
  int _11;
  int _13;
  int _15;
  int _17;
  _Bool _41;
  _Bool _49;
  _Bool _53;
  _Bool _57;
  _Bool _61;
  _Bool _65;
  _Bool _69;
  _Bool _73;
  sbool1 _135;
  sbool1 _136;
  sbool1 _137;
  sbool1 _138;
  sbool1 _139;
  sbool1 _140;
  sbool1 _141;
  sbool1 _142;
  sbool1 _143;
  sbool1 _144;
  sbool1 _145;
  sbool1 _146;
  sbool1 _147;
  sbool1 _148;
  sbool1 _149;
  sbool1 _150;
  v16sim _151;

  __BB(2,guessed_local(105119324)):
  _2 = __MEM  (d_26(D) + _Literal (int * restrict) 32);
  _73 = _2 != 0;
  _5 = __MEM  (d_26(D) + _Literal (int * restrict) 36);
  _69 = _5 != 0;
  _7 = __MEM  (d_26(D));
  _65 = _7 != 0;
  _9 = __MEM  (d_26(D) + _Literal (int * restrict) 4);
  _61 = _9 != 0;
  _11 = __MEM  (d_26(D) + _Literal (int * restrict) 48);
  _57 = _11 != 0;
  _13 = __MEM  (d_26(D) + _Literal (int * restrict) 52);
  _53 = _13 != 0;
  _15 = __MEM  (d_26(D) + _Literal (int * restrict) 16);
  _41 = _15 != 0;
  _17 = __MEM  (d_26(D) + _Literal (int * restrict) 60);
  _49 = _17 != 0;
  _135 = _49 ? _Literal (sbool1) -1 : _Literal (sbool1) 0;
  _136 = _41 ? _Literal (sbool1) -1 : _Literal (sbool1) 0;
  _137 = _53 ? _Literal (sbool1) -1 : _Literal (sbool1) 0;
  _138 = _57 ? _Literal (sbool1) -1 : _Literal (sbool1) 0;
  _139 = _61 ? _Literal (sbool1) -1 : _Literal (sbool1) 0;
  _140 = _65 ? _Literal (sbool1) -1 : _Literal (sbool1) 0;
  _141 = _69 ? _Literal (sbool1) -1 : _Literal (sbool1) 0;
  _142 = _73 ? _Literal (sbool1) -1 : _Literal (sbool1) 0;
  _143 = _73 ? _Literal (sbool1) -1 : _Literal (sbool1) 0;
  _144 = _73 ? _Literal (sbool1) -1 : _Literal (sbool1) 0;
  _145 = _73 ? _Literal (sbool1) -1 : _Literal (sbool1) 0;
  _146 = _73 ? _Literal (sbool1) -1 : _Literal (sbool1) 0;
  _147 = _73 ? _Literal (sbool1) -1 : _Literal (sbool1) 0;
  _148 = _73 ? _Literal (sbool1) -1 : _Literal (sbool1) 0;
  _149 = _73 ? _Literal (sbool1) -1 : _Literal (sbool1) 0;
  _150 = _73 ? _Literal (sbool1) -1 : _Literal (sbool1) 0;
  _151 = _Literal (v16sim) {_150, _149, _148, _147, _146, _145, _144, _143,
_142, _141, _140, _139, _138, _137, _136, _135};
  vect__1_8_154 = __MEM  ((int * restrict)a_22(D));
  vect_iftmp_12_158 = _151 ? vect__6_9_154 : _Literal (v16si) { 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
  __MEM  ((int * restrict)e_23(D)) = vect_iftmp_12_158;
  return;
}

***
Compiler explorer: 
Command Lines:
$ gcc -O0 -fgimple -mavx512f mutant.c
during RTL pass: expand
mutant.c: In function ‘bar’:
mutant.c:7:1: internal compiler error: in expand_expr_real_2, at expr.cc:10620
7 | bar (int * restrict a, int * restrict d, int * restrict e)
  | ^~~
0x773215 expand_expr_real_2(separate_ops*, rtx_def*, machine_mode,
expand_modifier)
../../gcc/gcc/expr.cc:10620
0xaddfc1 expand_gimple_stmt_1
../../gcc/gcc/cfgexpand.cc:3984
0xaddfc1 expand_gimple_stmt

[Bug target/112845] New: ICE: in extract_insn, at recog.cc:2804 with -Os -fcf-protection -c

2023-12-04 Thread iamanonymous.cs at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112845

Bug ID: 112845
   Summary: ICE: in extract_insn, at recog.cc:2804 with -Os
-fcf-protection -c
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: iamanonymous.cs at gmail dot com
  Target Milestone: ---

***
OS and Platform:
$ uname -a:
Linux ubuntu 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023
x86_64 x86_64 x86_64 GNU/Linux
***
gcc version:
$ gcc -v
Using built-in specs.
COLLECT_GCC=/root/gcc_set/202311291030/bin/gcc
COLLECT_LTO_WRAPPER=/root/gcc_set/202311291030/libexec/gcc/x86_64-pc-linux-gnu/14.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/root/gcc_set/202311291030
--with-gmp=/root/build_essential --with-mpfr=/root/build_essential
--with-mpc=/root/build_essential --enable-languages=c,c++ --disable-multilib
--with-sanitizer=address,undefined,thread,leak
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 14.0.0 20231129 (experimental) (GCC) 

git version: 99fa0bfd63d97825c4221dcd3123940f1d0e6291
***
Program:
$ cat mutant.c
#ifdef __x86_64__
#define ENDBR_IMMEDIATE 0xfa1e0ff3
#else
#define ENDBR_IMMEDIATE 0xfb1e0ff3
#endif

int
func (int* p)
{
  return *(p + ENDBR_IMMEDIATE);
}

***
Command Lines:
$ gcc -Os -fcf-protection -c mutant.c
mutant.c: In function ‘func’:
mutant.c:11:1: error: unrecognizable insn:
   11 | }
  | ^
(insn 27 7 28 2 (set (reg:DI 0 ax [101])
(const_int 4196274163 [0xfa1e0ff3])) "mutant.c":10:10 discrim 1 -1
 (nil))
during RTL pass: cprop_hardreg
mutant.c:11:1: internal compiler error: in extract_insn, at recog.cc:2804
0x7e504e _fatal_insn(char const*, rtx_def const*, char const*, int, char
const*)
../../gcc/gcc/rtl-error.cc:108
0x7e506a _fatal_insn_not_found(rtx_def const*, char const*, int, char const*)
../../gcc/gcc/rtl-error.cc:116
0x7e3572 extract_insn(rtx_insn*)
../../gcc/gcc/recog.cc:2804
0xf7209b extract_constrain_insn(rtx_insn*)
../../gcc/gcc/recog.cc:2703
0xf7b182 copyprop_hardreg_forward_1
../../gcc/gcc/regcprop.cc:836
0xf7c389 execute
../../gcc/gcc/regcprop.cc:1423
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See  for instructions.

Also ICE on trunk, compiler explorer: https://godbolt.org/z/d3x5sbG7W

[Bug sanitizer/112741] New: ICE: in gimplify_var_or_parm_decl, at gimplify.cc:3261

2023-11-27 Thread iamanonymous.cs at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112741

Bug ID: 112741
   Summary: ICE: in gimplify_var_or_parm_decl, at gimplify.cc:3261
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: sanitizer
  Assignee: unassigned at gcc dot gnu.org
  Reporter: iamanonymous.cs at gmail dot com
CC: dodji at gcc dot gnu.org, dvyukov at gcc dot gnu.org,
jakub at gcc dot gnu.org, kcc at gcc dot gnu.org, marxin at 
gcc dot gnu.org
  Target Milestone: ---

***
OS and Platform:
$ uname -a:
Linux ubuntu 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023
x86_64 x86_64 x86_64 GNU/Linux
***
gcc version:
$ gcc -v
Using built-in specs.
COLLECT_GCC=/root/gcc_set/202311021000/bin/gcc
COLLECT_LTO_WRAPPER=/root/gcc_set/202311021000/libexec/gcc/x86_64-pc-linux-gnu/14.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/root/gcc_set/202311021000
--with-gmp=/root/build_essential --with-mpfr=/root/build_essential
--with-mpc=/root/build_essential --enable-languages=c,c++ --disable-multilib
--with-sanitizer=address,undefined,thread,leak
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 14.0.0 20231102 (experimental) (GCC)

git version: d508a94167c186b2baacc679896e2809554c0b99
***
Program:
$ cat mutant.c
int __GIMPLE(ssa) foo(int j)
{
  int c[1][10][1];
  int _1;

__BB(2):
  c[0][1][0] = 1;
  c[0][1] = _Literal (int[1]) {};
  _1 = c[0][j_2(D)][0];
  return _1;
}

int main()
{
  if (foo (1) != 0)
__builtin_abort ();
  return 0;
}

***
Command Lines:
$ gcc -fgimple -fsanitize=undefined mutant.c
during GIMPLE pass: ubsan
mutant.c: In function ‘foo’:
mutant.c:9:20: internal compiler error: in gimplify_var_or_parm_decl, at
gimplify.cc:3261
9 |   _1 = c[0][j_2(D)][0];
  |^~~
0x78d031 gimplify_var_or_parm_decl
../../gcc/gcc/gimplify.cc:3261
0xcd5ba0 gimplify_compound_lval
../../gcc/gcc/gimplify.cc:3381
0xccfcd3 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc/gcc/gimplify.cc:16648
0xcd7ef0 gimplify_addr_expr
../../gcc/gcc/gimplify.cc:6788
0xcd0c64 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc/gcc/gimplify.cc:16743
0xcd0316 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc/gcc/gimplify.cc:17001
0xccff17 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc/gcc/gimplify.cc:17482
0xccff17 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc/gcc/gimplify.cc:17482
0xcf598b force_gimple_operand_1(tree_node*, gimple**, bool (*)(tree_node*),
tree_node*)
../../gcc/gcc/gimplify-me.cc:78
0xcf5abf force_gimple_operand_gsi_1(gimple_stmt_iterator*, tree_node*, bool
(*)(tree_node*), tree_node*, bool, gsi_iterator_update)
../../gcc/gcc/gimplify-me.cc:115
0xcf5abf force_gimple_operand_gsi(gimple_stmt_iterator*, tree_node*, bool,
tree_node*, bool, gsi_iterator_update)
../../gcc/gcc/gimplify-me.cc:141
0x1023f9c instrument_object_size
../../gcc/gcc/ubsan.cc:2306
0x1028f15 execute
../../gcc/gcc/ubsan.cc:2500
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See  for instructions.

[Bug c/112720] New: ICE: Segmentation fault during IPA pass: tmipa

2023-11-26 Thread iamanonymous.cs at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112720

Bug ID: 112720
   Summary: ICE: Segmentation fault during IPA pass: tmipa
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: iamanonymous.cs at gmail dot com
  Target Milestone: ---

***
OS and Platform:
$ uname -a:
Linux ubuntu 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023
x86_64 x86_64 x86_64 GNU/Linux
***
gcc version:
$ gcc -v
Using built-in specs.
COLLECT_GCC=/root/gcc_set/202311021000/bin/gcc
COLLECT_LTO_WRAPPER=/root/gcc_set/202311021000/libexec/gcc/x86_64-pc-linux-gnu/14.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/root/gcc_set/202311021000
--with-gmp=/root/build_essential --with-mpfr=/root/build_essential
--with-mpc=/root/build_essential --enable-languages=c,c++ --disable-multilib
--with-sanitizer=address,undefined,thread,leak
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 14.0.0 20231102 (experimental) (GCC)

git version: d508a94167c186b2baacc679896e2809554c0b99
***
Program:
$ cat mutant.c
typedef struct S {
  int * val;
  struct S *next;
} s;

s *next;
int a;

static int func(int * val)
{
  int b;
  int * v;
  __transaction_relaxed {
v = next->val;
b = (v == val);
if (b)
  b = 2;
  }
  return b;
}

void test(void *data)
{
  extern void bark(void);
  if (func(0))
bark();
  a = 99;
}

***
Command Lines:
$ gcc -fgnu-tm -c -fsanitize=undefined mutant.c
during IPA pass: tmipa
mutant.c: In function ‘func’:
mutant.c:29:1: internal compiler error: Segmentation fault
   29 | }
  | ^
0xffebdf crash_signal
../../gcc/gcc/toplev.cc:315
0x1004fd0 is_tm_irrevocable
../../gcc/gcc/trans-mem.cc:237
0x100720e ipa_tm_scan_irr_block
../../gcc/gcc/trans-mem.cc:4396
0x100720e ipa_tm_scan_irr_blocks
../../gcc/gcc/trans-mem.cc:4464
0x1007683 ipa_tm_scan_irr_function
../../gcc/gcc/trans-mem.cc:4643
0x1008ae7 ipa_tm_execute
../../gcc/gcc/trans-mem.cc:5526
0x1008ae7 execute
../../gcc/gcc/trans-mem.cc:5686
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See  for instructions.

[Bug tree-optimization/112709] New: ICE verify_flow_info failed during GIMPLE pass: asan0

2023-11-24 Thread iamanonymous.cs at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112709

Bug ID: 112709
   Summary: ICE verify_flow_info failed during GIMPLE pass: asan0
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: iamanonymous.cs at gmail dot com
  Target Milestone: ---

***
OS and Platform:
$ uname -a:
Linux ubuntu 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023
x86_64 x86_64 x86_64 GNU/Linux
***
gcc version:
$ gcc -v
Using built-in specs.
COLLECT_GCC=/root/gcc_set/202311021000/bin/gcc
COLLECT_LTO_WRAPPER=/root/gcc_set/202311021000/libexec/gcc/x86_64-pc-linux-gnu/14.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/root/gcc_set/202311021000
--with-gmp=/root/build_essential --with-mpfr=/root/build_essential
--with-mpc=/root/build_essential --enable-languages=c,c++ --disable-multilib
--with-sanitizer=address,undefined,thread,leak
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 14.0.0 20231102 (experimental) (GCC)

git version: d508a94167c186b2baacc679896e2809554c0b99
***
Program:
$ cat mutant.c
struct S { char c[1024]; };
void func(void);
struct S s(void) __attribute__((returns_twice));
struct S *p;

void func1(void)
{
  func();
  *p = s();
}

***
Command Lines:
$ gcc -fsanitize=address -c mutant.c
mutant.c: In function ‘func1’:
mutant.c:6:6: error: returns_twice call is not first in basic block 4
6 | void func1(void)
  |  ^
*p.0_1(ab) = s ();
during GIMPLE pass: asan0
mutant.c:6:6: internal compiler error: verify_flow_info failed
0xad0a0e verify_flow_info()
../../gcc/gcc/cfghooks.cc:287
0xed36d7 execute_function_todo
../../gcc/gcc/passes.cc:2100
0xed3c0e execute_todo
../../gcc/gcc/passes.cc:2142
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See  for instructions.

[Bug target/112695] New: ICE: in gen_reg_rtx, at emit-rtl.cc:1208 with -fsanitize=address -c

2023-11-23 Thread iamanonymous.cs at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112695

Bug ID: 112695
   Summary: ICE: in gen_reg_rtx, at emit-rtl.cc:1208 with
-fsanitize=address -c
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: iamanonymous.cs at gmail dot com
  Target Milestone: ---

***
OS and Platform:
$ uname -a:
Linux ubuntu 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023
x86_64 x86_64 x86_64 GNU/Linux
***
gcc version:
$ gcc -v
Using built-in specs.
COLLECT_GCC=/root/gcc_set/202311021000/bin/gcc
COLLECT_LTO_WRAPPER=/root/gcc_set/202311021000/libexec/gcc/x86_64-pc-linux-gnu/14.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/root/gcc_set/202311021000
--with-gmp=/root/build_essential --with-mpfr=/root/build_essential
--with-mpc=/root/build_essential --enable-languages=c,c++ --disable-multilib
--with-sanitizer=address,undefined,thread,leak
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 14.0.0 20231102 (experimental) (GCC)

git version: d508a94167c186b2baacc679896e2809554c0b99
***
Program:
$ cat prog.c
_BitInt(33) b33_v;

***
Command Lines:
$ gcc -fsanitize=address -c mutant.c
mutant.c:1:1: internal compiler error: in gen_reg_rtx, at emit-rtl.cc:1208
1 | _BitInt(33) b33_v;
  | ^~~
0x7658cf gen_reg_rtx(machine_mode)
../../gcc/gcc/emit-rtl.cc:1208
0xe9398d maybe_legitimize_operand
../../gcc/gcc/optabs.cc:8044
0xe9398d maybe_legitimize_operands(insn_code, unsigned int, unsigned int,
expand_operand*)
../../gcc/gcc/optabs.cc:8199
0xe8ff69 maybe_gen_insn(insn_code, unsigned int, expand_operand*)
../../gcc/gcc/optabs.cc:8218
0xe99068 expand_binop_directly
../../gcc/gcc/optabs.cc:1457
0xe97460 expand_binop(machine_mode, optab_tag, rtx_def*, rtx_def*, rtx_def*,
int, optab_methods)
../../gcc/gcc/optabs.cc:1544
0xbd0f6d expand_shift_1
../../gcc/gcc/expmed.cc:2675
0xbd5359 expand_shift(tree_code, machine_mode, rtx_def*, poly_int<1u, long>,
rtx_def*, int)
../../gcc/gcc/expmed.cc:2701
0xbfb376 reduce_to_bit_field_precision
../../gcc/gcc/expr.cc:12252
0xbf200f expand_expr_real_1(tree_node*, rtx_def*, machine_mode,
expand_modifier, rtx_def**, bool)
../../gcc/gcc/expr.cc:11005
0xbfb85e expand_expr(tree_node*, rtx_def*, machine_mode, expand_modifier)
../../gcc/gcc/expr.h:310
0xbfb85e expand_expr_addr_expr_1
../../gcc/gcc/expr.cc:8728
0xbfbed7 expand_expr_addr_expr
../../gcc/gcc/expr.cc:8849
0xbf08ff expand_expr_real_1(tree_node*, rtx_def*, machine_mode,
expand_modifier, rtx_def**, bool)
../../gcc/gcc/expr.cc:12163
0x13876bb expand_expr(tree_node*, rtx_def*, machine_mode, expand_modifier)
../../gcc/gcc/expr.h:310
0x13876bb output_constant
../../gcc/gcc/varasm.cc:5261
0x13863d2 output_constructor_regular_field
../../gcc/gcc/varasm.cc:5612
0x13863d2 output_constructor
../../gcc/gcc/varasm.cc:5878
0x13863d2 output_constructor_regular_field
../../gcc/gcc/varasm.cc:5612
0x13863d2 output_constructor
../../gcc/gcc/varasm.cc:5878
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See  for instructions.

[Bug c/112638] New: ICE: in add_dwarf_attr, at dwarf2out.cc:4501

2023-11-20 Thread iamanonymous.cs at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112638

Bug ID: 112638
   Summary: ICE: in add_dwarf_attr, at dwarf2out.cc:4501
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: iamanonymous.cs at gmail dot com
  Target Milestone: ---

***
OS and Platform:
$ uname -a:
Linux ubuntu 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023
x86_64 x86_64 x86_64 GNU/Linux
***
gcc version:
$ gcc -v
Using built-in specs.
COLLECT_GCC=/root/gcc_set/202311021000/bin/gcc
COLLECT_LTO_WRAPPER=/root/gcc_set/202311021000/libexec/gcc/x86_64-pc-linux-gnu/14.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/root/gcc_set/202311021000
--with-gmp=/root/build_essential --with-mpfr=/root/build_essential
--with-mpc=/root/build_essential --enable-languages=c,c++ --disable-multilib
--with-sanitizer=address,undefined,thread,leak
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 14.0.0 20231102 (experimental) (GCC)

git version: d508a94167c186b2baacc679896e2809554c0b99
***
Program:
$ cat prog.c
__seg_gs int var;

static int
*foo (void)
{
  int *addr;

  asm ("lea %p1, %0" : "=r"(addr) : "m"(var));

  return addr;
}

static int
bar (int *addr)
{
  int val;

  asm ("mov %%gs:%1, %0" : "=r"(val) : "m"(*addr));

  return val;
}

int
baz (void)
{
  int *addr = foo();
  int val = bar (addr);

  return val;
}
***
Command Lines:
$ gcc -S -O2 -gdwarf-4 prog.c
prog.c:5:1: internal compiler error: in add_dwarf_attr, at dwarf2out.cc:4501
5 | __seg_gs int var;
  | ^~~~
0x75d190 add_dwarf_attr
../../gcc/gcc/dwarf2out.cc:4501
0x75e79c add_dwarf_attr
../../gcc/gcc/vec.h:715
0x75e79c add_AT_string
../../gcc/gcc/dwarf2out.cc:4773
0x75e79c add_name_attribute(die_struct*, char const*)
../../gcc/gcc/dwarf2out.cc:21237
0x75e79c add_name_attribute(die_struct*, char const*)
../../gcc/gcc/dwarf2out.cc:21230
0xb8bfd9 modified_type_die
../../gcc/gcc/dwarf2out.cc:14028
0xb8d396 add_type_attribute
../../gcc/gcc/dwarf2out.cc:22361
0xb9ffda gen_variable_die
../../gcc/gcc/dwarf2out.cc:24678
0xb86188 gen_decl_die
../../gcc/gcc/dwarf2out.cc:27159
0xb876bb dwarf2out_decl
../../gcc/gcc/dwarf2out.cc:27652
0xb87a1c dwarf2out_early_global_decl
../../gcc/gcc/dwarf2out.cc:27299
0x95dc88 finish_decl(tree_node*, unsigned int, tree_node*, tree_node*,
tree_node*)
../../gcc/gcc/c/c-decl.cc:5833
0x9c5ba2 c_parser_declaration_or_fndef
../../gcc/gcc/c/c-parser.cc:2743
0x9d0cfb c_parser_external_declaration
../../gcc/gcc/c/c-parser.cc:1997
0x9d16d5 c_parser_translation_unit
../../gcc/gcc/c/c-parser.cc:1851
0x9d16d5 c_parse_file()
../../gcc/gcc/c/c-parser.cc:25462
0xa43e01 c_common_parse_file()
../../gcc/gcc/c-family/c-opts.cc:1278
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See  for instructions.

[Bug debug/112582] Inconsistent Variable Values: Discrepancy between Source-Level and Instruction-Level Debugging

2023-11-20 Thread iamanonymous.cs at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112582

--- Comment #6 from Anonymous  ---
(In reply to Sam James from comment #5)
> (IIRC = if I recall correctly)

Ah, that explains why my search for "IIRC GCC" on Google didn't yield any
relevant results. Thank you for pointing that out. 

[Bug debug/112582] Inconsistent Variable Values: Discrepancy between Source-Level and Instruction-Level Debugging

2023-11-20 Thread iamanonymous.cs at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112582

--- Comment #4 from Anonymous  ---
(In reply to Richard Biener from comment #3)
> I think that's deficiencies in the debugger, IIRC GCC is providing some
> extra info here that it doesn't (yet) evaluate.

Thanks, Richard. I will take a look on the IIRC GCC.

[Bug debug/112582] Inconsistent Variable Values: Discrepancy between Source-Level and Instruction-Level Debugging

2023-11-20 Thread iamanonymous.cs at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112582

--- Comment #2 from Anonymous  ---
(In reply to Andrew Pinski from comment #1)
> .cfi_def_cfa_offset 32
> .loc 1 27 5 view .LVU27
> movl$-5, %eax
> .loc 1 28 5 view .LVU28
> movl$-10, %edx
> .loc 1 29 3 view .LVU29 // point where after `si`'s is located
> leaq14(%rsp), %rsi
> leaq12(%rsp), %rdi
> .loc 1 27 5 view .LVU30
> movw%ax, 12(%rsp)
> .loc 1 28 3 is_stmt 1 view .LVU31
> .loc 1 28 5 is_stmt 0 view .LVU32
> movw%dx, 14(%rsp)
> .loc 1 29 3 is_stmt 1 view .LVU33 // point where step is 
> callfoo
> ...
>.ascii "x\0"# DW_AT_name
> # DW_AT_decl_file (1, /app/example.c)
> # DW_AT_decl_line (0x1a)
> .byte   0x16  # DW_AT_decl_column
> .long   0x9e  # DW_AT_type
> .uleb128 0x2# DW_AT_location
> .byte   0x91  # DW_OP_fbreg
> .sleb128 -20
> .uleb128 0x3# (DIE (0x78) DW_TAG_variable)
> .ascii "y\0"# DW_AT_name
> # DW_AT_decl_file (1, /app/example.c)
> # DW_AT_decl_line (0x1a)
> .byte   0x19  # DW_AT_decl_column
> .long   0x9e  # DW_AT_type
> .uleb128 0x2# DW_AT_location
> .byte   0x91  # DW_OP_fbreg
> .sleb128 -18
> 
> Not a bug.

Thank you, Andrew, for your response. I have concerns regarding the information
provided by the debugger, as it may be somewhat misleading. Although the
debugger indicates that lines 27 and 28 have been executed, a closer
examination reveals that the assigned values of the x and y variables do not
align with expected results. From the user's perspective, it appears that lines
27 and 28 have indeed been executed, yet the variable values remain unchanged.
Therefore, I was wondering whether there are any guarantees from the compiler
or debugger.

[Bug c/112605] New: ICE: in gen_reg_rtx, at emit-rtl.cc:1176

2023-11-18 Thread iamanonymous.cs at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112605

Bug ID: 112605
   Summary: ICE: in gen_reg_rtx, at emit-rtl.cc:1176
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: iamanonymous.cs at gmail dot com
  Target Milestone: ---

***
OS and Platform:
$ uname -a:
Linux ubuntu 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023
x86_64 x86_64 x86_64 GNU/Linux
***
gcc version:
$ gcc -v
Using built-in specs.
COLLECT_GCC=/root/gcc_set/202311021000/bin/gcc
COLLECT_LTO_WRAPPER=/root/gcc_set/202311021000/libexec/gcc/x86_64-pc-linux-gnu/14.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/root/gcc_set/202311021000
--with-gmp=/root/build_essential --with-mpfr=/root/build_essential
--with-mpc=/root/build_essential --enable-languages=c,c++ --disable-multilib
--with-sanitizer=address,undefined,thread,leak
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 14.0.0 20231102 (experimental) (GCC)

git version: d508a94167c186b2baacc679896e2809554c0b99
***
Program:
$ cat prog.c
int x;
int y;

void __attribute__((noinline)) f1(void)
{
x++;
}

static __attribute__((noinline)) void f3(void)
{
y++;
}

void f2()
{
f1();
f3();
f1();
}
***
Command Lines:
$ gcc -c -O2 -mforce-indirect-call -fsplit-stack prog.c
during RTL pass: pro_and_epilogue
prog.c: In function ‘f3’:
prog.c:16:1: internal compiler error: in gen_reg_rtx, at emit-rtl.cc:1176
   16 | }
  | ^
0x7658e3 gen_reg_rtx(machine_mode)
../../gcc/gcc/emit-rtl.cc:1176
0xbcc1ae copy_to_mode_reg(machine_mode, rtx_def*)
../../gcc/gcc/explow.cc:650
0x14c9538 ix86_expand_call(rtx_def*, rtx_def*, rtx_def*, rtx_def*, rtx_def*,
bool)
../../gcc/gcc/config/i386/i386-expand.cc:9707
0x13d7702 ix86_expand_split_stack_prologue()
../../gcc/gcc/config/i386/i386.cc:10486
0x18fe57a gen_split_stack_prologue()
../../gcc/gcc/config/i386/i386.md:18094
0x13bea25 target_gen_split_stack_prologue
../../gcc/gcc/config/i386/i386.md:17849
0xc62e0a make_split_prologue_seq
../../gcc/gcc/function.cc:5785
0xc62e0a make_split_prologue_seq
../../gcc/gcc/function.cc:5778
0xc6301a thread_prologue_and_epilogue_insns()
../../gcc/gcc/function.cc:6039
0xc63752 rest_of_handle_thread_prologue_and_epilogue
../../gcc/gcc/function.cc:6543
0xc63752 execute
../../gcc/gcc/function.cc:6624
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See  for instructions.

[Bug debug/112582] New: Inconsistent Variable Values: Discrepancy between Source-Level and Instruction-Level Debugging

2023-11-16 Thread iamanonymous.cs at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112582

Bug ID: 112582
   Summary: Inconsistent Variable Values: Discrepancy between
Source-Level and Instruction-Level Debugging
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: debug
  Assignee: unassigned at gcc dot gnu.org
  Reporter: iamanonymous.cs at gmail dot com
  Target Milestone: ---


As shows in the following, we can observed that the values of variables x and y
exhibit inconsistencies between source-level debugging and instruction-level
debugging prior to entering the function foo. I'm not sure whether the
inconsistency is a result of code optimization.



## source-level debugging ##
$ gcc -O2 -g small.c
root@ubuntu:~# gdb -q a.out
Reading symbols from a.out...
(gdb) b main
Breakpoint 1 at 0x401060: file small.c, line 30.
(gdb) r
Starting program: /root/a.out 

Breakpoint 1, main () at small.c:30
30x = -5;
(gdb) s
31y = -10;
(gdb) s
32foo (, );
(gdb) info locals
x = 65531
y = 65526
(gdb) 


## instruction-level debugging ##
$ gcc -O2 -g small.c; gdb -q a.out
Reading symbols from a.out...
(gdb) b main
Breakpoint 1 at 0x401060: file small.c, line 27.
(gdb) r
Starting program: /root/a.out 

Breakpoint 1, main () at small.c:27
27x = -5;
(gdb) si
0x00401064  27x = -5;
(gdb) info locals
x = 0
y = 0
(gdb) si
0x00401069  28y = -10;
(gdb) info locals
x = 0
y = 0
(gdb) si
0x0040106e  29foo (, );
(gdb) info locals
x = 0
y = 0
(gdb) 




## bug-triggering code ##

$ cat small.c
extern void abort (void);
extern void exit (int);

__attribute__ ((noinline)) void
foo(short unsigned int *p1, short unsigned int *p2)
{
  short unsigned int x1, x4;
  int x2, x3, x5, x6;
  unsigned int x7;

  x1 = *p1;
  x2 = (int) x1;
  x3 = x2 * 65536;
  x4 = *p2;
  x5 = (int) x4;
  x6 = x3 + x4;
  x7 = (unsigned int) x6;
  if (x7 <= 268435455U)
abort ();
  exit (0);
}

int
main()
{
  short unsigned int x, y;
  x = -5;
  y = -10;
  foo (, );
}



## gcc and gdb version ##
$ gcc --version
gcc (GCC) 14.0.0 20231116 (experimental)
Copyright (C) 2023 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ gdb --version
GNU gdb (GDB) 15.0.50.20231116-git
Copyright (C) 2023 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later 
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

[Bug debug/112565] Abnormal Jump in Execution using 'stepi' Command in GDB under O2 optimization

2023-11-16 Thread iamanonymous.cs at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112565

--- Comment #5 from Anonymous  ---
(In reply to Richard Biener from comment #4)
> GCC can interleave instructions belonging to different source lines so
> that's what you see.  Since you advance assembler instructions I don't see a
> way to
> "improve" things here when optimizing.

Got it. Thanks.

[Bug debug/112565] Abnormal Jump in Execution using 'stepi' Command in GDB under O2 optimization

2023-11-16 Thread iamanonymous.cs at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112565

--- Comment #3 from Anonymous  ---
However, I still feel that the current debugging process be somewhat
misleading, and I am uncertain if there are any approaches to enhance the
overall debugging experience.

[Bug debug/112565] Abnormal Jump in Execution using 'stepi' Command in GDB under O2 optimization

2023-11-16 Thread iamanonymous.cs at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112565

--- Comment #2 from Anonymous  ---
(In reply to Tom de Vries from comment #1)
> (In reply to Anonymous from comment #0)
> > Tom de Vries suggests that this issue may be attributed to a GCC
> > optimization bug.
> 
> I do not.

Thanks for the correction. I apologize for the misunderstanding. I didn't
notice that you mentioned this behavior was expected.

[Bug debug/112565] New: Abnormal Jump in Execution using 'stepi' Command in GDB under O2 optimization

2023-11-16 Thread iamanonymous.cs at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112565

Bug ID: 112565
   Summary: Abnormal Jump in Execution using 'stepi' Command in
GDB under O2 optimization
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: debug
  Assignee: unassigned at gcc dot gnu.org
  Reporter: iamanonymous.cs at gmail dot com
  Target Milestone: ---

Bug reported initially reported:
https://sourceware.org/bugzilla/show_bug.cgi?id=31070

Tom de Vries suggests that this issue may be attributed to a GCC optimization
bug.


$ cat small.c
int glob_int_arr[100];
int *glob_ptr_int = glob_int_arr;

void simple_global ()
{
  __builtin_prefetch (glob_int_arr, 0, 0);
  __builtin_prefetch (glob_ptr_int, 0, 0);
}

int main()
{
  simple_global ();
  exit (0);
}


$ gcc -w -O2 -g small.c; gdb -q a.out
Reading symbols from a.out...
(gdb) b main
Breakpoint 1 at 0x401040: file small.c, line 6.
(gdb) r
Starting program: /root/devil/a.out 

Breakpoint 1, main () at small.c:6
6 __builtin_prefetch (glob_int_arr, 0, 0);
(gdb) si
0x00401044 in simple_global () at small.c:7
7 __builtin_prefetch (glob_ptr_int, 0, 0);
(gdb) si
0x0040104b in main () at small.c:13
13exit (0);
(gdb) si
0x0040104d in simple_global () at small.c:6
6 __builtin_prefetch (glob_int_arr, 0, 0);
(gdb)


=
When using the 'stepi' command in GDB, an abnormal jump in the execution occurs
when reaching line 7 of the code. The execution unexpectedly jumps to line 13.


$ gcc --version
gcc (GCC) 14.0.0 20231116 (experimental)
Copyright (C) 2023 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ gdb --version
GNU gdb (GDB) 15.0.50.20231116-git
Copyright (C) 2023 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later 
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

[Bug tree-optimization/111738] incorrect code when PGO is enabled

2023-10-09 Thread iamanonymous.cs at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111738

--- Comment #3 from Anonymous  ---
(In reply to Richard Biener from comment #1)
> I can't reproduce.  Your git version is quite old, it translates to
> r14-2634-g85da0b40538fb0 for me.  It doesn't reproduce with r14-2282 either
> though.
> 
> Current is r14-4486-g873586ebc565b6

Hi, Richard. According to your suggestion, we have updated our gcc to the
latest trunk as:
$ gcc -v
Using built-in specs.
COLLECT_GCC=/root/gcc_set/202310092007/bin/gcc
COLLECT_LTO_WRAPPER=/root/gcc_set/202310092007/libexec/gcc/x86_64-pc-linux-gnu/14.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/root/gcc_set/202310092007
--with-gmp=/root/build_essential --with-mpfr=/root/build_essential
--with-mpc=/root/build_essential --enable-languages=c,c++ --disable-multilib
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 14.0.0 20231009 (experimental) (GCC)

git version: dee55cf59ceea989f47e7605205c6644b27a1f78


Then, we compiled the same test program with/without PGO enabled and found that
the results are inconsistent as:
$ gcc -O3 -w -fprofile-generate=profile a.c -o a.out
$ ./a.out
4
$ gcc -O3 -w -fprofile-use=profile -Wno-missing-profile -fprofile-correction
a.c -o a.out
$ ./a.out
32765

[Bug tree-optimization/111738] incorrect code when PGO is enabled

2023-10-09 Thread iamanonymous.cs at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111738

--- Comment #2 from Anonymous  ---
(In reply to Richard Biener from comment #1)
> I can't reproduce.  Your git version is quite old, it translates to
> r14-2634-g85da0b40538fb0 for me.  It doesn't reproduce with r14-2282 either
> though.
> 
> Current is r14-4486-g873586ebc565b6

Thank you very much for providing the feedback. To ensure the later reported
bugs can be reproduced, we will update our GCC version to the latest trunk.

[Bug tree-optimization/111739] incorrect code with PGO enabled

2023-10-09 Thread iamanonymous.cs at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111739

--- Comment #2 from Anonymous  ---
(In reply to Richard Biener from comment #1)
> Confirmed with r14-4302 and also with the head of the GCC 13 branch.
> 
> It helps if you can produce proper ISO C without implicit int and like.

Thank you for confirming the bug. Moving forward, we will ensure that the code
does not rely on implicit integer types.

[Bug tree-optimization/111739] New: incorrect code with PGO enabled

2023-10-09 Thread iamanonymous.cs at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111739

Bug ID: 111739
   Summary: incorrect code with PGO enabled
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: iamanonymous.cs at gmail dot com
  Target Milestone: ---

***
OS and Platform:
$ uname -a:
Linux ubuntu 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023
x86_64 x86_64 x86_64 GNU/Linux
***
gcc version:
$ gcc -v
Using built-in specs.
COLLECT_GCC=/root/gcc_set/new_gcc/bin/gcc
COLLECT_LTO_WRAPPER=/root/gcc_set/new_gcc/libexec/gcc/x86_64-pc-linux-gnu/14.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/root/gcc_set/new_gcc
--with-gmp=/root/build_essential --with-mpfr=/root/build_essential
--with-mpc=/root/build_essential --enable-languages=c,c++ --disable-multilib
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 14.0.0 20230719 (experimental) (GCC)

git version:85da0b40538fb0d17d89de1e7905984668e3dfef
***
Program:
$ cat a.c
c, d, e, a;
union {
  int f;
  short g
} h;
*j = 
k(short l, short m) { return m == 0 || l && m == 1 ?: l / m; }
n(l) { return c == 0 ?: l / c; }
main() {
  a = n(h.f++);
  *j = 0;
  int i = 0;
  for (; i < 2; i++)
d = k(h.g || 0, 59376);
  short *b = 
  *b ^= e;
  printf("%d\n", h);
}

***
Command Lines:
# The profile directory is used to save profile information.
$ gcc -O3 -w -fprofile-generate=profile a.c -o a.out
$ ./a.out
0
$ gcc -O3 -w -fprofile-use=profile -Wno-missing-profile -fprofile-correction
a.c  
 -o a.out
$ ./a.out
1

We can found that, the output of the executable is incorrect when the profile
guided optimization is enabled.

[Bug tree-optimization/111738] New: incorrect code when PGO is enabled

2023-10-09 Thread iamanonymous.cs at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111738

Bug ID: 111738
   Summary: incorrect code when PGO is enabled
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: tree-optimization
  Assignee: unassigned at gcc dot gnu.org
  Reporter: iamanonymous.cs at gmail dot com
  Target Milestone: ---

***
OS and Platform:
$ uname -a:
Linux ubuntu 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023
x86_64 x86_64 x86_64 GNU/Linux
***
gcc version:
$ gcc -v
Using built-in specs.
COLLECT_GCC=/root/gcc_set/new_gcc/bin/gcc
COLLECT_LTO_WRAPPER=/root/gcc_set/new_gcc/libexec/gcc/x86_64-pc-linux-gnu/14.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/root/gcc_set/new_gcc
--with-gmp=/root/build_essential --with-mpfr=/root/build_essential
--with-mpc=/root/build_essential --enable-languages=c,c++ --disable-multilib
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 14.0.0 20230719 (experimental) (GCC)

git version:85da0b40538fb0d17d89de1e7905984668e3dfef
***
Program:
$ cat a.c
a = 4, b = 0, d = 0, e = 0, f = 0;
**c = 
*g = 
h() {
  i();
  if (f)
e = 0;
}
i() {
  float j = 0;
  int **k = 
  *k = 
  *g |= **c;
  if (*g)
;
  else {
long *l = d = (*l)++;
  }
}
main() {
  h();
  printf("%d\n", a);
}
***
Command Lines:
# The profile directory is used to save profile information.
$ gcc -O3 -w -fprofile-generate=profile a.c -o a.out
$ ./a.out
4
$ gcc -O3 -w -fprofile-use=profile -Wno-missing-profile -fprofile-correction
a.c  
 -o a.out
$ ./a.out
32764

We can found that, the output of the executable is incorrect when the profile
guided optimization is enabled.

[Bug c/111059] New: ICE: in gimplify_expr, at gimplify.cc:17253

2023-08-18 Thread iamanonymous.cs at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111059

Bug ID: 111059
   Summary: ICE: in gimplify_expr, at gimplify.cc:17253
   Product: gcc
   Version: 14.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: iamanonymous.cs at gmail dot com
  Target Milestone: ---

Created attachment 55752
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=55752=edit
The program.c mentioned in description.

***
OS and Platform:
$ uname -a:
Linux ubuntu 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023
x86_64 x86_64 x86_64 GNU/Linux
***
gcc version:
$ gcc -v
Using built-in specs.
COLLECT_GCC=/root/gcc_set/new_gcc/bin/gcc
COLLECT_LTO_WRAPPER=/root/gcc_set/new_gcc/libexec/gcc/x86_64-pc-linux-gnu/14.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/root/gcc_set/new_gcc
--with-gmp=/root/build_essential --with-mpfr=/root/build_essential
--with-mpc=/root/build_essential --enable-languages=c,c++ --disable-multilib
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 14.0.0 20230719 (experimental) (GCC)

git version:85da0b40538fb0d17d89de1e7905984668e3dfef
***
Program:
The program was attached as program.c
***
Command Lines:
$ gcc program.c -o program
program.c: In function ‘test’:
program.c:188:176: warning: left shift count is negative
[-Wshift-count-negative]
  188 | arr_33 [i_0] [i_1] [i_2] = ((/*
implicit */_Bool) /* implicit */_Bool) (short)1139)) ? ~(((/* implicit
*/int) (unsigned short)9080 << (((/* implicit */int) (signed char)-23 :
(-1376368525)));
  |
   
   ^~
program.c:188:176: internal compiler error: in gimplify_expr, at
gimplify.cc:17253
0x7773da gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc/gcc/gimplify.cc:17253
0xc84dba gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc/gcc/gimplify.cc:17223
0xc97dc7 gimplify_modify_expr
../../gcc/gcc/gimplify.cc:6173
0xc84fa6 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc/gcc/gimplify.cc:16441
0xc87a16 gimplify_stmt(tree_node**, gimple**)
../../gcc/gcc/gimplify.cc:7246
0xc86380 gimplify_statement_list
../../gcc/gcc/gimplify.cc:2019
0xc86380 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc/gcc/gimplify.cc:16886
0xc87a16 gimplify_stmt(tree_node**, gimple**)
../../gcc/gcc/gimplify.cc:7246
0xc96ad9 gimplify_cond_expr
../../gcc/gcc/gimplify.cc:4562
0xc8575c gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc/gcc/gimplify.cc:16398
0xc87a16 gimplify_stmt(tree_node**, gimple**)
../../gcc/gcc/gimplify.cc:7246
0xc86380 gimplify_statement_list
../../gcc/gcc/gimplify.cc:2019
0xc86380 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc/gcc/gimplify.cc:16886
0xc87a16 gimplify_stmt(tree_node**, gimple**)
../../gcc/gcc/gimplify.cc:7246
0xc86380 gimplify_statement_list
../../gcc/gcc/gimplify.cc:2019
0xc86380 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc/gcc/gimplify.cc:16886
0xc87a16 gimplify_stmt(tree_node**, gimple**)
../../gcc/gcc/gimplify.cc:7246
0xc88146 gimplify_bind_expr
../../gcc/gcc/gimplify.cc:1430
0xc8525e gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc/gcc/gimplify.cc:16642
0xc87a16 gimplify_stmt(tree_node**, gimple**)
../../gcc/gcc/gimplify.cc:7246
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.