[Bug middle-end/98715] ICE in make_decl_rtl with double variable length array (VLA)

2021-01-17 Thread alserkli at inbox dot ru via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98715

--- Comment #2 from Alexander Klimov  ---
Clang does not think that the code is valid:

error: variable-sized object may not be initialized

[Bug c/98715] New: ICE in make_decl_rtl, at varasm.c

2021-01-17 Thread alserkli at inbox dot ru via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98715

Bug ID: 98715
   Summary: ICE in make_decl_rtl, at varasm.c
   Product: gcc
   Version: 11.0
   URL: https://godbolt.org/z/z763xG
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: alserkli at inbox dot ru
  Target Milestone: ---

<https://godbolt.org/z/z763xG>:

void f(int n) {
int a[n][n] = {{}};
}

gives on trunk (also gcc 4.9.0, but not 4.8.5):

during RTL pass: expand
: In function 'void f(int)':
:2:22: internal compiler error: in make_decl_rtl, at varasm.c:1427
2 | int a[n][n] = {{}};
  |  ^
0x1cd4199 internal_error(char const*, ...)
???:0
0x6b4a01 fancy_abort(char const*, int, char const*)
???:0
0x13d7265 make_decl_rtl(tree_node*)
???:0
0xc42451 expand_expr_real_1(tree_node*, rtx_def*, machine_mode,
expand_modifier, rtx_def**, bool)
???:0
0xc41a1e expand_expr_real_1(tree_node*, rtx_def*, machine_mode,
expand_modifier, rtx_def**, bool)
???:0
0xc4f0d1 store_expr(tree_node*, rtx_def*, int, bool, bool)
???:0

[Bug c++/66490] New: [6 Regression] ICE verify_type failed for -g at tree.c:13450 (TYPE_CANONICAL is not compatible)

2015-06-10 Thread alserkli at inbox dot ru
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66490

Bug ID: 66490
   Summary: [6 Regression] ICE verify_type failed for -g at
tree.c:13450 (TYPE_CANONICAL is not compatible)
   Product: gcc
   Version: 6.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: alserkli at inbox dot ru
  Target Milestone: ---

Created attachment 35741
  -- https://gcc.gnu.org/bugzilla/attachment.cgi?id=35741action=edit
from root/core/meta/src/TClingCallFunc.cxx (commit e1ef990 in
root.cern.ch/git/root.git)

g++ (GCC) 6.0.0 20150610 (experimental)

$ g++ -std=c++11 -g -c a.ii

a.ii: In instantiation of 'class std::vectorllvm::GenericValue':
a.ii:156269:29:   required from here
a.ii:8693:11: error: TYPE_CANONICAL is not compatible
 class vector : protected _Vector_base_Tp, _Alloc
   ^
 record_type 0x7fb755369b28 GenericValue readonly type_5 type_6 VOID
align 8 symtab 1348798416 alias set -1 canonical type 0x7fb755369b28
context namespace_decl 0x7fb764622c78 llvm
full-name const struct llvm::GenericValue
n_parents=0 use_template=0 interface-unknown
pointer_to_this pointer_type 0x7fb754f5adc8 reference_to_this
reference_type 0x7fb755369c78
 record_type 0x7fb75506eb28 value_type readonly used type_5 type_6 VOID
align 8 symtab 1348956800 alias set -1 canonical type 0x7fb755369b28
fields field_decl 0x7fb754bc9e40 IntVal
type record_type 0x7fb769453690 APInt addressable asm_written
needs-constructing type_1 type_4 type_5 type_6 BLK
size integer_cst 0x7fb76a628ea0 constant 128
unit size integer_cst 0x7fb76a628eb8 constant 16
align 64 symtab 1684254464 alias set -1 canonical type
0x7fb769453690 fields field_decl 0x7fb76077b2f8 BitWidth context
namespace_decl 0x7fb764622c78 llvm
full-name class llvm::APInt
needs-constructor needs-destructor X() X(constX) this=(X)
sorted-fields 0x7fb76164d958 n_parents=0 use_template=0 interface-unknown
pointer_to_this pointer_type 0x7fb76077db28 reference_to_this
reference_type 0x7fb7693d3a80 chain type_decl 0x7fb7643ffab0 APInt
decl_3 VOID file a.ii line 156268 col 9
align 1 offset_align 1 context record_type 0x7fb762977690
GenericValue
chain field_decl 0x7fb754bc9980 D.707620 type union_type
0x7fb754f57930 ._295
VOID file a.ii line 156261 col 3
align 1 offset_align 1 context record_type 0x7fb762977690
GenericValue chain type_decl 0x7fb754bb2720 GenericValue context
namespace_decl 0x7fb764622c78 llvm
full-name const value_type
n_parents=0 use_template=0 interface-unknown reference_to_this
reference_type 0x7fb75506ebd0
a.ii:8693:11: internal compiler error: verify_type failed
0xf5e2f4 verify_type(tree_node const*)
/gcc/gcc/tree.c:13450
0x962a74 gen_type_die_with_usage
/gcc/gcc/dwarf2out.c:20653
0x9631b5 gen_type_die_with_usage
/gcc/gcc/dwarf2out.c:20751
0x966057 gen_formal_types_die
/gcc/gcc/dwarf2out.c:18198
0x95d4a7 gen_subprogram_die
/gcc/gcc/dwarf2out.c:19055
0x96173a gen_decl_die
/gcc/gcc/dwarf2out.c:21402
0x9605fa gen_member_die
/gcc/gcc/dwarf2out.c:20345
0x9605fa gen_struct_or_union_type_die
/gcc/gcc/dwarf2out.c:20429
0x9605fa gen_tagged_type_die
/gcc/gcc/dwarf2out.c:20630
0x963545 gen_type_die_with_usage
/gcc/gcc/dwarf2out.c:20792
0x96146e gen_decl_die
/gcc/gcc/dwarf2out.c:21425
0x96228c dwarf2out_decl
/gcc/gcc/dwarf2out.c:21875
0x96260b dwarf2out_type_decl
/gcc/gcc/dwarf2out.c:21585
0xc0544f rest_of_type_compilation(tree_node*, int)
/gcc/gcc/passes.c:351
0x697cf3 finish_struct_1(tree_node*)
/gcc/gcc/cp/class.c:6714
0x66974f instantiate_class_template_1
/gcc/gcc/cp/pt.c:9625
0x66974f instantiate_class_template(tree_node*)
/gcc/gcc/cp/pt.c:9665
0x704ceb complete_type(tree_node*)
/gcc/gcc/cp/typeck.c:140
0x609b6b grokdeclarator(cp_declarator const*, cp_decl_specifier_seq*,
decl_context, int, tree_node**)
/gcc/gcc/cp/decl.c:10790
0x6a9cd6 grokfield(cp_declarator const*, cp_decl_specifier_seq*, tree_node*,
bool, tree_node*, tree_node*)
/gcc/gcc/cp/decl2.c:879

compiles OK without -g


[Bug c++/65390] ICE in strip_typedefs, at cp/tree.c:1361

2015-03-16 Thread alserkli at inbox dot ru
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65390

--- Comment #3 from Alexander Klimov alserkli at inbox dot ru ---
(In reply to Marek Polacek from comment #2)
 Might be a dup of PR63584.

PR63584 does not produce ICE in 5.0


[Bug c++/65390] New: ICE in strip_typedefs, at cp/tree.c:1361

2015-03-11 Thread alserkli at inbox dot ru
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65390

Bug ID: 65390
   Summary: ICE in strip_typedefs, at cp/tree.c:1361
   Product: gcc
   Version: 5.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: alserkli at inbox dot ru

Created attachment 35013
  -- https://gcc.gnu.org/bugzilla/attachment.cgi?id=35013action=edit
preprocessed source

g++ (GCC) 5.0.0 20150311 (experimental)

=== e.cc ===
#include memory
auto f(int n){
  return std::make_sharedint[n]();
}
===

$ g++ -std=c++14 e.cc
In file included from /opt/include/c++/5.0.0/memory:82:0,
 from e.cc:1:
/opt/include/c++/5.0.0/bits/shared_ptr.h: In substitution of 'templateclass
_Tp, class ... _Args std::shared_ptr_Tp1 std::make_shared(_Args ...) [with
_Tp = int [n]; _Args = {}]':
e.cc:3:35:   required from here
/opt/include/c++/5.0.0/bits/shared_ptr.h:626:5: internal compiler error: in
strip_typedefs, at cp/tree.c:1361
 make_shared(_Args... __args)
 ^
0x7bbc4d strip_typedefs(tree_node*)
/gcc/gcc/cp/tree.c:1361
0x6534d2 canonicalize_type_argument
/gcc/gcc/cp/pt.c:6500
0x67f7fa coerce_template_parms
/gcc/gcc/cp/pt.c:7171
0x681789 lookup_template_class_1
/gcc/gcc/cp/pt.c:7780
0x681789 lookup_template_class(tree_node*, tree_node*, tree_node*, tree_node*,
int, int)
/gcc/gcc/cp/pt.c:8096
0x684cd8 tsubst_aggr_type
/gcc/gcc/cp/pt.c:10460
0x67704b tsubst(tree_node*, tree_node*, int, tree_node*)
/gcc/gcc/cp/pt.c:11909
0x68bc6f tsubst_function_type
/gcc/gcc/cp/pt.c:11624
0x677186 tsubst(tree_node*, tree_node*, int, tree_node*)
/gcc/gcc/cp/pt.c:12357
0x6a219d fn_type_unification(tree_node*, tree_node*, tree_node*, tree_node*
const*, unsigned int, tree_node*, unification_kind_t, int, bool, bool)
/gcc/gcc/cp/pt.c:16259
0x615479 add_template_candidate_real
/gcc/gcc/cp/call.c:3057
0x615f0c add_template_candidate
/gcc/gcc/cp/call.c:3154
0x615f0c add_candidates
/gcc/gcc/cp/call.c:5285
0x6163d3 perform_overload_resolution
/gcc/gcc/cp/call.c:4003
0x6188ca build_new_function_call(tree_node*, vectree_node*, va_gc,
vl_embed**, bool, int)
/gcc/gcc/cp/call.c:4080
0x7907d1 finish_call_expr(tree_node*, vectree_node*, va_gc, vl_embed**, bool,
bool, int)
/gcc/gcc/cp/semantics.c:2407
0x7147e1 cp_parser_postfix_expression
/gcc/gcc/cp/parser.c:6368
0x71c349 cp_parser_unary_expression
/gcc/gcc/cp/parser.c:7438
0x71d047 cp_parser_binary_expression
/gcc/gcc/cp/parser.c:8172
0x71d87f cp_parser_assignment_expression
/gcc/gcc/cp/parser.c:8430


[Bug tree-optimization/64823] [5 Regression] false may be used uninitialized, missed jump threading

2015-02-17 Thread alserkli at inbox dot ru
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64823

Alexander Klimov alserkli at inbox dot ru changed:

   What|Removed |Added

 Status|RESOLVED|VERIFIED

--- Comment #11 from Alexander Klimov alserkli at inbox dot ru ---
GDB can now be build with GCC 5.0.0 20150217 even if the GDB patch is undone:

--- a/gdb/symfile.c
+++ b/gdb/symfile.c
@@ -3441,7 +3441,7 @@ static void
 unmap_overlay_command (char *args, int from_tty)
 {
   struct objfile *objfile;
-  struct obj_section *sec = NULL;
+  struct obj_section *sec;

   if (!overlay_debugging)
 error (_(Overlay debugging not enabled.  


[Bug ipa/64978] [5 Regression] ICE: in ipcp_verify_propagated_values, at ipa-cp.c:1060

2015-02-09 Thread alserkli at inbox dot ru
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64978

Alexander Klimov alserkli at inbox dot ru changed:

   What|Removed |Added

 CC||alserkli at inbox dot ru

--- Comment #4 from Alexander Klimov alserkli at inbox dot ru ---
Created attachment 34703
  -- https://gcc.gnu.org/bugzilla/attachment.cgi?id=34703action=edit
gzipped source code that gives same ICE

The same ICE trace

0x127f05a ipcp_verify_propagated_values()
/gcc/gcc/ipa-cp.c:1060
0x1280b92 ipcp_propagate_stage
/gcc/gcc/ipa-cp.c:2761
0x1280b92 ipcp_driver
/gcc/gcc/ipa-cp.c:4410
0x1280b92 execute
/gcc/gcc/ipa-cp.c:4505

during compilation of root with g++ (GCC) 5.0.0 20150209

$ g++ -O2 -std=c++11 -c VTableBuilder.ii
/root/interpreter/llvm/src/tools/clang/lib/AST/VTableBuilder.cpp:3491:1:
internal compiler error: in ipcp_verify_propagated_values, at ipa-cp.c:1060

This does not give an ICE on GCC 20150120.


[Bug preprocessor/64803] [5 Regression] __LINE__ inside macro is not constant

2015-01-29 Thread alserkli at inbox dot ru
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64803

--- Comment #4 from Alexander Klimov alserkli at inbox dot ru ---
Thanks! Your patch works for llvm.


[Bug c/64823] New: [5.0 Regression] false may be used uninitialized

2015-01-27 Thread alserkli at inbox dot ru
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64823

Bug ID: 64823
   Summary: [5.0 Regression] false may be used uninitialized
   Product: gcc
   Version: 5.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: alserkli at inbox dot ru

Compilation of (GDB) 7.9.50.20150127-cvs with (GCC) 5.0.0 20150127 fails due to
false warning (gdb is compiled with -Werror). It was not a problem in GCC
4.7.2.

// a.c: simplified from the expansion of ALL_OBJSECTIONS in
gdb/gdb/symfile.c:unmap_overlay_command
struct os { struct o *o; };
struct o { struct o *next; struct os *se; };
void f(struct o *o){
  struct os *s;
  if(o) s = o-se;
  while(o  s == o-se){
s++; // here `o' is non-zero and thus s is initialized
s == o-se  // `?' is essential, `if' does not trigger the warning
  ? (o = o-next, o ? s = o-se : 0)
  : 0;
  }
}

$ gcc -O2 -Wall -Werror -c a.c
a.c: In function ā€˜fā€™:
a.c:8:6: error: ā€˜sā€™ may be used uninitialized in this function
[-Werror=maybe-uninitialized]
 s++; // here `o' is non-zero and thus s is initialized
  ^
cc1: all warnings being treated as errors

[Bug c/64803] New: __LINE__ inside macro is not constant

2015-01-26 Thread alserkli at inbox dot ru
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64803

Bug ID: 64803
   Summary: __LINE__ inside macro is not constant
   Product: gcc
   Version: 5.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: alserkli at inbox dot ru

The following code (simplified from
EXPECT_DEATH(VariantValue(VariantMatcher::SingleMatcher(varDecl())) in
llvm/tools/clang/unittests/ASTMatchers/Dynamic/VariantValueTest.cpp:149)

#define C(a, b) a ## b
#define L(x) C(L, x)
#define M(a) goto L(__LINE__); __LINE__; L(__LINE__):
M(a
  );

produces (gcc -E; 5.0.0 20150126)

 goto L5; 5; L4:

In gcc-4.7 the result was (after '#' lines removal)

 goto L5 ; 5 ; L5 :   ;


[Bug c++/46056] [C++0x] range-based for loop does not destruct iterators

2010-10-20 Thread alserkli at inbox dot ru
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46056

Alexander Klimov alserkli at inbox dot ru changed:

   What|Removed |Added

  Attachment #22086|0   |1
is obsolete||

--- Comment #9 from Alexander Klimov alserkli at inbox dot ru 2010-10-20 
14:19:23 UTC ---
Created attachment 22094
  -- http://gcc.gnu.org/bugzilla/attachment.cgi?id=22094
simple testcase

Your patch seems to work, thanks!

Btw, the original simple testcase did not contain

  It(const It){ ++it_counter; }

and thus would fail (It() is called twice, while ~It() -- thrice).


[Bug c++/46056] [C++0x] range-based for loop inside lambda crashes if _GLIBCXX_DEBUG is defined

2010-10-19 Thread alserkli at inbox dot ru
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46056

--- Comment #2 from Alexander Klimov alserkli at inbox dot ru 2010-10-19 
18:22:11 UTC ---
Created attachment 22086
  -- http://gcc.gnu.org/bugzilla/attachment.cgi?id=22086
simple testcase


[Bug c++/46056] [C++0x] range-based for loop does not destruct iterators

2010-10-19 Thread alserkli at inbox dot ru
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46056

Alexander Klimov alserkli at inbox dot ru changed:

   What|Removed |Added

Summary|[C++0x] range-based for |[C++0x] range-based for
   |loop inside lambda crashes  |loop does not destruct
   |if _GLIBCXX_DEBUG is|iterators
   |defined |

--- Comment #3 from Alexander Klimov alserkli at inbox dot ru 2010-10-19 
18:24:27 UTC ---
Apparently it has nothing to do with _GLIBCXX_DEBUG or lambda. Turns out
range-based for loop does not call destructor for iterator and thus
v._M_iterators is not null. 

See attachment for a direct testcase.


[Bug c++/46056] New: range-based for loop inside lambda crashes if _GLIBCXX_DEBUG is defined

2010-10-17 Thread alserkli at inbox dot ru
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46056

   Summary: range-based for loop inside lambda crashes if
_GLIBCXX_DEBUG is defined
   Product: gcc
   Version: 4.6.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
AssignedTo: unassig...@gcc.gnu.org
ReportedBy: alser...@inbox.ru
Target: i686-pc-linux-gnu


The following test crashes once compiled by
g++ (GCC) 4.6.0 20101017 (experimental) on i686-pc-linux-gnu

// Test for range-based for loop inside lambda
// { dg-options -std=c++0x }
// { dg-do run }
#define _GLIBCXX_DEBUG
#include iostream
#include vector
int main(){
  std::vectorint v(1);
  []() { for(auto i: v); }();
}

Apparently it crashes during safe sequence destruction once main is finished.
It does work (i.e., does not crash) without any one of _GLIBCXX_DEBUG, lambda,
or range-based for. Also, it does not crash if optimization is on (e.g., with
-O).