[Bug c++/108613] [12/13 Regression] GCC12 internal compiler error on __int128_t in type_traits header

2023-02-01 Thread mserdarsanli at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108613

--- Comment #6 from Serdar Sanli  ---
> Where did you get this from? The  header uses signed __int128 
> here, not signed __int128_t.

Just checked and __GLIBCXX_TYPE_INT_N_0 is also __int128 for me. int128_t seem
to come from somewhere else, in my case it is in cuda compiler generated code.

Sorry for not being clear and wasting time, snippet I copied was only intended
as a repro, not as a bug report on stdlibc++.

[Bug c++/108613] New: GCC12 internal compiler error on __int128_t in type_traits header

2023-01-31 Thread mserdarsanli at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108613

Bug ID: 108613
   Summary: GCC12 internal compiler error on __int128_t in
type_traits header
   Product: gcc
   Version: 12.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: mserdarsanli at gmail dot com
  Target Milestone: ---

https://godbolt.org/z/M1o34e6cx

Below code crashes GCC versions starting with GCC 12. It is only stuff from std
library headers, I've copied bits from preprocessed output.



template< class > struct remove_cv;
template< class _Tp> using __remove_cv_t = typename remove_cv< _Tp> ::type;

template< class _Tp, _Tp __v>
struct integral_constant {
static constexpr inline _Tp value = (__v);
typedef _Tp value_type;
typedef integral_constant type;
constexpr operator value_type() const noexcept { return value; }
constexpr value_type operator()() const noexcept { return value; }
};

using false_type = integral_constant< bool, false> ;

template< class ...> struct __or_;

template<> struct __or_< > : public false_type {};


template< class , class > struct is_same;

template< class _Tp, class ..._Types> using __is_one_of = __or_< is_same< _Tp,
_Types> ...> ;

template< class _Tp> using __is_signed_integer = __is_one_of< _Tp , 
signed char, signed short, signed int, signed long, signed long long,
signed __int128_t> ;


---
Stacktrace:

0xe2534f crash_signal
/root/source/gcc-12.2.0/gcc/toplev.cc:322
0x7c0535 grokdeclarator(cp_declarator const*, cp_decl_specifier_seq*,
decl_context, int, tree_node**)
/root/source/gcc-12.2.0/gcc/cp/decl.cc:12373
0x7c73fc groktypename(cp_decl_specifier_seq*, cp_declarator const*, bool)
/root/source/gcc-12.2.0/gcc/cp/decl.cc:5514
0x8797d5 cp_parser_type_id_1
/root/source/gcc-12.2.0/gcc/cp/parser.cc:24250
0x87c4f3 cp_parser_template_type_arg
/root/source/gcc-12.2.0/gcc/cp/parser.cc:24272
0x87c659 cp_parser_template_argument
/root/source/gcc-12.2.0/gcc/cp/parser.cc:18803
0x87c659 cp_parser_template_argument_list
/root/source/gcc-12.2.0/gcc/cp/parser.cc:18727
0x87c659 cp_parser_enclosed_template_argument_list
/root/source/gcc-12.2.0/gcc/cp/parser.cc:32059
0x87da7f cp_parser_template_id
/root/source/gcc-12.2.0/gcc/cp/parser.cc:18266
0x87e239 cp_parser_class_name
/root/source/gcc-12.2.0/gcc/cp/parser.cc:25713
0x875d8e cp_parser_qualifying_entity
/root/source/gcc-12.2.0/gcc/cp/parser.cc:7116
0x875d8e cp_parser_nested_name_specifier_opt
/root/source/gcc-12.2.0/gcc/cp/parser.cc:6798
0x88cf6c cp_parser_simple_type_specifier
/root/source/gcc-12.2.0/gcc/cp/parser.cc:19765
0x86aea5 cp_parser_type_specifier
/root/source/gcc-12.2.0/gcc/cp/parser.cc:19424
0x87b3d0 cp_parser_type_specifier_seq
/root/source/gcc-12.2.0/gcc/cp/parser.cc:24364
0x879744 cp_parser_type_id_1
/root/source/gcc-12.2.0/gcc/cp/parser.cc:24164
0x87c117 cp_parser_type_id
/root/source/gcc-12.2.0/gcc/cp/parser.cc:24260
0x87c117 cp_parser_alias_declaration
/root/source/gcc-12.2.0/gcc/cp/parser.cc:21778
0x897f37 cp_parser_template_declaration_after_parameters
/root/source/gcc-12.2.0/gcc/cp/parser.cc:31316
0x89827a cp_parser_explicit_template_declaration
/root/source/gcc-12.2.0/gcc/cp/parser.cc:31598

[Bug c++/108597] internal compiler error with -Wduplicated-cond

2023-01-30 Thread mserdarsanli at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108597

--- Comment #1 from Serdar Sanli  ---
stacktrace from my gcc 12.2.0:

0xe2534f crash_signal
/root/source/gcc-12.2.0/gcc/toplev.cc:322
0xb0f049 location_wrapper_p(tree_node const*)
/root/source/gcc-12.2.0/gcc/tree.h:4160
0xb0f049 tree_strip_any_location_wrapper(tree_node*)
/root/source/gcc-12.2.0/gcc/tree.h:4172
0xb0f049 operand_compare::operand_equal_p(tree_node const*, tree_node const*,
unsigned int)
/root/source/gcc-12.2.0/gcc/fold-const.cc:2987
0xb100fb operand_compare::operand_equal_p(tree_node const*, tree_node const*,
unsigned int)
/root/source/gcc-12.2.0/gcc/fold-const.cc:3363 
   
   0xb0f3f1
operand_compare::operand_equal_p(tree_node const*, tree_node const*, unsigned
int)
/root/source/gcc-12.2.0/gcc/fold-const.cc:3227 
   
   0x9a6f07
warn_duplicated_cond_add_or_warn(unsigned int, tree_node*, vec**)
/root/source/gcc-12.2.0/gcc/c-family/c-warn.cc:2537
0x894e18 cp_parser_selection_statement
/root/source/gcc-12.2.0/gcc/cp/parser.cc:13108 
   
   0x86f5d5 cp_parser_statement
/root/source/gcc-12.2.0/gcc/cp/parser.cc:12296 
   
   0x893fe1
cp_parser_implicitly_scoped_statement
/root/source/gcc-12.2.0/gcc/cp/parser.cc:14423
0x895239 cp_parser_selection_statement
/root/source/gcc-12.2.0/gcc/cp/parser.cc:13186
0x86f5d5 cp_parser_statement
/root/source/gcc-12.2.0/gcc/cp/parser.cc:12296
0x87016d cp_parser_statement_seq_opt
/root/source/gcc-12.2.0/gcc/cp/parser.cc:12850
0x87021f cp_parser_compound_statement
/root/source/gcc-12.2.0/gcc/cp/parser.cc:12802
0x88ec73 cp_parser_function_body
/root/source/gcc-12.2.0/gcc/cp/parser.cc:25071
0x88ec73 cp_parser_ctor_initializer_opt_and_function_body
/root/source/gcc-12.2.0/gcc/cp/parser.cc:25122
0x88fdbe cp_parser_function_definition_after_declarator
/root/source/gcc-12.2.0/gcc/cp/parser.cc:31257
0x8900e3 cp_parser_late_parsing_for_member
/root/source/gcc-12.2.0/gcc/cp/parser.cc:32189
0x86a06e cp_parser_class_specifier_1
/root/source/gcc-12.2.0/gcc/cp/parser.cc:26190
0x86af46 cp_parser_class_specifier
/root/source/gcc-12.2.0/gcc/cp/parser.cc:26214

[Bug c++/108597] New: internal compiler error with -Wduplicated-cond

2023-01-30 Thread mserdarsanli at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108597

Bug ID: 108597
   Summary: internal compiler error with -Wduplicated-cond
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: mserdarsanli at gmail dot com
  Target Milestone: ---

https://godbolt.org/z/Kdvd5hzYK

compile below with -Wduplicated-cond and it will crash

template 
struct MyStruct {

void check(int ) {
if ( == &_a) {
} else if ( == &_b) {
}
}

int _a;
int _b;
};

[Bug c++/108587] New: `decltype(x) x;` in struct declaration causes "changes meaning of" error

2023-01-28 Thread mserdarsanli at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108587

Bug ID: 108587
   Summary: `decltype(x) x;` in struct declaration causes "changes
meaning of" error
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: mserdarsanli at gmail dot com
  Target Milestone: ---

Godbolt link: https://godbolt.org/z/rjEGPKcE7


void fine() {
int x;

struct {
int x;
} v = {
.x = x,
};
}

void not_fine() {
int x;

struct {
decltype(x) x; // error: declaration of 'int not_fine()x' changes meaning of 'x' [-fpermissive]
} v = {
.x = x,
};
}

[Bug middle-end/54202] Overeager warning about freeing non-heap objects

2021-06-16 Thread mserdarsanli at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54202

Serdar Sanli  changed:

   What|Removed |Added

 CC||mserdarsanli at gmail dot com

--- Comment #9 from Serdar Sanli  ---
A simpler example not involving any globals, causing Wfree-nonheap-object
warning since GCC11
https://godbolt.org/z/MYn1zrjE4

===
struct Foo {
void allocate(int n);
void deallocate();

int *_data;
};

void Foo::allocate(int n) {
_data = new int[n] - 1;
}

void Foo::deallocate() {
delete[] (_data+1);
}