[Bug c/109412] New: [13 Regression] ICE in fold_convert_loc, at fold-const.cc:2627

2023-04-04 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109412

Bug ID: 109412
   Summary: [13 Regression] ICE in fold_convert_loc, at
fold-const.cc:2627
   Product: gcc
   Version: 13.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gs...@t-online.de
  Target Milestone: ---

Started between 20220821 and 20220828 :
(derived from c-c++-common/ubsan/bounds-21.c)


$ cat z1.c
int i;
int foo (void) { return ++i; }
int
main ()
{
  char a() = {};
  a[foo ()] = a[foo()] | 'a';
  if (i != 2)
__builtin_abort ();
  a[foo()] |= 'a';
  if (i != 3)
__builtin_abort ();
}


$ gcc-13-20230402 -c z1.c
z1.c: In function 'main':
z1.c:6:3: error: function 'a' is initialized like a variable
6 |   char a() = {};
  |   ^~~~
z1.c:6:3: internal compiler error: in fold_convert_loc, at fold-const.cc:2627
0xa76ede fold_convert_loc(unsigned int, tree_node*, tree_node*)
../../gcc/fold-const.cc:2627
0x7741de pop_init_level(unsigned int, int, obstack*, unsigned int)
../../gcc/c/c-typeck.cc:9382
0x7a7f8e c_parser_braced_init
../../gcc/c/c-parser.cc:5775
0x7a9651 c_parser_initializer
../../gcc/c/c-parser.cc:5675
0x7c3ec8 c_parser_declaration_or_fndef
../../gcc/c/c-parser.cc:2564
0x7c293b c_parser_compound_statement_nostart
../../gcc/c/c-parser.cc:6208
0x7c2d83 c_parser_compound_statement
../../gcc/c/c-parser.cc:6105
0x7c4d7f c_parser_declaration_or_fndef
../../gcc/c/c-parser.cc:2841
0x7cf0af c_parser_external_declaration
../../gcc/c/c-parser.cc:1925
0x7cf9ed c_parser_translation_unit
../../gcc/c/c-parser.cc:1779
0x7cf9ed c_parse_file()
../../gcc/c/c-parser.cc:24632
0x84a4e1 c_common_parse_file()
../../gcc/c-family/c-opts.cc:1248

[Bug c/109410] New: [13 Regression] ICE: verify_flow_info failed

2023-04-04 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109410

Bug ID: 109410
   Summary: [13 Regression] ICE: verify_flow_info failed
   Product: gcc
   Version: 13.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gs...@t-online.de
  Target Milestone: ---

Started between 20220717 and 20220724, at -O1+ :
(testcase derived from pr108783.c)
(gcc configured with --enable-checking=yes)


$ cat z1.c
__attribute__((returns_twice)) int baz (int, int);
int
bar (int x)
{
  return x;
}
int
foo (int x, int y)
{
  int a;
  a = bar (x);
  baz (x, y);
  return y && a && a;
}
int
qux (int x, int y)
{
  int a;
  a = bar (x);
  baz (x, y);
  return y && a != 42 && a >= 42;
}
int
corge (int x, int y)
{
  int a;
  baz (x, y);
  a = bar (x);
  return y || a == 42 || a > 42;
}


$ gcc-13-20230402 -c z1.c -O2
z1.c: In function 'corge':
z1.c:24:1: error: returns_twice call is not first in basic block 2
   24 | corge (int x, int y)
  | ^
baz (x_7(D), y_8(D));
during GIMPLE pass: reassoc
z1.c:24:1: internal compiler error: verify_flow_info failed
0x8eeb6f verify_flow_info()
../../gcc/cfghooks.cc:285
0xd58ce6 execute_function_todo
../../gcc/passes.cc:2110
0xd59742 execute_todo
../../gcc/passes.cc:2152

[Bug c/109409] New: [13 Regression] ICE in check_format_arg, at c-family/c-format.cc:1777

2023-04-04 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109409

Bug ID: 109409
   Summary: [13 Regression] ICE in check_format_arg, at
c-family/c-format.cc:1777
   Product: gcc
   Version: 13.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gs...@t-online.de
  Target Milestone: ---

Started between 20220821 and 20220828, with -Wall :


$ cat z1.c
int g ();
void f (char *a)
{
  const char c[g()] = "1";
  __builtin_sprintf (a, c);
}


$ gcc-13-20230402 -c z1.c -Wall
z1.c: In function 'f':
z1.c:4:23: error: variable-sized object may not be initialized except with an
empty initializer
4 |   const char c[g()] = "1";
  |   ^~~
z1.c:5:3: internal compiler error: in check_format_arg, at
c-family/c-format.cc:1777
5 |   __builtin_sprintf (a, c);
  |   ^
0x83216a check_format_arg
../../gcc/c-family/c-format.cc:1777
0x82d680 check_format_info
../../gcc/c-family/c-format.cc:1543
0x82d680 check_function_format(tree_node const*, tree_node*, int, tree_node**,
vec*)
../../gcc/c-family/c-format.cc:1198
0x81a3e5 check_function_arguments(unsigned int, tree_node const*, tree_node
const*, int, tree_node**, vec*)
../../gcc/c-family/c-common.cc:6093
0x775e4d build_function_call_vec(unsigned int, vec, tree_node*, vec*, vec*, tree_node*)
../../gcc/c/c-typeck.cc:3309
0x7a6d01 c_parser_postfix_expression_after_primary
../../gcc/c/c-parser.cc:11239
0x79461d c_parser_postfix_expression
../../gcc/c/c-parser.cc:10846
0x7a17ba c_parser_unary_expression
../../gcc/c/c-parser.cc:8831
0x7a2b1f c_parser_cast_expression
../../gcc/c/c-parser.cc:8672
0x7a2e1b c_parser_binary_expression
../../gcc/c/c-parser.cc:8440
0x7a44eb c_parser_conditional_expression
../../gcc/c/c-parser.cc:8138
0x7a4d74 c_parser_expr_no_commas
../../gcc/c/c-parser.cc:8052
0x7a5022 c_parser_expression
../../gcc/c/c-parser.cc:11379
0x7a57db c_parser_expression_conv
../../gcc/c/c-parser.cc:11419
0x7c01f3 c_parser_statement_after_labels
../../gcc/c/c-parser.cc:6781
0x7c24db c_parser_compound_statement_nostart
../../gcc/c/c-parser.cc:6296
0x7c2d83 c_parser_compound_statement
../../gcc/c/c-parser.cc:6105
0x7c4d7f c_parser_declaration_or_fndef
../../gcc/c/c-parser.cc:2841
0x7cf0af c_parser_external_declaration
../../gcc/c/c-parser.cc:1925
0x7cf9ed c_parser_translation_unit
../../gcc/c/c-parser.cc:1779

[Bug c/109408] New: [13 Regression] ICE in decide_about_value, at ipa-cp.cc:6154

2023-04-04 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109408

Bug ID: 109408
   Summary: [13 Regression] ICE in decide_about_value, at
ipa-cp.cc:6154
   Product: gcc
   Version: 13.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gs...@t-online.de
  Target Milestone: ---

Started between 20230205 and 20230212, at -O3+ :
(testcase derived from pr108605.c)
(gcc configured with --enable-checking=yes)


$ cat z1.c
struct S {
  int a, b, c;
  int d[__INT_MAX__], e;
};
void
foo (struct S *s)
{
  if (s->b && s->c != 0)
__builtin_abort ();
}
void
bar (void)
{
  struct S s[2];
  s[0].a = 0;
  s[0].e = 0;
  foo (s);
}


$ gcc-13-20230402 -c z1.c -O3
during IPA pass: cp
z1.c:18:1: internal compiler error: in decide_about_value, at ipa-cp.cc:6154
   18 | }
  | ^
0x1d5590f decide_about_value
../../gcc/ipa-cp.cc:6153
0x1d55be9 decide_whether_version_node
../../gcc/ipa-cp.cc:6248
0x1d5926b ipcp_decision_stage
../../gcc/ipa-cp.cc:6430
0x1d5926b ipcp_driver
../../gcc/ipa-cp.cc:6618

[Bug c/109392] New: [12/13 Regression] ICE in tree_vec_extract, at tree-vect-generic.cc:177

2023-04-03 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109392

Bug ID: 109392
   Summary: [12/13 Regression] ICE in tree_vec_extract, at
tree-vect-generic.cc:177
   Product: gcc
   Version: 13.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gs...@t-online.de
  Target Milestone: ---

Started with r12 before 20210502 :


$ cat z1.c
typedef short __attribute__ ((__vector_size__ (64))) V;
V v, w;
inline V foo (V a, V b);
V
foo (V a, V b)
{
  vfork();
  b &= v < b;
  return (V){foo (b, w)[3], (V){}[3]};
}


$ gcc-13-20230402 -c z1.c
z1.c: In function 'foo':
z1.c:6:1: warning: AVX512F vector return without AVX512F enabled changes the
ABI [-Wpsabi]
6 | {
  | ^
z1.c:7:3: warning: implicit declaration of function 'vfork'
[-Wimplicit-function-declaration]
7 |   vfork();
  |   ^
z1.c:5:1: note: the ABI for passing parameters with 64-byte alignment has
changed in GCC 4.6
5 | foo (V a, V b)
  | ^~~
during GIMPLE pass: veclower
z1.c:5:1: internal compiler error: in tree_vec_extract, at
tree-vect-generic.cc:177
0x111bdd6 tree_vec_extract(gimple_stmt_iterator*, tree_node*, tree_node*,
tree_node*, tree_node*)
../../gcc/tree-vect-generic.cc:177
0x111f8fb expand_vector_condition
../../gcc/tree-vect-generic.cc:1140
0x6cac8d expand_vector_comparison
../../gcc/tree-vect-generic.cc:453
0x11229c1 expand_vector_operation
../../gcc/tree-vect-generic.cc:1239
0x11229c1 expand_vector_operations_1
../../gcc/tree-vect-generic.cc:2357
0x11229c1 expand_vector_operations
../../gcc/tree-vect-generic.cc:2391
0x11229c1 execute
../../gcc/tree-vect-generic.cc:2445

[Bug c++/109321] New: [13 Regression] ICE in iterative_hash_template_arg, at cp/pt.cc:1727

2023-03-28 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109321

Bug ID: 109321
   Summary: [13 Regression] ICE in iterative_hash_template_arg, at
cp/pt.cc:1727
   Product: gcc
   Version: 13.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gs...@t-online.de
  Target Milestone: ---

Started between 20230226 and 20230312, with -std=c++20 or -std=c++23 :


$ cat z1.cc
struct A;
template struct B;
template using D = B;
void f () { D() = 0; }


$ g++-13-20230326 -c z1.cc -std=c++23
z1.cc: In substitution of 'template B()-> B requires 
__is_deducible (D, B) [with C = A]':
z1.cc:4:15:   required from here
z1.cc:4:15: internal compiler error: Segmentation fault
4 | void f () { D() = 0; }
  |   ^
0xe24a1f crash_signal
../../gcc/toplev.cc:314
0x88209c iterative_hash_template_arg(tree_node*, unsigned int)
../../gcc/cp/pt.cc:1727
0x762f71 sat_hasher::hash(sat_entry*)
../../gcc/cp/constraint.cc:2572
0x762f71 hash_table::find_slot(sat_entry*
const&, insert_option)
../../gcc/hash-table.h:435
0x762f71 satisfaction_cache::satisfaction_cache(tree_node*, tree_node*,
sat_info)
../../gcc/cp/constraint.cc:2668
0x765a71 satisfy_atom
../../gcc/cp/constraint.cc:2998
0x765a71 satisfy_constraint_r
../../gcc/cp/constraint.cc:3106
0x7665f3 satisfy_normalized_constraints
../../gcc/cp/constraint.cc:3131
0x7641da satisfy_declaration_constraints
../../gcc/cp/constraint.cc:3352
0x7641da constraint_satisfaction_value
../../gcc/cp/constraint.cc:3373
0x7a constraints_satisfied_p(tree_node*, tree_node*)
../../gcc/cp/constraint.cc:3410
0x8afef5 fn_type_unification(tree_node*, tree_node*, tree_node*, tree_node*
const*, unsigned int, tree_node*, unification_kind_t, int, conversion**, bool,
bool)
../../gcc/cp/pt.cc:22534
0x7251cb add_template_candidate_real
../../gcc/cp/call.cc:3594
0x725e83 add_template_candidate
../../gcc/cp/call.cc:3688
0x725e83 add_candidates
../../gcc/cp/call.cc:6596
0x72d101 add_candidates
../../gcc/cp/call.cc:4911
0x72d101 perform_overload_resolution
../../gcc/cp/call.cc:4911
0x72d4e9 perform_dguide_overload_resolution(tree_node*, vec const*, int)
../../gcc/cp/call.cc:4976
0x88e581 do_class_deduction
../../gcc/cp/pt.cc:30590
0x88e581 do_auto_deduction(tree_node*, tree_node*, tree_node*, int,
auto_deduction_context, tree_node*, int)
../../gcc/cp/pt.cc:30715

[Bug c++/109320] New: [13 Regression] ICE in coerce_template_parameter_pack, at cp/pt.cc:8795

2023-03-28 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109320

Bug ID: 109320
   Summary: [13 Regression] ICE in coerce_template_parameter_pack,
at cp/pt.cc:8795
   Product: gcc
   Version: 13.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gs...@t-online.de
  Target Milestone: ---

Started between 20230226 and 20230312, with -std=c++20 or -std=c++23 :


$ cat z1.cc
template
struct S {};
template
using u = S;
struct X {};
X a = u {};


$ g++-13-20230326 -c z1.cc -std=c++23
z1.cc:6:10: internal compiler error: Segmentation fault
6 | X a = u {};
  |  ^
0xe24a1f crash_signal
../../gcc/toplev.cc:314
0x8a3de1 coerce_template_parameter_pack
../../gcc/cp/pt.cc:8795
0x8a3de1 coerce_template_parms(tree_node*, tree_node*, tree_node*, int, bool)
../../gcc/cp/pt.cc:9067
0x8b10fd type_targs_deducible_from(tree_node*, tree_node*)
../../gcc/cp/pt.cc:30278
0x8b12b8 alias_ctad_tweaks
../../gcc/cp/pt.cc:30224
0x88d434 deduction_guides_for
../../gcc/cp/pt.cc:30375
0x88dae5 do_class_deduction
../../gcc/cp/pt.cc:30522
0x88dae5 do_auto_deduction(tree_node*, tree_node*, tree_node*, int,
auto_deduction_context, tree_node*, int)
../../gcc/cp/pt.cc:30715
0x8c2f20 finish_compound_literal(tree_node*, tree_node*, int, fcl_t)
../../gcc/cp/semantics.cc:3213
0x845d1c cp_parser_functional_cast
../../gcc/cp/parser.cc:32610
0x856d2b cp_parser_postfix_expression
../../gcc/cp/parser.cc:7703
0x86a60f cp_parser_unary_expression
../../gcc/cp/parser.cc:9141
0x83e79f cp_parser_cast_expression
../../gcc/cp/parser.cc:10045
0x83f07f cp_parser_binary_expression
../../gcc/cp/parser.cc:10147
0x83fa74 cp_parser_assignment_expression
../../gcc/cp/parser.cc:10490
0x841bb7 cp_parser_constant_expression
../../gcc/cp/parser.cc:10785
0x842c31 cp_parser_initializer_clause
../../gcc/cp/parser.cc:25489
0x844aab cp_parser_initializer
../../gcc/cp/parser.cc:25429
0x874d2c cp_parser_init_declarator
../../gcc/cp/parser.cc:22994
0x84fd4f cp_parser_simple_declaration
../../gcc/cp/parser.cc:15402

[Bug c++/109319] New: [13 Regression] ICE in build_min_non_dep_op_overload, at cp/tree.cc:3793

2023-03-28 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109319

Bug ID: 109319
   Summary: [13 Regression] ICE in build_min_non_dep_op_overload,
at cp/tree.cc:3793
   Product: gcc
   Version: 13.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gs...@t-online.de
  Target Milestone: ---

Started between 20221106 and 20221120, with -std=c++23 :
(follow-up of pr108437)


$ cat z1.cc
struct S
{
  static int operator[] (int x) { int a[2]; return a[x]; }
};
template int f ()
{
  S s;
  ++s[0,1];
  return 0;
}


$ cat z2.cc
struct S
{
  static int operator[] (int x) { int a[2]; return a[x]; }
};
template int f ()
{
  S s;
  ++s[1,0];
  return 0;
}


$ g++-13-20230326 -c z1.cc -std=c++23
z1.cc: In function 'int f()':
z1.cc:8:6: warning: top-level comma expression in array subscript changed
meaning in C++23 [-Wcomma-subscript]
8 |   ++s[0,1];
  |  ^
z1.cc:8:10: internal compiler error: in build_min_non_dep_op_overload, at
cp/tree.cc:3793
8 |   ++s[0,1];
  |  ^
0x8de226 build_min_non_dep_op_overload(tree_node*, tree_node*, tree_node*,
vec*)
../../gcc/cp/tree.cc:3793
0x7ad99d grok_array_decl(unsigned int, tree_node*, tree_node*, vec**, int)
../../gcc/cp/decl2.cc:569
0x843ca4 cp_parser_postfix_open_square_expression
../../gcc/cp/parser.cc:8223
0x856671 cp_parser_postfix_expression
../../gcc/cp/parser.cc:7814
0x86a60f cp_parser_unary_expression
../../gcc/cp/parser.cc:9141
0x83e79f cp_parser_cast_expression
../../gcc/cp/parser.cc:10045
0x86a707 cp_parser_unary_expression
../../gcc/cp/parser.cc:9055
0x83e79f cp_parser_cast_expression
../../gcc/cp/parser.cc:10045
0x83f07f cp_parser_binary_expression
../../gcc/cp/parser.cc:10147
0x83fa74 cp_parser_assignment_expression
../../gcc/cp/parser.cc:10490
0x8411b2 cp_parser_expression
../../gcc/cp/parser.cc:10660
0x844837 cp_parser_expression_statement
../../gcc/cp/parser.cc:12816
0x851cbc cp_parser_statement
../../gcc/cp/parser.cc:12596
0x852d54 cp_parser_statement_seq_opt
../../gcc/cp/parser.cc:12967
0x852e0f cp_parser_compound_statement
../../gcc/cp/parser.cc:12919
0x873958 cp_parser_function_body
../../gcc/cp/parser.cc:25335
0x873958 cp_parser_ctor_initializer_opt_and_function_body
../../gcc/cp/parser.cc:25386
0x873e16 cp_parser_function_definition_after_declarator
../../gcc/cp/parser.cc:32012
0x874f90 cp_parser_function_definition_from_specifiers_and_declarator
../../gcc/cp/parser.cc:31929
0x874f90 cp_parser_init_declarator
../../gcc/cp/parser.cc:22789

[Bug c/109303] New: [13 Regression] ICE in push_agg_values_from_plats, at ipa-cp.cc:1458

2023-03-27 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109303

Bug ID: 109303
   Summary: [13 Regression] ICE in push_agg_values_from_plats, at
ipa-cp.cc:1458
   Product: gcc
   Version: 13.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gs...@t-online.de
  Target Milestone: ---

Started between 20221016 and 20221023, at -O2+ :


$ cat z1.c
struct s
{
  struct s1
  {
unsigned char c1;
unsigned short a1[2147483647];
  } __attribute__ ((packed)) p1;
  struct s2
  {
unsigned char c2;
unsigned short a2[100];
  } __attribute__ ((packed)) p2[4];
} __attribute__ ((packed));

typedef struct
{
  struct s b;
} qs;

static int
f (qs *q)
{
  int i, j;
  for (i = 0; i < q->b.p1.c1; i++)
for (j = 0; j < q->b.p2[i].c2; j++)
  g (q->b.p2[i].a2[j]);
}

int main (void)
{
  qs q;
  q.b.p2[0].c2 = q.b.p2[1].c2 = 3;
  return f ();
}


$ gcc-13-20230326 -c z1.c -O2
z1.c: In function 'f':
z1.c:26:7: warning: implicit declaration of function 'g'
[-Wimplicit-function-declaration]
   26 |   g (q->b.p2[i].a2[j]);
  |   ^
during IPA pass: cp
z1.c: At top level:
z1.c:34:1: internal compiler error: in push_agg_values_from_plats, at
ipa-cp.cc:1458
   34 | }
  | ^
0x1db8677 push_agg_values_from_plats
../../gcc/ipa-cp.cc:1457
0x1db8aef gather_context_independent_values
../../gcc/ipa-cp.cc:3641
0x1dc0d59 estimate_local_effects
../../gcc/ipa-cp.cc:3746
0x1dcbe38 propagate_constants_topo
../../gcc/ipa-cp.cc:4105
0x1dcbe38 ipcp_propagate_stage
../../gcc/ipa-cp.cc:4292
0x1dcbe38 ipcp_driver
../../gcc/ipa-cp.cc:6616

[Bug c/109302] New: [12/13 Regression] ICE in emit_move_insn, at expr.cc:4225

2023-03-27 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109302

Bug ID: 109302
   Summary: [12/13 Regression] ICE in emit_move_insn, at
expr.cc:4225
   Product: gcc
   Version: 13.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gs...@t-online.de
  Target Milestone: ---

Started between 20210905 and 20210919, with -mavx512f or -mavx512pf :


$ cat z1.c
typedef unsigned U __attribute__ ((vector_size (64)));
typedef unsigned __int128 V __attribute__ ((vector_size (64)));
static inline V
bar (U u, U x, V v)
{
  v = (V)(U) { 0, ~0 };
  v[x[0]] <<= u[-63];
  return v;
}
__attribute__((target_clones("arch=x86-64", "default")))
V
foo (U u)
{
  return bar (u, (U) {}, (V) {});
}


$ gcc-13-20230326 -c z1.c -O2 -mavx512f
In function 'foo.arch_x86_64':
cc1: warning: AVX512F vector return without AVX512F enabled changes the ABI
[-Wpsabi]
z1.c:12:1: note: the ABI for passing parameters with 64-byte alignment has
changed in GCC 4.6
   12 | foo (U u)
  | ^~~
z1.c:12:1: warning: AVX512F vector argument without AVX512F enabled changes the
ABI [-Wpsabi]
during RTL pass: expand
z1.c:14:10: internal compiler error: in emit_move_insn, at expr.cc:4225
   14 |   return bar (u, (U) {}, (V) {});
  |  ^~~
0x91273d emit_move_insn(rtx_def*, rtx_def*)
../../gcc/expr.cc:4224
0x9203d0 expand_expr_real_2(separate_ops*, rtx_def*, machine_mode,
expand_modifier)
../../gcc/expr.cc:10580
0x910a95 expand_expr_real_1(tree_node*, rtx_def*, machine_mode,
expand_modifier, rtx_def**, bool)
../../gcc/expr.cc:10801
0x9198b3 store_expr(tree_node*, rtx_def*, int, bool, bool)
../../gcc/expr.cc:6330
0x91af3e expand_assignment(tree_node*, tree_node*, bool)
../../gcc/expr.cc:6048
0x80afa0 expand_gimple_stmt_1
../../gcc/cfgexpand.cc:3946
0x80afa0 expand_gimple_stmt
../../gcc/cfgexpand.cc:4044
0x8101a7 expand_gimple_basic_block
../../gcc/cfgexpand.cc:6106
0x812c6e execute
../../gcc/cfgexpand.cc:6841

[Bug c/109301] New: [13 Regression] ICE in format_helper, at real.h:233

2023-03-27 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109301

Bug ID: 109301
   Summary: [13 Regression] ICE in format_helper, at real.h:233
   Product: gcc
   Version: 13.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gs...@t-online.de
  Target Milestone: ---

Started between 20220717 and 20220724, at -Ofast :


$ cat z1.c
double x[256];
void f (void)
{
  int i, j;
  for (i=0; i<256; ++i)
for (j=0; j<8; ++j)
  x[i] = __builtin_pow (x[i], 0.5);
}


$ gcc-13-20230326 -c z1.c -Ofast
during GIMPLE pass: cunroll
z1.c: In function 'f':
z1.c:2:6: internal compiler error: in format_helper, at real.h:233
2 | void f (void)
  |  ^
0x94a671 format_helper::format_helper(machine_mode const&)
../../gcc/real.h:233
0x94a671 const_binop
../../gcc/fold-const.cc:1340
0x94b027 const_binop(tree_code, tree_node*, tree_node*, tree_node*)
../../gcc/fold-const.cc:1761
0x10e23d8 gimple_resimplify2
../../gcc/gimple-match-head.cc:280
0x10e258a gimple_match_op::resimplify(gimple**, tree_node* (*)(tree_node*))
../../gcc/gimple-match-head.cc:516
0x1206eb8 gimple_simplify_CFN_POW
.../gcc-13-20230326/zzz_rel/gcc/gimple-match.cc:188875
0x10e1112 gimple_simplify
.../gcc-13-20230326/zzz_rel/gcc/gimple-match.cc:211319
0x10e22ca gimple_resimplify2
../../gcc/gimple-match-head.cc:323
0x10e258a gimple_match_op::resimplify(gimple**, tree_node* (*)(tree_node*))
../../gcc/gimple-match-head.cc:516
0x10fd1c0 gimple_simplify_CFN_SQRT
.../gcc-13-20230326/zzz_rel/gcc/gimple-match.cc:87171
0x12a7aa7 gimple_simplify
.../gcc-13-20230326/zzz_rel/gcc/gimple-match.cc:95836
0x12a8dc9 gimple_resimplify1
../../gcc/gimple-match-head.cc:246
0x10e259a gimple_match_op::resimplify(gimple**, tree_node* (*)(tree_node*))
../../gcc/gimple-match-head.cc:514
0x12a8f86 gimple_simplify(gimple*, gimple_match_op*, gimple**, tree_node*
(*)(tree_node*), tree_node* (*)(tree_node*))
../../gcc/gimple-match-head.cc:1115
0x99029d fold_stmt_1
../../gcc/gimple-fold.cc:6251
0xe234f8 eliminate_dom_walker::eliminate_stmt(basic_block_def*,
gimple_stmt_iterator*)
../../gcc/tree-ssa-sccvn.cc:7062
0xe298b7 process_bb
../../gcc/tree-ssa-sccvn.cc:8050
0xe2ad95 do_rpo_vn_1
../../gcc/tree-ssa-sccvn.cc:8501
0xe2bdc9 do_rpo_vn(function*, edge_def*, bitmap_head*, bool, bool,
vn_lookup_kind)
../../gcc/tree-ssa-sccvn.cc:8603
0xd9b03d tree_unroll_loops_completely
../../gcc/tree-ssa-loop-ivcanon.cc:1485

[Bug c++/109300] New: [13 Regression] ICE in cp_finish_decl, at cp/decl.cc:8279

2023-03-27 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109300

Bug ID: 109300
   Summary: [13 Regression] ICE in cp_finish_decl, at
cp/decl.cc:8279
   Product: gcc
   Version: 13.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gs...@t-online.de
  Target Milestone: ---

Started between 20230226 and 20230312 :


$ cat z1.cc
template
auto x = [](){ x(); };


$ gcc-13-20230326 -c z1.cc
z1.cc: In instantiation of 'auto x':
z1.cc:2:16:   required from here
z1.cc:2:6: internal compiler error: in cp_finish_decl, at cp/decl.cc:8279
2 | auto x = [](){ x(); };
  |  ^
0x7a8893 cp_finish_decl(tree_node*, tree_node*, bool, tree_node*, int)
../../gcc/cp/decl.cc:8279
0x899b2a instantiate_body
../../gcc/cp/pt.cc:26799
0x89aa6f instantiate_decl(tree_node*, bool, bool)
../../gcc/cp/pt.cc:27121
0x7b210a maybe_instantiate_decl(tree_node*)
../../gcc/cp/decl2.cc:5448
0x7b2c62 mark_used(tree_node*, int)
../../gcc/cp/decl2.cc:5747
0x8cc5c3 finish_id_expression_1
../../gcc/cp/semantics.cc:4269
0x8cc5c3 finish_id_expression(tree_node*, tree_node*, tree_node*, cp_id_kind*,
bool, bool, bool*, bool, bool, bool, bool, char const**, unsigned int)
../../gcc/cp/semantics.cc:4411
0x853ecf cp_parser_primary_expression
../../gcc/cp/parser.cc:6149
0x856e76 cp_parser_postfix_expression
../../gcc/cp/parser.cc:
0x86a60f cp_parser_unary_expression
../../gcc/cp/parser.cc:9141
0x83e79f cp_parser_cast_expression
../../gcc/cp/parser.cc:10045
0x83f07f cp_parser_binary_expression
../../gcc/cp/parser.cc:10147
0x83fa74 cp_parser_assignment_expression
../../gcc/cp/parser.cc:10490
0x8411b2 cp_parser_expression
../../gcc/cp/parser.cc:10660
0x844837 cp_parser_expression_statement
../../gcc/cp/parser.cc:12816
0x851cbc cp_parser_statement
../../gcc/cp/parser.cc:12596
0x852d54 cp_parser_statement_seq_opt
../../gcc/cp/parser.cc:12967
0x852e0f cp_parser_compound_statement
../../gcc/cp/parser.cc:12919
0x853967 cp_parser_function_body
../../gcc/cp/parser.cc:25335
0x853967 cp_parser_lambda_body
../../gcc/cp/parser.cc:11837

[Bug c++/108795] New: [10/11/12/13 Regression] ICE in prep_operand, at cp/call.cc:6325

2023-02-14 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108795

Bug ID: 108795
   Summary: [10/11/12/13 Regression] ICE in prep_operand, at
cp/call.cc:6325
   Product: gcc
   Version: 13.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gs...@t-online.de
  Target Milestone: ---

Started with r7 :


$ cat z1.cc
template  T g (T x)
{
  class C
  {
__attribute__((transaction_safe)) ~C();
  };
  C::~C();
}
void f ()
{
  g (5);
}


$ gcc-13-20230212 -c z1.cc
z1.cc: In instantiation of 'T g(T) [with T = int]':
z1.cc:11:5:   required from here
z1.cc:7:6: internal compiler error: Segmentation fault
7 |   C::~C();
  |   ~~~^~
0xeb71af crash_signal
../../gcc/toplev.cc:314
0x7b242d prep_operand
../../gcc/cp/call.cc:6325
0x7c8d67 build_new_op(op_location_t const&, tree_code, int, tree_node*,
tree_node*, tree_node*, tree_node*, tree_node**, int)
../../gcc/cp/call.cc:6956
0x985d3d build_x_unary_op(unsigned int, tree_code, cp_expr, tree_node*, int)
../../gcc/cp/typeck.cc:6820
0x9237fb tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*)
../../gcc/cp/pt.cc:20496
0x924e34 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*)
../../gcc/cp/pt.cc:20910
0x928e38 tsubst_expr(tree_node*, tree_node*, int, tree_node*)
../../gcc/cp/pt.cc:19769
0x9279d1 tsubst_expr(tree_node*, tree_node*, int, tree_node*)
../../gcc/cp/pt.cc:18758
0x927cce tsubst_expr(tree_node*, tree_node*, int, tree_node*)
../../gcc/cp/pt.cc:18730
0x928678 tsubst_expr(tree_node*, tree_node*, int, tree_node*)
../../gcc/cp/pt.cc:19110
0x92b970 tsubst_expr(tree_node*, tree_node*, int, tree_node*)
../../gcc/cp/pt.cc:26707
0x92b970 instantiate_body
../../gcc/cp/pt.cc:26707
0x92c9df instantiate_decl(tree_node*, bool, bool)
../../gcc/cp/pt.cc:26997
0x9461db instantiate_pending_templates(int)
../../gcc/cp/pt.cc:27075
0x848f6a c_parse_final_cleanups()
../../gcc/cp/decl2.cc:4953
0x9f5be0 c_common_parse_file()
../../gcc/c-family/c-opts.cc:1266

[Bug c++/108794] New: ICE in determine_visibility, at cp/decl2.cc:2839

2023-02-14 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108794

Bug ID: 108794
   Summary: ICE in determine_visibility, at cp/decl2.cc:2839
   Product: gcc
   Version: 13.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gs...@t-online.de
  Target Milestone: ---

Affects versions down to at least r5 :


$ cat z1.cc
template  T g (T x)
{
  struct B b;
  struct B { struct A a; };
}
void f (int *x)
{
  g (x[1]);
}


$ gcc-13-20230212 -c z1.cc
z1.cc: In instantiation of 'struct g(int)::B':
z1.cc:3:12:   required from 'T g(T) [with T = int]'
z1.cc:8:5:   required from here
z1.cc:4:23: internal compiler error: Segmentation fault
4 |   struct B { struct A a; };
  |   ^
0xeb71af crash_signal
../../gcc/toplev.cc:314
0x84432d determine_visibility(tree_node*)
../../gcc/cp/decl2.cc:2839
0x8bf921 pushtag(tree_node*, tree_node*, TAG_how)
../../gcc/cp/name-lookup.cc:8007
0x93a8a8 lookup_template_class(tree_node*, tree_node*, tree_node*, tree_node*,
int, int)
../../gcc/cp/pt.cc:10090
0x93af76 tsubst_aggr_type_1
../../gcc/cp/pt.cc:13940
0x930b8d tsubst(tree_node*, tree_node*, int, tree_node*)
../../gcc/cp/pt.cc:15915
0x938336 tsubst_decl
../../gcc/cp/pt.cc:14949
0x931317 tsubst(tree_node*, tree_node*, int, tree_node*)
../../gcc/cp/pt.cc:15825
0x944cf5 instantiate_class_template(tree_node*)
../../gcc/cp/pt.cc:12278
0x97cd53 complete_type(tree_node*)
../../gcc/cp/typeck.cc:138
0x9387e5 tsubst_decl
../../gcc/cp/pt.cc:15237
0x931317 tsubst(tree_node*, tree_node*, int, tree_node*)
../../gcc/cp/pt.cc:15825
0x92a171 tsubst_expr(tree_node*, tree_node*, int, tree_node*)
../../gcc/cp/pt.cc:18857
0x927cce tsubst_expr(tree_node*, tree_node*, int, tree_node*)
../../gcc/cp/pt.cc:18730
0x928678 tsubst_expr(tree_node*, tree_node*, int, tree_node*)
../../gcc/cp/pt.cc:19110
0x92b970 tsubst_expr(tree_node*, tree_node*, int, tree_node*)
../../gcc/cp/pt.cc:26707
0x92b970 instantiate_body
../../gcc/cp/pt.cc:26707
0x92c9df instantiate_decl(tree_node*, bool, bool)
../../gcc/cp/pt.cc:26997
0x9461db instantiate_pending_templates(int)
../../gcc/cp/pt.cc:27075
0x848f6a c_parse_final_cleanups()
../../gcc/cp/decl2.cc:4953

[Bug c++/108793] New: [12/13 Regression] ICE: verify_gimple failed

2023-02-14 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108793

Bug ID: 108793
   Summary: [12/13 Regression] ICE: verify_gimple failed
   Product: gcc
   Version: 13.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gs...@t-online.de
  Target Milestone: ---

Started between 20210822 and 20210905, at -O3 or -Ofast :
(gcc configured with --enable-checking=yes)


$ cat z1.cc
typedef void (*p)();
extern "C" p a, b;
int f () {
  int n = 0;
  for (p* i =  i >  i++) {
n++;
  }
  return n;
}


$ gcc-13-20230212 -c z1.cc -Ofast
z1.cc: In function 'int f()':
z1.cc:3:5: error: non-trivial conversion in unary operation
3 | int f () {
  | ^
unsigned long
void (*p) (void) *
_3 = ~_1;
z1.cc:3:5: error: non-trivial conversion in unary operation
unsigned long
void (*p) (void) *
_24 = ~_23;
during GIMPLE pass: vect
z1.cc:3:5: internal compiler error: verify_gimple failed
0x12942be verify_gimple_in_cfg(function*, bool, bool)
../../gcc/tree-cfg.cc:5648
0x1135053 execute_function_todo
../../gcc/passes.cc:2091
0x1135ad2 execute_todo
../../gcc/passes.cc:2145

[Bug c++/108792] New: [10/11/12/13 Regression] ICE in reset_sched_cycles_in_current_ebb, at sel-sched.cc:7147

2023-02-14 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108792

Bug ID: 108792
   Summary: [10/11/12/13 Regression] ICE in
reset_sched_cycles_in_current_ebb, at
sel-sched.cc:7147
   Product: gcc
   Version: 13.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gs...@t-online.de
  Target Milestone: ---

Started with r10 between 20191110 and 20191117 (one week before pr97972),
at -O2+ and with special option -march=amdfam10 :

Testcase was derived from
llvm-project-llvmorg-14.0.6/openmp/libomptarget/test/mapping/declare_mapper_nested_default_mappers_complex_structure.cpp


$ cat z1.cc
class A {
public:
  A() {
a = 1;
b = 2;
  }
  void show() {
__builtin_printf ("\n");
__builtin_printf ("%d %d\n", a, b);
  }
  int a;
  int b;
};
class B {
public:
  B() {
arr = new A[2];
len = 2;
  }
  void show() {
for (int i = 0; i < len; i++)
  arr[i].show();
  }
  A *arr;
  int len;
};
void foo (void) {
  B *x = new B[2];
  for (int i = 0; i < 2; i++)
x[i].show();
  return;
}


$ gcc-13-20230212 -c z1.cc -O2 -fnon-call-exceptions -fprofile-generate
-fsel-sched-pipelining -fselective-scheduling2
$
$ gcc-13-20230212 -c z1.cc -O2 -fnon-call-exceptions -fprofile-generate
-fsel-sched-pipelining -fselective-scheduling2 -march=amdfam10
during RTL pass: sched2
z1.cc: In member function 'void B::show()':
z1.cc:23:3: internal compiler error: in reset_sched_cycles_in_current_ebb, at
sel-sched.cc:7147
   23 |   }
  |   ^
0x11f60c5 reset_sched_cycles_in_current_ebb
../../gcc/sel-sched.cc:7147
0x11f60c5 sel_region_target_finish
../../gcc/sel-sched.cc:7220
0x11f60c5 sel_region_finish
../../gcc/sel-sched.cc:7276
0x11f60c5 sel_sched_region(int)
../../gcc/sel-sched.cc:7645
0x11f62f9 run_selective_scheduling()
../../gcc/sel-sched.cc:7720
0x11d2475 rest_of_handle_sched2
../../gcc/sched-rgn.cc:3743
0x11d2475 execute
../../gcc/sched-rgn.cc:3890

[Bug rtl-optimization/97972] [10/11/12/13 Regression] ICE in moving_insn_creates_bookkeeping_block_p, at sel-sched.c:2031 since r9-2064-gc4c5ad1d6d1e1e1f

2023-02-14 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97972

--- Comment #7 from G. Steinmetz  ---
It gives an ICE for some target processors like -mtune=skylake,
but not for others like -mtune=sandybridge :


$ gcc-13-20230212 -c 20161124-1.c -O2 -mtune=skylake -fsanitize=undefined
-fvar-tracking-assignments -fselective-scheduling2
cc1: warning: var-tracking-assignments changes selective scheduling
during RTL pass: sched2
20161124-1.c: In function 'foo':
20161124-1.c:22:1: internal compiler error: Segmentation fault
   22 | }
  | ^
0xf295ff crash_signal
../../gcc/toplev.cc:314
0xeda737 moving_insn_creates_bookkeeping_block_p
../../gcc/sel-sched.cc:2031
0xeda737 moveup_expr
../../gcc/sel-sched.cc:2199
#...

[Bug c/108791] [12/13 Regression] ICE: verify_gimple failed

2023-02-14 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108791

G. Steinmetz  changed:

   What|Removed |Added

 Target||x86_64-pc-linux-gnu

--- Comment #1 from G. Steinmetz  ---

This variant gives an ICE for both -Ofast and -O3 : 

$ cat z2.c
int f (int *a(), int b, int *c, int *d)
{
  int s = 0;
  for (int *i = a; i < b; ++i, ++c)
s += *c * d[*i];
  return s;
}

[Bug c/108791] New: [12/13 Regression] ICE: verify_gimple failed

2023-02-14 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108791

Bug ID: 108791
   Summary: [12/13 Regression] ICE: verify_gimple failed
   Product: gcc
   Version: 13.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gs...@t-online.de
  Target Milestone: ---

Started between 20210801 and 20210808, at -Ofast :
(gcc configured with --enable-checking=yes)


$ cat z1.c
double f (int *a(), int b, double *c, double *d)
{
  double s = 0;
  for (int *i = a; i < b; ++i, ++c)
s += *c * d[*i];
  return s;
}


$ gcc-13-20230212 -c z1.c -Ofast
z1.c: In function 'f':
z1.c:4:17: warning: initialization of 'int *' from incompatible pointer type
'int * (*)()' [-Wincompatible-pointer-types]
4 |   for (int *i = a; i < b; ++i, ++c)
  | ^
z1.c:4:22: warning: comparison between pointer and integer
4 |   for (int *i = a; i < b; ++i, ++c)
  |  ^
z1.c:1:8: error: type mismatch in 'addr_expr'
1 | double f (int *a(), int b, double *c, double *d)
  |^
int * (*) ()

vector(4) int

_111 =   [(int *)a_14(D) + ivtmp.31_54 * 1];
during GIMPLE pass: forwprop
z1.c:1:8: internal compiler error: verify_gimple failed
0xf85e0e verify_gimple_in_cfg(function*, bool, bool)
../../gcc/tree-cfg.cc:5648
0xe1df43 execute_function_todo
../../gcc/passes.cc:2091
0xe1e9c2 execute_todo
../../gcc/passes.cc:2145

[Bug c/108685] New: [13 Regression] ICE in verify_loop_structure, at cfgloop.cc:1748

2023-02-06 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108685

Bug ID: 108685
   Summary: [13 Regression] ICE in verify_loop_structure, at
cfgloop.cc:1748
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gs...@t-online.de
  Target Milestone: ---

Started between 20220828 and 20220904, at -O1+ :


$ cat z1.c
void f (int a)
{
  for (;;)
#pragma omp for collapse(2) ordered(4)
for (int i = 0; i < 2; i++)
  for (int j = 0; j < a; j++)
for (int k = 0; k < 2; k++)
  for (int l = 0; l < a; l++)
  {
#pragma omp ordered doacross (source:)
__builtin_abort ();
  }
}


$ gcc-13-20230205 -c z1.c -fopenmp -O2
z1.c: In function 'f':
z1.c:4:13: error: size of loop 3 should be 9, not 10
4 | #pragma omp for collapse(2) ordered(4)
  | ^~~
z1.c:4:13: error: bb 8 does not belong to loop 3
z1.c:4:13: error: bb 18 does not belong to loop 3
z1.c:4:13: error: bb 15 does not belong to loop 3
z1.c:4:13: error: bb 14 does not belong to loop 3
z1.c:4:13: error: bb 13 does not belong to loop 3
z1.c:4:13: error: bb 9 does not belong to loop 3
z1.c:4:13: error: bb 17 does not belong to loop 3
z1.c:4:13: error: bb 16 does not belong to loop 3
z1.c:4:13: error: bb 10 does not belong to loop 3
z1.c:4:13: error: loop 3's header does not belong directly to it
during GIMPLE pass: ompexp
z1.c:4:13: internal compiler error: in verify_loop_structure, at
cfgloop.cc:1748
0x9ae013 verify_loop_structure()
../../gcc/cfgloop.cc:1748
0xd21499 checking_verify_loop_structure
../../gcc/cfgloop.h:646
0xd21499 fix_loop_structure(bitmap_head*)
../../gcc/loop-init.cc:327
0xf8dd37 repair_loop_structures
../../gcc/tree-cfgcleanup.cc:1190
0xf8dd37 cleanup_tree_cfg(unsigned int)
../../gcc/tree-cfgcleanup.cc:1218
0xe1dc14 execute_function_todo
../../gcc/passes.cc:2057
0xe1e5a2 execute_todo
../../gcc/passes.cc:2145

[Bug c++/108684] New: [13 Regression] ICE: verify_ssa failed

2023-02-06 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108684

Bug ID: 108684
   Summary: [13 Regression] ICE: verify_ssa failed
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gs...@t-online.de
  Target Milestone: ---

Started between 20221030 and 20221106 :
(gcc configured with --enable-checking=yes)


$ cat z1.cc
int f (int a)
{
  asm (" " : "=r" (a) : : "eax", "memory");
  if (a)
return 0;
}


$ gcc-13-20230205 -c z1.cc -O2
z1.cc: In function 'int f(int)':
z1.cc:6:1: warning: control reaches end of non-void function [-Wreturn-type]
6 | }
  | ^
z1.cc:1:5: error: virtual use of statement not up to date
1 | int f (int a)
  | ^
# VUSE <_2>
return 0;
during GIMPLE pass: vrp
z1.cc:1:5: internal compiler error: verify_ssa failed
0x14e901b verify_ssa(bool, bool)
../../gcc/tree-ssa.cc:1211
0x1134857 execute_function_todo
../../gcc/passes.cc:2098
0x11351a2 execute_todo
../../gcc/passes.cc:2145

[Bug c++/108607] New: [12/13 Regression] ICE in potential_constant_expression_1, at cp/constexpr.cc:10003

2023-01-30 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108607

Bug ID: 108607
   Summary: [12/13 Regression] ICE in
potential_constant_expression_1, at
cp/constexpr.cc:10003
   Product: gcc
   Version: 13.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gs...@t-online.de
  Target Milestone: ---

Started between 20210808 and 20210822 :


$ cat z1.cc
constexpr int bar (int x);
constexpr int foo (int x)
{
  [[omp::directive (scope nowait)]]
  return bar (x);
}


$ g++-13-20230129 -c z1.cc -fopenmp
z1.cc: In function 'constexpr int foo(int)':
z1.cc:5:16: error: invalid exit from OpenMP structured block
5 |   return bar (x);
  |^
z1.cc:6:1: sorry, unimplemented: unexpected AST of kind omp_scope
6 | }
  | ^
z1.cc:6:1: internal compiler error: in potential_constant_expression_1, at
cp/constexpr.cc:10003
0x893ef0 potential_constant_expression_1
../../gcc/cp/constexpr.cc:10003
0x89536a potential_constant_expression_1(tree_node*, bool, bool, bool, bool,
int)
../../gcc/cp/constexpr.cc:10027
0x896166 potential_rvalue_constant_expression(tree_node*)
../../gcc/cp/constexpr.cc:10047
0x896166 maybe_save_constexpr_fundef(tree_node*)
../../gcc/cp/constexpr.cc:959
0x926a31 finish_function(bool)
../../gcc/cp/decl.cc:18204
0xa64e03 cp_parser_function_definition_after_declarator
../../gcc/cp/parser.cc:31998
0xa6633c cp_parser_function_definition_from_specifiers_and_declarator
../../gcc/cp/parser.cc:31912
0xa6633c cp_parser_init_declarator
../../gcc/cp/parser.cc:22777
0xa36572 cp_parser_simple_declaration
../../gcc/cp/parser.cc:15390
0xa6dd1b cp_parser_declaration
../../gcc/cp/parser.cc:15076
0xa6e838 cp_parser_translation_unit
../../gcc/cp/parser.cc:5131
0xa6e838 c_parse_file()
../../gcc/cp/parser.cc:49472
0xc169e1 c_common_parse_file()
../../gcc/c-family/c-opts.cc:1248

[Bug c++/108606] New: [13 Regression] ICE in potential_constant_expression_1, at cp/constexpr.cc:9713

2023-01-30 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108606

Bug ID: 108606
   Summary: [13 Regression] ICE in
potential_constant_expression_1, at
cp/constexpr.cc:9713
   Product: gcc
   Version: 13.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gs...@t-online.de
  Target Milestone: ---

Started between 20220925 and 20221009 :


$ cat z1.cc
void f() {
  g([&](auto x) {
class C {
  friend void h();
};
  }
}


$ g++-13-20230129 -c z1.cc
z1.cc: In lambda function:
z1.cc:6:3: internal compiler error: in potential_constant_expression_1, at
cp/constexpr.cc:9713
6 |   }
  |   ^
0x7efa5b potential_constant_expression_1
../../gcc/cp/constexpr.cc:9712
0x7ee09a potential_constant_expression_1
../../gcc/cp/constexpr.cc:9281
0x7eeb5e potential_constant_expression_1
../../gcc/cp/constexpr.cc:9303
0x7ee09a potential_constant_expression_1
../../gcc/cp/constexpr.cc:9281
0x7ee09a potential_constant_expression_1
../../gcc/cp/constexpr.cc:9281
0x7efdda potential_constant_expression_1(tree_node*, bool, bool, bool, bool,
int)
../../gcc/cp/constexpr.cc:10027
0x83868c finish_function(bool)
../../gcc/cp/decl.cc:18200
0x8666e4 finish_lambda_function(tree_node*)
../../gcc/cp/lambda.cc:1807
0x8e5df9 cp_parser_lambda_body
../../gcc/cp/parser.cc:11827
0x8e5df9 cp_parser_lambda_expression
../../gcc/cp/parser.cc:11148
0x8e5df9 cp_parser_primary_expression
../../gcc/cp/parser.cc:5826
0x8e9056 cp_parser_postfix_expression
../../gcc/cp/parser.cc:
0x8fc5df cp_parser_unary_expression
../../gcc/cp/parser.cc:9141
0x8d118f cp_parser_cast_expression
../../gcc/cp/parser.cc:10045
0x8d1a4f cp_parser_binary_expression
../../gcc/cp/parser.cc:10147
0x8d2454 cp_parser_assignment_expression
../../gcc/cp/parser.cc:10490
0x8d63bf cp_parser_parenthesized_expression_list_elt
../../gcc/cp/parser.cc:8110
0x8d6885 cp_parser_parenthesized_expression_list
../../gcc/cp/parser.cc:8579
0x8e88e0 cp_parser_postfix_expression
../../gcc/cp/parser.cc:7854
0x8fc5df cp_parser_unary_expression
../../gcc/cp/parser.cc:9141

[Bug c++/108605] New: [13 Regression] ICE in ipa_push_agg_values_from_jfunc, at ipa-cp.cc:2089

2023-01-30 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108605

Bug ID: 108605
   Summary: [13 Regression] ICE in ipa_push_agg_values_from_jfunc,
at ipa-cp.cc:2089
   Product: gcc
   Version: 13.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gs...@t-online.de
  Target Milestone: ---

Started between 20221016 and 20221023, at -O2+ :


$ cat z1.cc
typedef enum {A} E;
struct S {
  E __attribute__ ((mode (__byte__))) a;
  E __attribute__ ((mode (__byte__))) b;
  E __attribute__ ((mode (__byte__))) c;
  int d[2147483647];
  E e;
};
void foo (S *s)
{
  if (s->b && s->c != A)
__builtin_abort ();
}
void bar ()
{
  struct S s[2];
  s[0].a = A;
  s[0].e = A;
  foo (s);
}


$ g++-13-20230129 -c z1.cc -O2
during IPA pass: inline
z1.cc:20:1: internal compiler error: in ipa_push_agg_values_from_jfunc, at
ipa-cp.cc:2089
   20 | }
  | ^
0x1b03d95 ipa_push_agg_values_from_jfunc(ipa_node_params*, cgraph_node*,
ipa_agg_jump_function*, unsigned int, vec*)
../../gcc/ipa-cp.cc:2088
0xc6f68d evaluate_properties_for_edge(cgraph_edge*, bool, unsigned int*,
unsigned int*, ipa_auto_call_arg_values*, bool)
../../gcc/ipa-fnsummary.cc:668
0xc83842 do_estimate_edge_size(cgraph_edge*)
../../gcc/ipa-inline-analysis.cc:335
0xc851ba estimate_edge_size
../../gcc/ipa-inline.h:79
0xc851ba estimate_edge_growth
../../gcc/ipa-inline.h:100
0xc851ba do_estimate_growth_1
../../gcc/ipa-inline-analysis.cc:434
0xc85835 cgraph_node::call_for_symbol_and_aliases(bool (*)(cgraph_node*,
void*), void*, bool)
../../gcc/cgraph.h:3416
0xc85835 estimate_growth(cgraph_node*)
../../gcc/ipa-inline-analysis.cc:472
0x1b237a8 inline_small_functions
../../gcc/ipa-inline.cc:1986
0x1b24151 ipa_inline
../../gcc/ipa-inline.cc:2754
0x1b24151 execute
../../gcc/ipa-inline.cc:3153

[Bug fortran/108546] New: [11/12/13 Regression] ICE in expand_expr_real_1, at expr.cc:10910

2023-01-25 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108546

Bug ID: 108546
   Summary: [11/12/13 Regression] ICE in expand_expr_real_1, at
expr.cc:10910
   Product: gcc
   Version: 13.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gs...@t-online.de
  Target Milestone: ---

Started with r10, between 20191110 and 20191117 :


$ cat z1.f90
module m
   use iso_c_binding
contains
   subroutine s(x)
  type(c_ptr), optional :: x
  !$omp target is_device_ptr(x)
  if (c_associated(x)) stop
  !$omp end target
   end
end


$ cat z2.f90# compiles, for reference only
module m
   use iso_c_binding
contains
   subroutine s(x)
  type(c_ptr) :: x
  !$omp target is_device_ptr(x)
  if (c_associated(x)) stop
  !$omp end target
   end
end


$ gfortran-13-20230122 -c z2.f90 -fopenmp
$ gfortran-10-20191110 -c z1.f90 -fopenmp
$
$ gfortran-13-20230122 -c z1.f90 -fopenmp
during RTL pass: expand
z1.f90:6:35:

6 |   !$omp target is_device_ptr(x)
  |   ^
internal compiler error: in expand_expr_real_1, at expr.cc:10910
0xa570bf expand_expr_real_1(tree_node*, rtx_def*, machine_mode,
expand_modifier, rtx_def**, bool)
../../gcc/expr.cc:10904
0xa5e66e expand_expr
../../gcc/expr.h:310
0xa5e66e expand_operands(tree_node*, tree_node*, rtx_def*, rtx_def**,
rtx_def**, expand_modifier)
../../gcc/expr.cc:8582
0xa6a23a do_store_flag
../../gcc/expr.cc:13113
0xa6574e expand_expr_real_2(separate_ops*, rtx_def*, machine_mode,
expand_modifier)
../../gcc/expr.cc:10259
0x94fba2 expand_gimple_stmt_1
../../gcc/cfgexpand.cc:3983
0x94fba2 expand_gimple_stmt
../../gcc/cfgexpand.cc:4044
0x9548d7 expand_gimple_basic_block
../../gcc/cfgexpand.cc:6096
0x95739e execute
../../gcc/cfgexpand.cc:6831

[Bug fortran/108545] New: [13 Regression] ICE in install_var_field, at omp-low.cc:799

2023-01-25 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108545

Bug ID: 108545
   Summary: [13 Regression] ICE in install_var_field, at
omp-low.cc:799
   Product: gcc
   Version: 13.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gs...@t-online.de
  Target Milestone: ---

Started between 20220911 and 20220918 :


$ cat z1.f90
program p
   type t
  integer, pointer :: a(:)
   end type
   type(t), volatile :: x
   !$omp target enter data map(to: x%a)
end


$ cat z2.f90
program p
   type t
  integer, pointer :: a(:)
   end type
   type(t) :: x
   !$omp target enter data map(to: x%a)
end


$ gfortran-13-20230122 -c z2.f90 -fopenmp
$ gfortran-12  -c z1.f90 -fopenmp
$
$ gfortran-13-20230122 -c z1.f90 -fopenmp
during GIMPLE pass: omplower
z1.f90:6:39:

6 |!$omp target enter data map(to: x%a)
  |   ^
internal compiler error: in install_var_field, at omp-low.cc:799
0xc6accb install_var_field
../../gcc/omp-low.cc:798
0xc6f882 scan_sharing_clauses
../../gcc/omp-low.cc:1678
0xc71c24 scan_omp_target
../../gcc/omp-low.cc:3111
0xc7282d scan_omp_1_stmt
../../gcc/omp-low.cc:4327
0xaf96a6 walk_gimple_stmt(gimple_stmt_iterator*, tree_node*
(*)(gimple_stmt_iterator*, bool*, walk_stmt_info*), tree_node* (*)(tree_node**,
int*, void*), walk_stmt_info*)
../../gcc/gimple-walk.cc:608
0xaf9880 walk_gimple_seq_mod(gimple**, tree_node* (*)(gimple_stmt_iterator*,
bool*, walk_stmt_info*), tree_node* (*)(tree_node**, int*, void*),
walk_stmt_info*)
../../gcc/gimple-walk.cc:51
0xaf9761 walk_gimple_stmt(gimple_stmt_iterator*, tree_node*
(*)(gimple_stmt_iterator*, bool*, walk_stmt_info*), tree_node* (*)(tree_node**,
int*, void*), walk_stmt_info*)
../../gcc/gimple-walk.cc:635
0xaf9880 walk_gimple_seq_mod(gimple**, tree_node* (*)(gimple_stmt_iterator*,
bool*, walk_stmt_info*), tree_node* (*)(tree_node**, int*, void*),
walk_stmt_info*)
../../gcc/gimple-walk.cc:51
0xaf9761 walk_gimple_stmt(gimple_stmt_iterator*, tree_node*
(*)(gimple_stmt_iterator*, bool*, walk_stmt_info*), tree_node* (*)(tree_node**,
int*, void*), walk_stmt_info*)
../../gcc/gimple-walk.cc:635
0xaf9880 walk_gimple_seq_mod(gimple**, tree_node* (*)(gimple_stmt_iterator*,
bool*, walk_stmt_info*), tree_node* (*)(tree_node**, int*, void*),
walk_stmt_info*)
../../gcc/gimple-walk.cc:51
0xc6852d scan_omp
../../gcc/omp-low.cc:4377
0xc7c73a execute_lower_omp
../../gcc/omp-low.cc:14691
0xc7c73a execute
../../gcc/omp-low.cc:14755

[Bug fortran/108544] New: ICE in check_host_association, at fortran/resolve.cc:6135

2023-01-25 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108544

Bug ID: 108544
   Summary: ICE in check_host_association, at
fortran/resolve.cc:6135
   Product: gcc
   Version: 13.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gs...@t-online.de
  Target Milestone: ---

Affects versions down to at least r5 :


$ cat z1.f90
module m
   implicit none
contains
   subroutine s
  select type (s => 1)
  end select
   end
end


$ cat z3.f90
module m
contains
   subroutine s
  select type (s => null())
  end select
   end
end


$ cat z4.f90
module m
   type t
   end type
   type(t) :: x
contains
   subroutine s
  select type (s => x)
  end select
   end
end


$ gfortran-13-20230122 -c z1.f90
f951: internal compiler error: Segmentation fault
0xdaa49f crash_signal
../../gcc/toplev.cc:314
0x838506 check_host_association
../../gcc/fortran/resolve.cc:6135
0x838506 gfc_resolve_expr(gfc_expr*)
../../gcc/fortran/resolve.cc:7194
0x83fa6c gfc_resolve_expr(gfc_expr*)
../../gcc/fortran/resolve.cc:7162
0x83fa6c gfc_resolve_code(gfc_code*, gfc_namespace*)
../../gcc/fortran/resolve.cc:11982
0x8416a7 resolve_codes
../../gcc/fortran/resolve.cc:17629
0x8415de resolve_codes
../../gcc/fortran/resolve.cc:17612
0x84176e gfc_resolve(gfc_namespace*)
../../gcc/fortran/resolve.cc:17664
0x8292d2 gfc_parse_file()
../../gcc/fortran/parse.cc:6862
0x8774bf gfc_be_parse_file
../../gcc/fortran/f95-lang.cc:229

[Bug c++/108543] New: ICE in build_call_expr_loc_array, at tree.cc:10686

2023-01-25 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108543

Bug ID: 108543
   Summary: ICE in build_call_expr_loc_array, at tree.cc:10686
   Product: gcc
   Version: 13.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gs...@t-online.de
  Target Milestone: ---

Started with r8 :


$ cat z1.cc
#include 


$ g++-13-20230122 -c z1.cc -fsanitize=address -fno-sanitize=kernel-address
-fsanitize=pointer-subtract
In file included from .../gcc-13-20230122/include/c++/13.0.1/vector:67,
 from z1.cc:1:
.../gcc-13-20230122/include/c++/13.0.1/bits/stl_bvector.h: In function
'std::ptrdiff_t std::operator-(const _Bit_iterator_base&, const
_Bit_iterator_base&)':
.../gcc-13-20230122/include/c++/13.0.1/bits/stl_bvector.h:269:50: internal
compiler error: Segmentation fault
  269 |   return (int(_S_word_bit) * (__x._M_p - __y._M_p)
  |  ^~~~
0xeb575f crash_signal
../../gcc/toplev.cc:314
0x114833e build_call_expr_loc_array(unsigned int, tree_node*, int, tree_node**)
../../gcc/tree.cc:10686
0x114842f build_call_expr_loc(unsigned int, tree_node*, int, ...)
../../gcc/tree.cc:10719
0x98b393 pointer_diff
../../gcc/cp/typeck.cc:6728
0x98b393 cp_build_binary_op(op_location_t const&, tree_code, tree_node*,
tree_node*, int)
../../gcc/cp/typeck.cc:5350
0x7c8c8c build_new_op(op_location_t const&, tree_code, int, tree_node*,
tree_node*, tree_node*, tree_node*, tree_node**, int)
../../gcc/cp/call.cc:7369
0x97de10 build_x_binary_op(op_location_t const&, tree_code, tree_node*,
tree_code, tree_node*, tree_code, tree_node*, tree_node**, int)
../../gcc/cp/typeck.cc:4722
0x8d16e3 cp_parser_binary_expression
../../gcc/cp/parser.cc:10283
0x8d1eb4 cp_parser_assignment_expression
../../gcc/cp/parser.cc:10444
0x8d35f2 cp_parser_expression
../../gcc/cp/parser.cc:10614
0x8e50c1 cp_parser_primary_expression
../../gcc/cp/parser.cc:5722
0x8e8a76 cp_parser_postfix_expression
../../gcc/cp/parser.cc:7731
0x8fbfff cp_parser_unary_expression
../../gcc/cp/parser.cc:9095
0x8d0bff cp_parser_cast_expression
../../gcc/cp/parser.cc:
0x8d190c cp_parser_simple_cast_expression
../../gcc/cp/parser.cc:32523
0x8d190c cp_parser_binary_expression
../../gcc/cp/parser.cc:10168
0x8d1eb4 cp_parser_assignment_expression
../../gcc/cp/parser.cc:10444
0x8d35f2 cp_parser_expression
../../gcc/cp/parser.cc:10614
0x8e50c1 cp_parser_primary_expression
../../gcc/cp/parser.cc:5722
0x8e8a76 cp_parser_postfix_expression
../../gcc/cp/parser.cc:7731

[Bug c++/108542] New: [13 Regression] ICE in instantiate_type, at cp/class.cc:8833

2023-01-25 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108542

Bug ID: 108542
   Summary: [13 Regression] ICE in instantiate_type, at
cp/class.cc:8833
   Product: gcc
   Version: 13.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gs...@t-online.de
  Target Milestone: ---

Started between 20221106 and 20221120 :


$ cat z1.cc
template
void f (T n) {}
[[pre: f]]


$ g++-13-20230122 -c z1.cc
z1.cc:3:8: internal compiler error: in instantiate_type, at cp/class.cc:8833
3 | [[pre: f]]
  |^
0x7d34ef instantiate_type(tree_node*, tree_node*, int)
../../gcc/cp/class.cc:8833
0x7b2c27 implicit_conversion_error
../../gcc/cp/call.cc:4658
0x7c05bc perform_implicit_conversion_flags(tree_node*, tree_node*, int, int)
../../gcc/cp/call.cc:13366
0x97e5cc contextual_conv_bool(tree_node*, int)
../../gcc/cp/typeck.cc:6952
0x97e5cc condition_conversion(tree_node*)
../../gcc/cp/typeck.cc:6961
0x81665a grok_contract(tree_node*, tree_node*, tree_node*, cp_expr, unsigned
int)
../../gcc/cp/contracts.cc:783
0x8f0a2f cp_parser_contract_attribute_spec
../../gcc/cp/parser.cc:29740
0x8f0a2f cp_parser_std_attribute_spec
../../gcc/cp/parser.cc:29886
0x8f0a2f cp_parser_std_attribute_spec_seq
../../gcc/cp/parser.cc:30011
0x8f0f51 cp_parser_attributes_opt
../../gcc/cp/parser.cc:28909
0x8e11e7 cp_parser_decl_specifier_seq
../../gcc/cp/parser.cc:15734
0x8e1aa1 cp_parser_simple_declaration
../../gcc/cp/parser.cc:15217
0x90c638 cp_parser_declaration
../../gcc/cp/parser.cc:15030
0x90d010 cp_parser_translation_unit
../../gcc/cp/parser.cc:5090
0x90d010 c_parse_file()
../../gcc/cp/parser.cc:49400
0x9f4e01 c_common_parse_file()
../../gcc/c-family/c-opts.cc:1248

[Bug fortran/108529] New: [10/11/12/13 Regression] ICE in transformational_result, at fortran/simplify.cc:478

2023-01-24 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108529

Bug ID: 108529
   Summary: [10/11/12/13 Regression] ICE in
transformational_result, at fortran/simplify.cc:478
   Product: gcc
   Version: 13.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gs...@t-online.de
  Target Milestone: ---

Started between 20211031 and 20211107 :


$ cat z1.f90
program p
   integer, parameter :: a(*,*) = reshape([1, 2, 3, 4], [2, 2])
   logical, parameter :: b(2,*) = a > 2
   logical, parameter :: c(*) = all(b, 1)
end


$ cat z2.f90
program p
   integer, parameter :: a(*,*) = reshape([1, 2, 3, 4], [2, 2])
   logical, parameter :: b(*,*) = a > 2
   logical, parameter :: c(*) = all(b, 1)
   print *, c
end


$ gfortran-13-20230122 z2.f90 && ./a.out   # for reference only
 F T


$ gfortran-12-20211031 -c z1.f90
z1.f90:3:31:

3 |logical, parameter :: b(2,*) = a > 2
  |   1
Error: Assumed size array at (1) must be a dummy argument


$ gfortran-13-20230122 -c z1.f90
f951: internal compiler error: Segmentation fault
0xf8a79f crash_signal
../../gcc/toplev.cc:314
0x8c98f5 __gmpz_get_ui
/usr/include/gmp.h:1778
0x8c98f5 transformational_result
../../gcc/fortran/simplify.cc:478
0x8d0f09 simplify_transformation
../../gcc/fortran/simplify.cc:731
0x84cee6 do_simplify
../../gcc/fortran/intrinsic.cc:4670
0x857eaa gfc_intrinsic_func_interface(gfc_expr*, int)
../../gcc/fortran/intrinsic.cc:5056
0x8af508 resolve_unknown_f
../../gcc/fortran/resolve.cc:2990
0x8af508 resolve_function
../../gcc/fortran/resolve.cc:3347
0x8af508 gfc_resolve_expr(gfc_expr*)
../../gcc/fortran/resolve.cc:7195
0x83cb14 gfc_reduce_init_expr(gfc_expr*)
../../gcc/fortran/expr.cc:3168
0x83fa70 gfc_match_init_expr(gfc_expr**)
../../gcc/fortran/expr.cc:3216
0x82949b variable_decl
../../gcc/fortran/decl.cc:3036
0x82949b gfc_match_data_decl()
../../gcc/fortran/decl.cc:6343
0x897303 match_word
../../gcc/fortran/parse.cc:67
0x897303 decode_statement
../../gcc/fortran/parse.cc:378
0x898d4a next_free
../../gcc/fortran/parse.cc:1403
0x898d4a next_statement
../../gcc/fortran/parse.cc:1635
0x89a78b parse_spec
../../gcc/fortran/parse.cc:4191
0x89da8c parse_progunit
../../gcc/fortran/parse.cc:6262
0x89f191 gfc_parse_file()
../../gcc/fortran/parse.cc:6807

[Bug fortran/108528] New: [13 Regression] ICE in gfc_compare_array_spec(): Array spec clobbered

2023-01-24 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108528

Bug ID: 108528
   Summary: [13 Regression] ICE in gfc_compare_array_spec(): Array
spec clobbered
   Product: gcc
   Version: 13.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gs...@t-online.de
  Target Milestone: ---

Started between 20221218 and 20230108 :


$ cat z1.f90
function f()
integer :: f((2.))
integer :: g((2))
entry g()
end


$ cat z2.f90
function f()
integer :: f(real(2))
integer :: g((2))
entry g()
end


$ gfortran-13-20230122 -c z1.f90
f951: internal compiler error: gfc_compare_array_spec(): Array spec clobbered
0x7c17e9 gfc_report_diagnostic
../../gcc/fortran/error.cc:883
0x7c3387 gfc_internal_error(char const*, ...)
../../gcc/fortran/error.cc:1503
0x78dda4 compare_bounds
../../gcc/fortran/array.cc:982
0x78f73c gfc_compare_array_spec(gfc_array_spec*, gfc_array_spec*)
../../gcc/fortran/array.cc:1026
0x8333ff resolve_entries
../../gcc/fortran/resolve.cc:799
0x8461ef resolve_types
../../gcc/fortran/resolve.cc:17531
0x84175c gfc_resolve(gfc_namespace*)
../../gcc/fortran/resolve.cc:17662
0x8294d4 resolve_all_program_units
../../gcc/fortran/parse.cc:6656
0x8294d4 gfc_parse_file()
../../gcc/fortran/parse.cc:6912
0x8774bf gfc_be_parse_file
../../gcc/fortran/f95-lang.cc:229

[Bug fortran/108527] New: [13 Regression] ICE in compare_bound_int(): Bad expression

2023-01-24 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108527

Bug ID: 108527
   Summary: [13 Regression] ICE in compare_bound_int(): Bad
expression
   Product: gcc
   Version: 13.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gs...@t-online.de
  Target Milestone: ---

Started between 20221218 and 20230108,
was fixed, but testcases from pr103505 give an ICE again :


$ cat z1.f90
program p
   integer, parameter :: a((2.)) = [4, 8]
   integer(a(1:1)) :: b
end


$ cat z2.f90
program p
   integer, parameter :: a((2.)) = [4, 8]
   print *, [integer(a(1:1)) :: 2]
end


$ cat z3.f90
program p
   integer, parameter :: a((2.)) = [4, 8]
   integer :: b(a(1:1))
end


$ gfortran-13-20230122 -c z1.f90
f951: internal compiler error: compare_bound_int(): Bad expression
0x7c17e9 gfc_report_diagnostic
../../gcc/fortran/error.cc:883
0x7c3387 gfc_internal_error(char const*, ...)
../../gcc/fortran/error.cc:1503
0x834531 compare_bound_mpz_t
../../gcc/fortran/resolve.cc:4605
0x834a7c check_dimension
../../gcc/fortran/resolve.cc:4788
0x847ddd compare_spec_to_ref
../../gcc/fortran/resolve.cc:4853
0x847ddd resolve_array_ref
../../gcc/fortran/resolve.cc:5151
0x847ddd gfc_resolve_ref(gfc_expr*)
../../gcc/fortran/resolve.cc:5366
0x837bc7 resolve_variable
../../gcc/fortran/resolve.cc:5871
0x837bc7 gfc_resolve_expr(gfc_expr*)
../../gcc/fortran/resolve.cc:7197
0x7c77a4 gfc_reduce_init_expr(gfc_expr*)
../../gcc/fortran/expr.cc:3168
0x7ca700 gfc_match_init_expr(gfc_expr**)
../../gcc/fortran/expr.cc:3216
0x7aa94a gfc_match_kind_spec(gfc_typespec*, bool)
../../gcc/fortran/decl.cc:3273
0x7b12e9 gfc_match_decl_type_spec(gfc_typespec*, int)
../../gcc/fortran/decl.cc:4706
0x7b2cac gfc_match_data_decl()
../../gcc/fortran/decl.cc:6264
0x8215d3 match_word
../../gcc/fortran/parse.cc:67
0x8215d3 decode_statement
../../gcc/fortran/parse.cc:378
0x82301a next_free
../../gcc/fortran/parse.cc:1403
0x82301a next_statement
../../gcc/fortran/parse.cc:1635
0x824a5b parse_spec
../../gcc/fortran/parse.cc:4191
0x827d5c parse_progunit
../../gcc/fortran/parse.cc:6262

[Bug c++/108526] New: [13 Regression] ICE in start_preparsed_function, at cp/decl.cc:17281

2023-01-24 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108526

Bug ID: 108526
   Summary: [13 Regression] ICE in start_preparsed_function, at
cp/decl.cc:17281
   Product: gcc
   Version: 13.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gs...@t-online.de
  Target Milestone: ---

Started between 20220925 and 20221009 :


$ cat z1.cc
template void f()
{
  auto a = [] (auto x) static { return x; };
}
template void f();


$ g++-13-20230122 -c z1.cc -std=c++23
z1.cc: In instantiation of 'void f() [with  = int]':
z1.cc:5:22:   required from here
z1.cc:3:12: internal compiler error: in start_preparsed_function, at
cp/decl.cc:17281
3 |   auto a = [] (auto x) static { return x; };
  |^~~~
0x8f97a4 start_preparsed_function(tree_node*, tree_node*, int)
../../gcc/cp/decl.cc:17280
0x9740a4 start_lambda_function(tree_node*, tree_node*)
../../gcc/cp/lambda.cc:1671
0xac5400 tsubst_lambda_expr(tree_node*, tree_node*, int, tree_node*)
../../gcc/cp/pt.cc:20056
0xa8bc86 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*)
../../gcc/cp/pt.cc:21604
0xa94330 tsubst_expr(tree_node*, tree_node*, int, tree_node*)
../../gcc/cp/pt.cc:19764
0xa9b00e tsubst_expr(tree_node*, tree_node*, int, tree_node*)
../../gcc/cp/pt.cc:18711
0xa9b00e tsubst_init
../../gcc/cp/pt.cc:17007
0xa972ae tsubst_expr(tree_node*, tree_node*, int, tree_node*)
../../gcc/cp/pt.cc:18910
0xa9241e tsubst_expr(tree_node*, tree_node*, int, tree_node*)
../../gcc/cp/pt.cc:18725
0xa9127f tsubst_expr(tree_node*, tree_node*, int, tree_node*)
../../gcc/cp/pt.cc:19105
0xa9d6c6 tsubst_expr(tree_node*, tree_node*, int, tree_node*)
../../gcc/cp/pt.cc:18711
0xa9d6c6 instantiate_body
../../gcc/cp/pt.cc:26702
0xa9ec21 instantiate_decl(tree_node*, bool, bool)
../../gcc/cp/pt.cc:26992
0xadc5db instantiate_pending_templates(int)
../../gcc/cp/pt.cc:27070
0x939c39 c_parse_final_cleanups()
../../gcc/cp/decl2.cc:4953
0xbf0ac0 c_common_parse_file()
../../gcc/c-family/c-opts.cc:1266

[Bug c++/108525] New: [13 Regression] ICE in write_method_parms, at cp/mangle.cc:2864

2023-01-24 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108525

Bug ID: 108525
   Summary: [13 Regression] ICE in write_method_parms, at
cp/mangle.cc:2864
   Product: gcc
   Version: 13.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gs...@t-online.de
  Target Milestone: ---

Started between 20220925 and 20221009 :
(ok without "static")


$ cat z1.cc
auto b = [](...) static { return 1; };


$ g++-13-20230122 -c z1.cc -std=c++23
z1.cc:1:10: internal compiler error: Segmentation fault
1 | auto b = [](...) static { return 1; };
  |  ^
0xeb575f crash_signal
../../gcc/toplev.cc:314
0x871e8d write_method_parms
../../gcc/cp/mangle.cc:2864
0x86ea28 write_closure_type_name
../../gcc/cp/mangle.cc:1819
0x86ea28 write_unqualified_name
../../gcc/cp/mangle.cc:1511
0x876dd7 write_prefix
../../gcc/cp/mangle.cc:1257
0x86f764 write_nested_name
../../gcc/cp/mangle.cc:1167
0x872031 write_encoding
../../gcc/cp/mangle.cc:853
0x87212c write_mangled_name
../../gcc/cp/mangle.cc:799
0x8726e1 mangle_decl_string
../../gcc/cp/mangle.cc:4108
0x87290b get_mangled_id
../../gcc/cp/mangle.cc:4129
0x87290b mangle_decl(tree_node*)
../../gcc/cp/mangle.cc:4167
0x113e512 decl_assembler_name(tree_node*)
../../gcc/tree.cc:717
0xa9b23f symtab_node::get_comdat_group_id()
../../gcc/cgraph.h:254
0xa9b23f analyze_functions
../../gcc/cgraphunit.cc:1192
0xa9c3fd symbol_table::finalize_compilation_unit()
../../gcc/cgraphunit.cc:2547

[Bug c++/108504] New: [13 Regression] ICE in cp_lexer_handle_early_pragma, at cp/parser.cc:675

2023-01-23 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108504

Bug ID: 108504
   Summary: [13 Regression] ICE in cp_lexer_handle_early_pragma,
at cp/parser.cc:675
   Product: gcc
   Version: 13.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gs...@t-online.de
  Target Milestone: ---

Started between 20220703 and 20220710 :


$ cat z1.cc
"1"
#pragma omp target


$ g++-13-20230122 -c z1.cc -fopenmp
z1.cc:2:9: internal compiler error: in cp_lexer_handle_early_pragma, at
cp/parser.cc:675
2 | #pragma omp target
  | ^~~
0x90d288 cp_lexer_handle_early_pragma
../../gcc/cp/parser.cc:675
0x90d288 cp_lexer_new_main
../../gcc/cp/parser.cc:734
0x90d288 c_parse_file()
../../gcc/cp/parser.cc:49398
0x9f4e01 c_common_parse_file()
../../gcc/c-family/c-opts.cc:1248

[Bug c++/108503] New: [13 Regression] ICE in get_array_or_vector_nelts, at cp/constexpr.cc:4119

2023-01-23 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108503

Bug ID: 108503
   Summary: [13 Regression] ICE in get_array_or_vector_nelts, at
cp/constexpr.cc:4119
   Product: gcc
   Version: 13.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gs...@t-online.de
  Target Milestone: ---

Started between 20221127 and 20221204 :


$ cat z1.cc
namespace std {
  template struct tuple_size;
  template struct tuple_element;
}
struct A {
  template  int& get() { return 1; }
};
template<> struct std::tuple_size { static const int value = 3; };
template struct std::tuple_element { using type = int; };
struct B {
  A *begin();
  A *end();
};
void f (B a)
{
  #pragma omp for collapse(2)
  for (auto [i, j, k] : a)
for (int l = i; l < j; l += k)
  ;
}


$ g++-13-20230122 -c z1.cc -fopenmp -Wall
z1.cc: In member function 'int& A::get()':
z1.cc:6:40: error: cannot bind non-const lvalue reference of type 'int&' to an
rvalue of type 'int'
6 |   template  int& get() { return 1; }
  |^
z1.cc: In function 'void f(B)':
z1.cc:18:25: internal compiler error: in get_array_or_vector_nelts, at
cp/constexpr.cc:4119
   18 | for (int l = i; l < j; l += k)
  | ^
0x88770e get_array_or_vector_nelts
../../gcc/cp/constexpr.cc:4119
0x887804 eval_and_check_array_index
../../gcc/cp/constexpr.cc:4171
0x88b5e9 cxx_eval_array_reference
../../gcc/cp/constexpr.cc:4208
0x8826ed cxx_eval_constant_expression
../../gcc/cp/constexpr.cc:7516
0x880e9a cxx_eval_constant_expression
../../gcc/cp/constexpr.cc:7042
0x8837ac cxx_eval_indirect_ref
../../gcc/cp/constexpr.cc:5642
0x8837ac cxx_eval_constant_expression
../../gcc/cp/constexpr.cc:7358
0x88d3ba cxx_eval_outermost_constant_expr
../../gcc/cp/constexpr.cc:8252
0x892882 maybe_constant_value(tree_node*, tree_node*, bool)
../../gcc/cp/constexpr.cc:8527
0x956053 fold_for_warn(tree_node*)
../../gcc/cp/expr.cc:421
0xc1d801 warn_tautological_cmp(op_location_t const&, tree_code, tree_node*,
tree_node*)
../../gcc/c-family/c-warn.cc:485
0x84369b build_new_op(op_location_t const&, tree_code, int, tree_node*,
tree_node*, tree_node*, tree_node*, tree_node**, int)
../../gcc/cp/call.cc:7354
0xb485cd build_x_binary_op(op_location_t const&, tree_code, tree_node*,
tree_code, tree_node*, tree_code, tree_node*, tree_node**, int)
../../gcc/cp/typeck.cc:4722
0xa1c40f cp_parser_omp_for_cond
../../gcc/cp/parser.cc:42701
0xa1c40f cp_parser_omp_for_loop
../../gcc/cp/parser.cc:43652
0xa410f6 cp_parser_omp_for
../../gcc/cp/parser.cc:44005
0xa56f14 cp_parser_omp_construct
../../gcc/cp/parser.cc:48527
0xa20a7f cp_parser_pragma
../../gcc/cp/parser.cc:49207
0xa2740c cp_parser_statement
../../gcc/cp/parser.cc:12434
0xa28884 cp_parser_statement_seq_opt
../../gcc/cp/parser.cc:12909

[Bug fortran/108502] New: ICE in gfc_check_dependency, at fortran/dependency.cc:1295

2023-01-23 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108502

Bug ID: 108502
   Summary: ICE in gfc_check_dependency, at
fortran/dependency.cc:1295
   Product: gcc
   Version: 13.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gs...@t-online.de
  Target Milestone: ---

Affects versions down to at least r5 :


$ cat z1.f90
integer function n()
   integer :: a(1)
   a = [1] / 0
end
program p
   integer :: b = n()
end


$ cat z3.f90
integer function n()
   implicit none
   integer :: a(1)
   a = [1] / 0
   n = 1
end
program p
   implicit none
   integer :: n
   integer :: b = n()
end


$ cat z5.f90
integer function n()
   implicit none
   integer :: a(1)
   a = [1] / 0
   n = 1
end
program p
   integer, parameter :: b = n()
end


$ gfortran-13-20230122 -c z1.f90 -O2
f951: internal compiler error: Segmentation fault
0xdaa49f crash_signal
../../gcc/toplev.cc:314
0x86f6e1 gfc_check_dependency(gfc_expr*, gfc_expr*, bool)
../../gcc/fortran/dependency.cc:1295
0x86f70a gfc_check_dependency(gfc_expr*, gfc_expr*, bool)
../../gcc/fortran/dependency.cc:1298
0x90be8b optimize_assignment
../../gcc/fortran/frontend-passes.cc:1684
0x90be8b optimize_code
../../gcc/fortran/frontend-passes.cc:329
0x90f679 gfc_code_walker(gfc_code**, int (*)(gfc_code**, int*, void*), int
(*)(gfc_expr**, int*, void*), void*)
../../gcc/fortran/frontend-passes.cc:5352
0x910a2a optimize_namespace
../../gcc/fortran/frontend-passes.cc:1479
0x910e7f gfc_run_passes(gfc_namespace*)
../../gcc/fortran/frontend-passes.cc:169
0x8417a8 gfc_resolve(gfc_namespace*)
../../gcc/fortran/resolve.cc:17673
0x841bab gfc_resolve(gfc_namespace*)
../../gcc/fortran/resolve.cc:2635
0x841bab resolve_global_procedure
../../gcc/fortran/resolve.cc:2637
0x838a66 resolve_function
../../gcc/fortran/resolve.cc:3306
0x838a66 gfc_resolve_expr(gfc_expr*)
../../gcc/fortran/resolve.cc:7195
0x7c77a4 gfc_reduce_init_expr(gfc_expr*)
../../gcc/fortran/expr.cc:3168
0x7ca700 gfc_match_init_expr(gfc_expr**)
../../gcc/fortran/expr.cc:3216
0x7b442b variable_decl
../../gcc/fortran/decl.cc:3036
0x7b442b gfc_match_data_decl()
../../gcc/fortran/decl.cc:6343
0x8215d3 match_word
../../gcc/fortran/parse.cc:67
0x8215d3 decode_statement
../../gcc/fortran/parse.cc:378
0x82301a next_free
../../gcc/fortran/parse.cc:1403

[Bug fortran/108501] New: [13 Regression] ICE in get_expr_storage_size, at fortran/interface.cc:2941

2023-01-23 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108501

Bug ID: 108501
   Summary: [13 Regression] ICE in get_expr_storage_size, at
fortran/interface.cc:2941
   Product: gcc
   Version: 13.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gs...@t-online.de
  Target Milestone: ---

Started between 20221218 and 20230108 :


$ cat z1.f90
program p
   real, parameter :: n = 2
   real :: a(1,(n),2)
   call s(a(:,:,1))
end
subroutine s(x)
   real :: x(2)
end


$ gfortran-13-20230122 -c z1.f90
z1.f90:3:15:

3 |real :: a(1,(n),2)
  |   1
Error: Expression at (1) must be of INTEGER type, found REAL
z1.f90:3:21:

3 |real :: a(1,(n),2)
  | 1
Error: The module or main program array 'a' at (1) must have constant shape
f951: internal compiler error: Segmentation fault
0xf8a79f crash_signal
../../gcc/toplev.cc:314
0x848fd9 get_expr_storage_size
../../gcc/fortran/interface.cc:2941
0x848fd9 gfc_compare_actual_formal(gfc_actual_arglist**, gfc_formal_arglist*,
int, int, bool, locus*)
../../gcc/fortran/interface.cc:3327
0x9b3136 check_externals_procedure
../../gcc/fortran/frontend-passes.cc:5742
0x9b7e29 gfc_code_walker(gfc_code**, int (*)(gfc_code**, int*, void*), int
(*)(gfc_expr**, int*, void*), void*)
../../gcc/fortran/frontend-passes.cc:5352
0x9b968b gfc_check_externals0
../../gcc/fortran/frontend-passes.cc:5861
0x9ba614 gfc_check_externals(gfc_namespace*)
../../gcc/fortran/frontend-passes.cc:5883
0x89f2c0 gfc_parse_file()
../../gcc/fortran/parse.cc:6942
0x8edd9f gfc_be_parse_file
../../gcc/fortran/f95-lang.cc:229

[Bug fortran/108454] New: ICE in gfc_trans_common, at fortran/trans-common.cc:1385

2023-01-18 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108454

Bug ID: 108454
   Summary: ICE in gfc_trans_common, at
fortran/trans-common.cc:1385
   Product: gcc
   Version: 13.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gs...@t-online.de
  Target Milestone: ---

Affects versions down to at least r5 :


$ cat z1.f90
module m
   type t
   end type
contains
   subroutine s
  common t
   end
end


$ cat z3.f90
module m
   type t
   end type
contains
   subroutine s
  type(t) :: x
  common t
   end
end


$ cat z4.f90
module m
   type t
   end type
contains
   subroutine s(x)
  class(t) :: x
  common t
   end
end


$ gfortran-13-20230115 -c z1.f90
z1.f90:8:3:

8 | end
  |   1
internal compiler error: Segmentation fault
0xda7faf crash_signal
../../gcc/toplev.cc:314
0x897730 gfc_trans_common(gfc_namespace*)
../../gcc/fortran/trans-common.cc:1385
0x8a7229 gfc_generate_function_code(gfc_namespace*)
../../gcc/fortran/trans-decl.cc:7523
0x87e7d9 gfc_generate_module_code(gfc_namespace*)
../../gcc/fortran/trans.cc:2370
0x82926f translate_all_program_units
../../gcc/fortran/parse.cc:6708
0x82926f gfc_parse_file()
../../gcc/fortran/parse.cc:7027
0x876eff gfc_be_parse_file
../../gcc/fortran/f95-lang.cc:229

[Bug fortran/108453] New: [10/11/12/13 Regression] ICE in gfc_trans_use_stmts, at fortran/trans-decl.cc:5361

2023-01-18 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108453

Bug ID: 108453
   Summary: [10/11/12/13 Regression] ICE in gfc_trans_use_stmts,
at fortran/trans-decl.cc:5361
   Product: gcc
   Version: 13.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gs...@t-online.de
  Target Milestone: ---

Started with r6 :


$ cat z1.f90
module m
   type t
   end type
end
program p
   use m, only: t
   common t
end


$ cat z2.f90
module m
   type t
   end type
end
program p
   use m, only: t
   common /xc/ t
end


$ cat z3.f90
module m
   type t
   end type
end
program p
   use m
   common t
end


$ gfortran-5 -c z3.f90
z3.f90:7:11:

common t
   1
Error: Cannot change attributes of USE-associated symbol t at (1)


$ gfortran-13-20230115 -c z3.f90
$
$ gfortran-13-20230115 -c z1.f90
z1.f90:6:7:

6 |use m, only: t
  |   1
internal compiler error: in gfc_trans_use_stmts, at fortran/trans-decl.cc:5361
0x8a707e gfc_trans_use_stmts
../../gcc/fortran/trans-decl.cc:5360
0x8a783b gfc_generate_function_code(gfc_namespace*)
../../gcc/fortran/trans-decl.cc:7837
0x82968e translate_all_program_units
../../gcc/fortran/parse.cc:6721
0x82968e gfc_parse_file()
../../gcc/fortran/parse.cc:7027
0x876eff gfc_be_parse_file
../../gcc/fortran/f95-lang.cc:229

[Bug fortran/108452] New: ICE in gfc_trans_use_stmts, at fortran/trans-decl.cc:5347

2023-01-18 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108452

Bug ID: 108452
   Summary: ICE in gfc_trans_use_stmts, at
fortran/trans-decl.cc:5347
   Product: gcc
   Version: 13.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gs...@t-online.de
  Target Milestone: ---

Affects versions down to at least r5 :


$ cat z1.f90
module m
   interface g
  procedure f
   end interface
contains
   function f()
   end
end
program p
   use m, u => g, v => g
end


$ cat z2.f90
module m
   interface g
  procedure f
   end interface
contains
   function f()
   end
end
program p
   use m, u => g
end


$ gfortran-13-20230115 -c z2.f90
$
$ gfortran-13-20230115 -c z1.f90
z1.f90:10:7:

   10 |use m, u => g, v => g
  |   1
internal compiler error: in gfc_trans_use_stmts, at fortran/trans-decl.cc:5347
0x8a6fd3 gfc_trans_use_stmts
../../gcc/fortran/trans-decl.cc:5347
0x8a783b gfc_generate_function_code(gfc_namespace*)
../../gcc/fortran/trans-decl.cc:7837
0x82968e translate_all_program_units
../../gcc/fortran/parse.cc:6721
0x82968e gfc_parse_file()
../../gcc/fortran/parse.cc:7027
0x876eff gfc_be_parse_file
../../gcc/fortran/f95-lang.cc:229

[Bug fortran/108451] [13 Regression] ICE in check_complete_insertion, at hash-table.h:578

2023-01-18 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108451

G. Steinmetz  changed:

   What|Removed |Added

   Keywords||accepts-invalid,
   ||ice-on-invalid-code

--- Comment #1 from G. Steinmetz  ---

Following variant z2 should be rejected similar to z3 :


$ cat z2.f90
module m
   type t(n)
  integer, len :: n
  integer :: a(n)
   end type
contains
   subroutine s(x)
  type(t(2)) :: x
   end
end
program p
   use m, only: t, s, pdtt
   type(t(2)) :: y
   call s(y)
end


$ cat z3.f90
module m
   type t
   end type
contains
   subroutine s
   end
end
program p
   use m, only: t, s, pdtt
   call s
end


$ gfortran-13-20230115 -c z2.f90   # missing error
$
$ gfortran-13-20230115 -c z3.f90
z3.f90:9:21:

9 |use m, only: t, s, pdtt
  | 1
Error: Symbol 'pdtt' referenced at (1) not found in module 'm'

[Bug fortran/108451] New: [13 Regression] ICE in check_complete_insertion, at hash-table.h:578

2023-01-18 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108451

Bug ID: 108451
   Summary: [13 Regression] ICE in check_complete_insertion, at
hash-table.h:578
   Product: gcc
   Version: 13.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gs...@t-online.de
  Target Milestone: ---

Started recently between 20221218 and 20230108, with special name pdtt :
(gcc configured with --enable-checking=yes)


$ cat z1.f90
module m
   type t(n)
  integer, len :: n
  integer :: a(n)
   end type
contains
   subroutine s(x)
  type(t(2)) :: x
   end
end
program p
   use m, only: t, pdtt, s
   type(t(2)) :: y
   call s(y)
end


$ gfortran-13-20221218 -c z1.f90   # missing error
$
$ gfortran-13-20230115 -c z1.f90
z1.f90:12:7:

   12 |use m, only: t, pdtt, s
  |   1
internal compiler error: in check_complete_insertion, at hash-table.h:578
0x92fc0b hash_table::check_complete_insertion() const
../../gcc/hash-table.h:578
0x92fc0b hash_table::find_slot_with_hash(char const* const&, unsigned int,
insert_option)
../../gcc/hash-table.h:1042
0x92c57e gfc_trans_use_stmts
../../gcc/fortran/trans-decl.cc:5329
0x92d3a6 gfc_generate_function_code(gfc_namespace*)
../../gcc/fortran/trans-decl.cc:7837
0x89ef8e translate_all_program_units
../../gcc/fortran/parse.cc:6721
0x89ef8e gfc_parse_file()
../../gcc/fortran/parse.cc:7027
0x8ed3af gfc_be_parse_file
../../gcc/fortran/f95-lang.cc:229

[Bug fortran/108450] New: [12/13 Regression] ICE in sort_actual, at fortran/intrinsic.cc:4380

2023-01-18 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108450

Bug ID: 108450
   Summary: [12/13 Regression] ICE in sort_actual, at
fortran/intrinsic.cc:4380
   Product: gcc
   Version: 13.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gs...@t-online.de
  Target Milestone: ---

Started between 20211128 and 20211205 :


$ cat z1.f90
program p
   integer :: a(8) = 0
   integer :: l
   integer :: n
   !$omp atomic
   n = maxloc(a, mask=l)
end


$ cat z2.f90
program p
   integer :: a(8) = 0
   logical :: l
   integer :: n(1)
   !$omp atomic
   n = maxloc(a, mask=l)
end


$ gfortran-13-20230115 -c z2.f90 -fopenmp
z2.f90:6:3:

6 |n = maxloc(a, mask=l)
  |   1
Error: !$OMP ATOMIC statement must set a scalar variable of intrinsic type at
(1)


$ gfortran-13-20230115 -c z1.f90 -fopenmp
z1.f90:6:22:

6 |n = maxloc(a, mask=l)
  |  1
Error: 'mask' argument of 'maxloc' intrinsic at (1) must be LOGICAL
f951: internal compiler error: Segmentation fault
0xf8734f crash_signal
../../gcc/toplev.cc:314
0x84f083 sort_actual
../../gcc/fortran/intrinsic.cc:4380
0x84f2d4 check_specific
../../gcc/fortran/intrinsic.cc:4774
0x8574c4 gfc_intrinsic_func_interface(gfc_expr*, int)
../../gcc/fortran/intrinsic.cc:5042
0x8aeb18 resolve_unknown_f
../../gcc/fortran/resolve.cc:2990
0x8aeb18 resolve_function
../../gcc/fortran/resolve.cc:3347
0x8aeb18 gfc_resolve_expr(gfc_expr*)
../../gcc/fortran/resolve.cc:7195
0x8806a4 resolve_omp_atomic
../../gcc/fortran/openmp.cc:8699
0x88de6c gfc_resolve_omp_directive(gfc_code*, gfc_namespace*)
../../gcc/fortran/openmp.cc:10190
0x8b48ab gfc_resolve_code(gfc_code*, gfc_namespace*)
../../gcc/fortran/resolve.cc:12444
0x8b69e7 resolve_codes
../../gcc/fortran/resolve.cc:17629
0x8b6aae gfc_resolve(gfc_namespace*)
../../gcc/fortran/resolve.cc:17664
0x89e844 resolve_all_program_units
../../gcc/fortran/parse.cc:6656
0x89e844 gfc_parse_file()
../../gcc/fortran/parse.cc:6912
0x8ed3af gfc_be_parse_file
../../gcc/fortran/f95-lang.cc:229

[Bug c/108449] New: [13 Regression] ICE in eliminate_unnecessary_stmts, at tree-ssa-dce.cc:1512

2023-01-18 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108449

Bug ID: 108449
   Summary: [13 Regression] ICE in eliminate_unnecessary_stmts, at
tree-ssa-dce.cc:1512
   Product: gcc
   Version: 13.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gs...@t-online.de
  Target Milestone: ---

Started between 20220904 and 20220911, at -O1+ :


$ cat z1.c
static int vfork();
void f() { vfork(); }


$ gcc-13-20230115 -c z1.c -O2
z1.c:1:12: warning: 'vfork' used but never defined
1 | static int vfork();
  |^
during GIMPLE pass: cddce
z1.c: In function 'f':
z1.c:2:1: internal compiler error: in eliminate_unnecessary_stmts, at
tree-ssa-dce.cc:1512
2 | void f() { vfork(); }
  | ^~~~
0xe0f0dc eliminate_unnecessary_stmts
../../gcc/tree-ssa-dce.cc:1512
0xe108bf perform_tree_ssa_dce
../../gcc/tree-ssa-dce.cc:1945
0xe11e55 tree_ssa_cd_dce
../../gcc/tree-ssa-dce.cc:1986
0xe11e55 execute
../../gcc/tree-ssa-dce.cc:2069

[Bug c++/108438] New: [10/11/12/13 Regression] ICE in cxx_eval_constant_expression, at cp/constexpr.cc:7611

2023-01-17 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108438

Bug ID: 108438
   Summary: [10/11/12/13 Regression] ICE in
cxx_eval_constant_expression, at cp/constexpr.cc:7611
   Product: gcc
   Version: 13.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gs...@t-online.de
  Target Milestone: ---

Started with r6 and -Wall :


$ cat z1.cc
template 
T foo (T arg, T& ref, T* ptr)
{
  int a = 1;
  return static_cast(a);
}


$ g++-13-20230115 -c z1.cc -Wall
z1.cc: In function 'T foo(T, T&, T*)':
z1.cc:5:23: error: expected '>' before '!' token
5 |   return static_cast(a);
  |   ^
z1.cc:5:23: error: expected '(' before '!' token
5 |   return static_cast(a);
  |   ^
  |   (
z1.cc:5:24: error: expected primary-expression before '>' token
5 |   return static_cast(a);
  |^
z1.cc:5:27: internal compiler error: in cxx_eval_constant_expression, at
cp/constexpr.cc:7611
5 |   return static_cast(a);
  |   ^
0x883b61 cxx_eval_constant_expression
../../gcc/cp/constexpr.cc:7611
0x88c97a cxx_eval_outermost_constant_expr
../../gcc/cp/constexpr.cc:8252
0x891e42 maybe_constant_value(tree_node*, tree_node*, bool)
../../gcc/cp/constexpr.cc:8527
0xa11806 cp_parser_binary_expression
../../gcc/cp/parser.cc:10233
0xa11da4 cp_parser_assignment_expression
../../gcc/cp/parser.cc:10444
0xa14362 cp_parser_expression
../../gcc/cp/parser.cc:10614
0xa2b843 cp_parser_postfix_expression
../../gcc/cp/parser.cc:7356
0xa44ddf cp_parser_unary_expression
../../gcc/cp/parser.cc:9095
0xa106ef cp_parser_cast_expression
../../gcc/cp/parser.cc:
0xa1101f cp_parser_binary_expression
../../gcc/cp/parser.cc:10101
0xa11da4 cp_parser_assignment_expression
../../gcc/cp/parser.cc:10444
0xa14362 cp_parser_expression
../../gcc/cp/parser.cc:10614
0xa27806 cp_parser_jump_statement
../../gcc/cp/parser.cc:14359
0xa27806 cp_parser_statement
../../gcc/cp/parser.cc:12335
0xa27de4 cp_parser_statement_seq_opt
../../gcc/cp/parser.cc:12909
0xa27ec7 cp_parser_compound_statement
../../gcc/cp/parser.cc:12861
0xa51d90 cp_parser_function_body
../../gcc/cp/parser.cc:25280
0xa51d90 cp_parser_ctor_initializer_opt_and_function_body
../../gcc/cp/parser.cc:25331
0xa5240a cp_parser_function_definition_after_declarator
../../gcc/cp/parser.cc:31953
0xa5393c cp_parser_function_definition_from_specifiers_and_declarator
../../gcc/cp/parser.cc:31870

[Bug c++/108437] New: [13 Regression] ICE in build_min_non_dep_op_overload, at cp/tree.cc:3710

2023-01-17 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108437

Bug ID: 108437
   Summary: [13 Regression] ICE in build_min_non_dep_op_overload,
at cp/tree.cc:3710
   Product: gcc
   Version: 13.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gs...@t-online.de
  Target Milestone: ---

Started between 20221106 and 20221120, with -std=c++23 :


$ cat z1.cc
struct S
{
  static int operator[] (int x) { int a[2]; return a[x]; }
};
template int f ()
{
  S s;
  s[0]++;
  return 0;
}


$ g++-13-20230115 -c z1.cc -std=c++23
z1.cc: In function 'int f()':
z1.cc:8:6: internal compiler error: in build_min_non_dep_op_overload, at
cp/tree.cc:3710
8 |   s[0]++;
  |  ^
0xb397f7 build_min_non_dep_op_overload(tree_code, tree_node*, tree_node*, ...)
../../gcc/cp/tree.cc:3710
0x92b620 grok_array_decl(unsigned int, tree_node*, tree_node*, vec**, int)
../../gcc/cp/decl2.cc:577
0xa17963 cp_parser_postfix_open_square_expression
../../gcc/cp/parser.cc:8177
0xa2b2de cp_parser_postfix_expression
../../gcc/cp/parser.cc:7768
0xa44ddf cp_parser_unary_expression
../../gcc/cp/parser.cc:9095
0xa106ef cp_parser_cast_expression
../../gcc/cp/parser.cc:
0xa1101f cp_parser_binary_expression
../../gcc/cp/parser.cc:10101
0xa11da4 cp_parser_assignment_expression
../../gcc/cp/parser.cc:10444
0xa14362 cp_parser_expression
../../gcc/cp/parser.cc:10614
0xa18577 cp_parser_expression_statement
../../gcc/cp/parser.cc:12758
0xa26ae1 cp_parser_statement
../../gcc/cp/parser.cc:12538
0xa27de4 cp_parser_statement_seq_opt
../../gcc/cp/parser.cc:12909
0xa27ec7 cp_parser_compound_statement
../../gcc/cp/parser.cc:12861
0xa51d90 cp_parser_function_body
../../gcc/cp/parser.cc:25280
0xa51d90 cp_parser_ctor_initializer_opt_and_function_body
../../gcc/cp/parser.cc:25331
0xa5240a cp_parser_function_definition_after_declarator
../../gcc/cp/parser.cc:31953
0xa5393c cp_parser_function_definition_from_specifiers_and_declarator
../../gcc/cp/parser.cc:31870
0xa5393c cp_parser_init_declarator
../../gcc/cp/parser.cc:22734
0xa5713f cp_parser_single_declaration
../../gcc/cp/parser.cc:32470
0xa572a6 cp_parser_template_declaration_after_parameters
../../gcc/cp/parser.cc:32023

[Bug c/108436] New: [13 Regression] ICE in gen_prefetch, at config/i386/i386.md:24155

2023-01-17 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108436

Bug ID: 108436
   Summary: [13 Regression] ICE in gen_prefetch, at
config/i386/i386.md:24155
   Product: gcc
   Version: 13.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gs...@t-online.de
  Target Milestone: ---

Started between 20221106 and 20221120 :


$ cat z1.c
#include 
void* p;
void extern
prefetch_test (void)
{
  __builtin_ia32_prefetch (p, 0, 4, 0);
}


$ gcc-13-20230115 -c z1.c
during RTL pass: expand
z1.c: In function 'prefetch_test':
z1.c:6:3: internal compiler error: in gen_prefetch, at
config/i386/i386.md:24155
6 |   __builtin_ia32_prefetch (p, 0, 4, 0);
  |   ^~~~
0x154cfec gen_prefetch(rtx_def*, rtx_def*, rtx_def*)
../../gcc/config/i386/i386.md:24155
0x10edffe ix86_expand_builtin(tree_node*, rtx_def*, rtx_def*, machine_mode,
int)
../../gcc/config/i386/i386-expand.cc:13200
0x88cc9b expand_builtin(tree_node*, rtx_def*, rtx_def*, machine_mode, int)
../../gcc/builtins.cc:7321
0x9b3ef0 expand_expr_real_1(tree_node*, rtx_def*, machine_mode,
expand_modifier, rtx_def**, bool)
../../gcc/expr.cc:11872
0x8af731 expand_expr
../../gcc/expr.h:310
0x8af731 expand_call_stmt
../../gcc/cfgexpand.cc:2831
0x8af731 expand_gimple_stmt_1
../../gcc/cfgexpand.cc:3880
0x8af731 expand_gimple_stmt
../../gcc/cfgexpand.cc:4044
0x8b4307 expand_gimple_basic_block
../../gcc/cfgexpand.cc:6096
0x8b6dce execute
../../gcc/cfgexpand.cc:6831

[Bug fortran/108435] New: [13 Regression] ICE in as_a, at is-a.h:242

2023-01-17 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108435

Bug ID: 108435
   Summary: [13 Regression] ICE in as_a, at is-a.h:242
   Product: gcc
   Version: 13.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gs...@t-online.de
  Target Milestone: ---

Started between 20220501 and 20220508 :
(gcc configured with --enable-checking=yes)


$ cat z1.f90
program p
   integer :: j
contains
   subroutine s
  integer :: i
  !$omp do simd collapse(2)
  do i = 1, 16
 do j = 1, i
 end do
  end do
   end
end


$ cat z2.f90
program p
contains
   subroutine s
  integer :: i, j
  !$omp do simd collapse(2)
  do i = 1, 16
 do j = 1, i
 end do
  end do
   end
end


$ gfortran-13-20230115 -c z2.f90 -fopenmp
$
$ gfortran-13-20230115 -c z1.f90 -fopenmp
z1.f90:1:9:

1 | program p
  | ^
internal compiler error: in as_a, at is-a.h:242
0xc3aeba gbind* as_a(gimple*)
../../gcc/is-a.h:242
0xc3aeba declare_vars(tree_node*, gimple*, bool)
../../gcc/gimplify.cc:697
0x1053aa7 convert_nonlocal_omp_clauses
../../gcc/tree-nested.cc:1590
0x10546d2 convert_nonlocal_reference_stmt
../../gcc/tree-nested.cc:1716
0xc34366 walk_gimple_stmt(gimple_stmt_iterator*, tree_node*
(*)(gimple_stmt_iterator*, bool*, walk_stmt_info*), tree_node* (*)(tree_node**,
int*, void*), walk_stmt_info*)
../../gcc/gimple-walk.cc:608
0xc34580 walk_gimple_seq_mod(gimple**, tree_node* (*)(gimple_stmt_iterator*,
bool*, walk_stmt_info*), tree_node* (*)(tree_node**, int*, void*),
walk_stmt_info*)
../../gcc/gimple-walk.cc:51
0xc34421 walk_gimple_stmt(gimple_stmt_iterator*, tree_node*
(*)(gimple_stmt_iterator*, bool*, walk_stmt_info*), tree_node* (*)(tree_node**,
int*, void*), walk_stmt_info*)
../../gcc/gimple-walk.cc:635
0xc34580 walk_gimple_seq_mod(gimple**, tree_node* (*)(gimple_stmt_iterator*,
bool*, walk_stmt_info*), tree_node* (*)(tree_node**, int*, void*),
walk_stmt_info*)
../../gcc/gimple-walk.cc:51
0x104c788 walk_body
../../gcc/tree-nested.cc:811
0x1054616 convert_nonlocal_reference_stmt
../../gcc/tree-nested.cc:1752
0xc34366 walk_gimple_stmt(gimple_stmt_iterator*, tree_node*
(*)(gimple_stmt_iterator*, bool*, walk_stmt_info*), tree_node* (*)(tree_node**,
int*, void*), walk_stmt_info*)
../../gcc/gimple-walk.cc:608
0xc34580 walk_gimple_seq_mod(gimple**, tree_node* (*)(gimple_stmt_iterator*,
bool*, walk_stmt_info*), tree_node* (*)(tree_node**, int*, void*),
walk_stmt_info*)
../../gcc/gimple-walk.cc:51
0xc34421 walk_gimple_stmt(gimple_stmt_iterator*, tree_node*
(*)(gimple_stmt_iterator*, bool*, walk_stmt_info*), tree_node* (*)(tree_node**,
int*, void*), walk_stmt_info*)
../../gcc/gimple-walk.cc:635
0xc34580 walk_gimple_seq_mod(gimple**, tree_node* (*)(gimple_stmt_iterator*,
bool*, walk_stmt_info*), tree_node* (*)(tree_node**, int*, void*),
walk_stmt_info*)
../../gcc/gimple-walk.cc:51
0xc34421 walk_gimple_stmt(gimple_stmt_iterator*, tree_node*
(*)(gimple_stmt_iterator*, bool*, walk_stmt_info*), tree_node* (*)(tree_node**,
int*, void*), walk_stmt_info*)
../../gcc/gimple-walk.cc:635
0xc34580 walk_gimple_seq_mod(gimple**, tree_node* (*)(gimple_stmt_iterator*,
bool*, walk_stmt_info*), tree_node* (*)(tree_node**, int*, void*),
walk_stmt_info*)
../../gcc/gimple-walk.cc:51
0x104c788 walk_body
../../gcc/tree-nested.cc:811
0x104c7d8 walk_function
../../gcc/tree-nested.cc:822
0x104c7d8 walk_all_functions
../../gcc/tree-nested.cc:887
0x10583b4 lower_nested_functions(tree_node*)
../../gcc/tree-nested.cc:3736

[Bug fortran/108434] New: [12/13 Regression] ICE in class_allocatable, at fortran/expr.cc:5000

2023-01-17 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108434

Bug ID: 108434
   Summary: [12/13 Regression] ICE in class_allocatable, at
fortran/expr.cc:5000
   Product: gcc
   Version: 13.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gs...@t-online.de
  Target Milestone: ---

Started between 20210905 and 20211121 :
(with -g or a combination of -Wall -g -O2 -fopenmp -fopenacc)


$ cat z1.f90
program p
   type t
  class(c), pointer :: a(2)
   end type
   class(t), allocatable :: x
   class(t), pointer :: y
end


$ cat z2.f90
program p
   type t
  class(c), pointer :: a(2)
   end type
   class(t), pointer :: y
   class(t), allocatable :: x
end


$ gfortran-13-20230115 -c z2.f90 -g
z2.f90:3:31:

3 |   class(c), pointer :: a(2)
  |   1
Error: Pointer array component of structure at (1) must have a deferred shape
f951: internal compiler error: Segmentation fault
0xf8734f crash_signal
../../gcc/toplev.cc:314
0x83e346 class_allocatable
../../gcc/fortran/expr.cc:5000
0x83e346 comp_allocatable
../../gcc/fortran/expr.cc:5013
0x83e346 gfc_generate_initializer(gfc_typespec*, bool)
../../gcc/fortran/expr.cc:5157
0x8139d5 gfc_find_derived_vtab(gfc_symbol*)
../../gcc/fortran/class.cc:2460
0x8bea8d resolve_fl_derived
../../gcc/fortran/resolve.cc:15210
0x8b8057 resolve_symbol
../../gcc/fortran/resolve.cc:15595
0x8d7472 do_traverse_symtree
../../gcc/fortran/symbol.cc:4186
0x8bb624 resolve_types
../../gcc/fortran/resolve.cc:17547
0x8b6a9c gfc_resolve(gfc_namespace*)
../../gcc/fortran/resolve.cc:17662
0x89e844 resolve_all_program_units
../../gcc/fortran/parse.cc:6656
0x89e844 gfc_parse_file()
../../gcc/fortran/parse.cc:6912
0x8ed3af gfc_be_parse_file
../../gcc/fortran/f95-lang.cc:229

[Bug c/108424] New: [13 Regression] ICE in perform_integral_promotions, at c/c-typeck.cc:2277

2023-01-16 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108424

Bug ID: 108424
   Summary: [13 Regression] ICE in perform_integral_promotions, at
c/c-typeck.cc:2277
   Product: gcc
   Version: 13.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gs...@t-online.de
  Target Milestone: ---

Started between 20220821 and 20220828, with -std=c2x :


$ cat z1.c
void f (int n)
{
  switch (n) {
  case nullptr:
  default:
  }
}


$ cat z2.c
void f (int n)
{
  switch (n) {
  case nullptr:
  case 1:
  }
  return;
}


$ gcc-13-20230115 -c z1.c -std=c2x
z1.c: In function 'f':
z1.c:4:3: internal compiler error: in perform_integral_promotions, at
c/c-typeck.cc:2277
4 |   case nullptr:
  |   ^~~~
0x795f60 perform_integral_promotions(tree_node*)
../../gcc/c/c-typeck.cc:2277
0x7f1987 check_case_value
../../gcc/c-family/c-common.cc:2243
0x8269fd c_add_case_label(unsigned int, splay_tree_s*, tree_node*, tree_node*,
tree_node*, tree_node*)
../../gcc/c-family/c-common.cc:5092
0x798436 do_case(unsigned int, tree_node*, tree_node*, tree_node*)
../../gcc/c/c-typeck.cc:11561
0x7d3ab6 c_parser_label
../../gcc/c/c-parser.cc:6394
0x7de9f5 c_parser_compound_statement_nostart
../../gcc/c/c-parser.cc:6207
0x7def03 c_parser_compound_statement
../../gcc/c/c-parser.cc:6117
0x7dc522 c_parser_statement_after_labels
../../gcc/c/c-parser.cc:6628
0x7e28e2 c_parser_statement
../../gcc/c/c-parser.cc:6599
0x7e28e2 c_parser_c99_block_statement
../../gcc/c/c-parser.cc:6858
0x7dca53 c_parser_switch_statement
../../gcc/c/c-parser.cc:7120
0x7dca53 c_parser_statement_after_labels
../../gcc/c/c-parser.cc:6637
0x7de68a c_parser_compound_statement_nostart
../../gcc/c/c-parser.cc:6308
0x7def03 c_parser_compound_statement
../../gcc/c/c-parser.cc:6117
0x7e0f13 c_parser_declaration_or_fndef
../../gcc/c/c-parser.cc:2853
0x7e869f c_parser_external_declaration
../../gcc/c/c-parser.cc:1925
0x7e8fdd c_parser_translation_unit
../../gcc/c/c-parser.cc:1779
0x7e8fdd c_parse_file()
../../gcc/c/c-parser.cc:24602
0x847651 c_common_parse_file()
../../gcc/c-family/c-opts.cc:1248

[Bug c/108423] New: [12/13 Regression] ICE in make_ssa_name_fn, at tree-ssanames.cc:360

2023-01-16 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108423

Bug ID: 108423
   Summary: [12/13 Regression] ICE in make_ssa_name_fn, at
tree-ssanames.cc:360
   Product: gcc
   Version: 13.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gs...@t-online.de
  Target Milestone: ---

Started between 2024 and 20211121, at -O2+ :


$ cat z1.c
int f (int n, int (**(*a)(void))[n])
{
  return (*a())[0];
}
int g ()
{
  int m = 3;
  int (*a[m])(void);
  return f(m, );
}


$ gcc-13-20230115 -c z1.c -O2
z1.c: In function 'f':
z1.c:3:10: warning: returning 'int *' from a function with return type 'int'
makes integer from pointer without a cast [-Wint-conversion]
3 |   return (*a())[0];
  |  ^
z1.c: In function 'g':
z1.c:9:15: warning: passing argument 2 of 'f' from incompatible pointer type
[-Wincompatible-pointer-types]
9 |   return f(m, );
  |   ^~
  |   |
  |   int (* (*)[m])(void)
z1.c:1:24: note: expected 'int (** (*)(void))[n]' but argument is of type 'int
(* (*)[m])(void)'
1 | int f (int n, int (**(*a)(void))[n])
  |   ~^~~~
during GIMPLE pass: einline
z1.c:9:10: internal compiler error: in make_ssa_name_fn, at
tree-ssanames.cc:360
9 |   return f(m, );
  |  ^~~~
0x11b1edd make_ssa_name_fn(function*, tree_node*, gimple*, unsigned int)
../../gcc/tree-ssanames.cc:357
0xfa16f6 make_ssa_name
../../gcc/tree-ssanames.h:97
0xfa16f6 remap_ssa_name
../../gcc/tree-inline.cc:237
0xfa5717 copy_tree_body_r(tree_node**, int*, void*)
../../gcc/tree-inline.cc:1226
0x1271d23 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/tree.cc:11289
0x1272784 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/tree.cc:11520
0xf9e851 remap_type_1
../../gcc/tree-inline.cc:596
0xf9fa28 remap_type(tree_node*, copy_body_data*)
../../gcc/tree-inline.cc:713
0xf9e6b7 remap_type_1
../../gcc/tree-inline.cc:425
0xf9fa28 remap_type(tree_node*, copy_body_data*)
../../gcc/tree-inline.cc:713
0xf9e6b7 remap_type_1
../../gcc/tree-inline.cc:425
0xf9fa28 remap_type(tree_node*, copy_body_data*)
../../gcc/tree-inline.cc:713
0xf9e7bf remap_type_1
../../gcc/tree-inline.cc:509
0xf9fa28 remap_type(tree_node*, copy_body_data*)
../../gcc/tree-inline.cc:713
0xf9e6b7 remap_type_1
../../gcc/tree-inline.cc:425
0xf9fa28 remap_type(tree_node*, copy_body_data*)
../../gcc/tree-inline.cc:713
0xfacb69 initialize_inlined_parameters
../../gcc/tree-inline.cc:3642
0xfacb69 expand_call_inline
../../gcc/tree-inline.cc:5004
0xfaf1e9 gimple_expand_calls_inline
../../gcc/tree-inline.cc:5307
0xfaf1e9 optimize_inline_calls(tree_node*)
../../gcc/tree-inline.cc:5479

[Bug c++/108422] New: [13 Regression] ICE: base pointer cycle detected

2023-01-16 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108422

Bug ID: 108422
   Summary: [13 Regression] ICE: base pointer cycle detected
   Product: gcc
   Version: 13.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gs...@t-online.de
  Target Milestone: ---

Started between 20220911 and 20220918 :


$ cat z1.cc
void foo (int a)
{
  auto bar = [&]()
  {
#pragma omp target parallel
#pragma omp target
++a;
  };
  bar();
}


$ cat z2.cc
void foo (int a)
{
  auto bar = [&]()
  {
#pragma omp target
#pragma omp target
++a;
  };
  bar();
}


$ g++-13-20230115 -c z1.cc -fopenmp
when processing group:
map(to:*__closure)
z1.cc: In lambda function:
z1.cc:5:13: internal compiler error: base pointer cycle detected
5 | #pragma omp target parallel
  | ^~~
0xc0a6f3 omp_tsort_mapping_groups_1
../../gcc/gimplify.cc:9603
0xc0a515 omp_tsort_mapping_groups_1
../../gcc/gimplify.cc:9646
0xc0a515 omp_tsort_mapping_groups_1
../../gcc/gimplify.cc:9646
0xc1ee00 omp_tsort_mapping_groups
../../gcc/gimplify.cc:9684
0xc1ee00 gimplify_scan_omp_clauses
../../gcc/gimplify.cc:10771
0xc24fce gimplify_omp_workshare
../../gcc/gimplify.cc:15390
0xc10cca gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc/gimplify.cc:16903
0xc14308 gimplify_stmt(tree_node**, gimple**)
../../gcc/gimplify.cc:7219
0xc14861 gimplify_bind_expr
../../gcc/gimplify.cc:1430
0xc10eea gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc/gimplify.cc:16562
0xc14308 gimplify_stmt(tree_node**, gimple**)
../../gcc/gimplify.cc:7219
0xc11ccb gimplify_statement_list
../../gcc/gimplify.cc:2019
0xc11ccb gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc/gimplify.cc:16806
0xc14308 gimplify_stmt(tree_node**, gimple**)
../../gcc/gimplify.cc:7219
0xc14861 gimplify_bind_expr
../../gcc/gimplify.cc:1430
0xc10eea gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc/gimplify.cc:16562
0xc14308 gimplify_stmt(tree_node**, gimple**)
../../gcc/gimplify.cc:7219
0xc153ab gimplify_body(tree_node*, bool)
../../gcc/gimplify.cc:17623
0xc157fd gimplify_function_tree(tree_node*)
../../gcc/gimplify.cc:17822
0xa988e7 cgraph_node::analyze()
../../gcc/cgraphunit.cc:676

[Bug fortran/108421] New: ICE in get_expr_storage_size, at fortran/interface.cc:2862

2023-01-16 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108421

Bug ID: 108421
   Summary: ICE in get_expr_storage_size, at
fortran/interface.cc:2862
   Product: gcc
   Version: 13.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gs...@t-online.de
  Target Milestone: ---

Affects versions down to at least r5 :
(follow-up of pr107707)


$ cat z1.f90
program p
   character(real(3)) :: c
   call s(c)
end
subroutine s(x)
   character(*) :: x
end


$ gfortran-13-20230115 -c z1.f90
z1.f90:2:13:

2 |character(real(3)) :: c
  | 1
Error: Expression at (1) must be of INTEGER type, found REAL
f951: internal compiler error: Segmentation fault
0xf8734f crash_signal
../../gcc/toplev.cc:314
0x848e0d get_expr_storage_size
../../gcc/fortran/interface.cc:2862
0x848e0d gfc_compare_actual_formal(gfc_actual_arglist**, gfc_formal_arglist*,
int, int, bool, locus*)
../../gcc/fortran/interface.cc:3326
0x9b2746 check_externals_procedure
../../gcc/fortran/frontend-passes.cc:5742
0x9b7439 gfc_code_walker(gfc_code**, int (*)(gfc_code**, int*, void*), int
(*)(gfc_expr**, int*, void*), void*)
../../gcc/fortran/frontend-passes.cc:5352
0x9b8c9b gfc_check_externals0
../../gcc/fortran/frontend-passes.cc:5861
0x9b9c24 gfc_check_externals(gfc_namespace*)
../../gcc/fortran/frontend-passes.cc:5883
0x89e900 gfc_parse_file()
../../gcc/fortran/parse.cc:6942
0x8ed3af gfc_be_parse_file
../../gcc/fortran/f95-lang.cc:229

[Bug fortran/108420] New: [13 Regression] ICE in check_charlen_present, at fortran/iresolve.cc:98

2023-01-16 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108420

Bug ID: 108420
   Summary: [13 Regression] ICE in check_charlen_present, at
fortran/iresolve.cc:98
   Product: gcc
   Version: 13.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gs...@t-online.de
  Target Milestone: ---

Started between 20221127 and 20221204 :


$ cat z1.f90
program p
   character :: c = 'c'
   print *, merge(transfer('a', 'b', 0), c, .true.)
end


$ gfortran-13-20230115 -c z1.f90
f951: internal compiler error: Segmentation fault
0xda7faf crash_signal
../../gcc/toplev.cc:314
0x7eb6dc check_charlen_present
../../gcc/fortran/iresolve.cc:98
0x7eecff gfc_resolve_merge(gfc_expr*, gfc_expr*, gfc_expr*, gfc_expr*)
../../gcc/fortran/iresolve.cc:1958
0x7d7635 resolve_intrinsic
../../gcc/fortran/intrinsic.cc:4577
0x7d7635 do_simplify
../../gcc/fortran/intrinsic.cc:4714
0x7e24fa gfc_intrinsic_func_interface(gfc_expr*, int)
../../gcc/fortran/intrinsic.cc:5056
0x839218 resolve_unknown_f
../../gcc/fortran/resolve.cc:2990
0x839218 resolve_function
../../gcc/fortran/resolve.cc:3347
0x839218 gfc_resolve_expr(gfc_expr*)
../../gcc/fortran/resolve.cc:7195
0x83f4ac gfc_resolve_expr(gfc_expr*)
../../gcc/fortran/resolve.cc:7162
0x83f4ac gfc_resolve_code(gfc_code*, gfc_namespace*)
../../gcc/fortran/resolve.cc:11982
0x83dfdf gfc_resolve_blocks(gfc_code*, gfc_namespace*)
../../gcc/fortran/resolve.cc:10980
0x83e338 gfc_resolve_code(gfc_code*, gfc_namespace*)
../../gcc/fortran/resolve.cc:11972
0x8410e7 resolve_codes
../../gcc/fortran/resolve.cc:17629
0x8411ae gfc_resolve(gfc_namespace*)
../../gcc/fortran/resolve.cc:17664
0x828f44 resolve_all_program_units
../../gcc/fortran/parse.cc:6656
0x828f44 gfc_parse_file()
../../gcc/fortran/parse.cc:6912
0x876eff gfc_be_parse_file
../../gcc/fortran/f95-lang.cc:229

[Bug fortran/108010] New: ICE in reduce_unary, at fortran/arith.cc:1345

2022-12-07 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108010

Bug ID: 108010
   Summary: ICE in reduce_unary, at fortran/arith.cc:1345
   Product: gcc
   Version: 13.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gs...@t-online.de
  Target Milestone: ---

Affects versions down to at least r5 :


$ cat z1.f90
program p
   print *, -[real :: [real ::], 2]
end


$ cat z2.f90
program p
   print *, +[integer :: [real ::], 2]
   print *, -[integer :: [real ::], 2]
   print *, 1 + [integer :: [real ::], 2]
   print *, 1 - [integer :: [real ::], 2]
   print *, 2 * [integer :: [real ::], 2]
   print *, +[integer :: [real ::]]
   print *, -[integer :: [real ::]]
   print *, 1 + [integer :: [real ::]]
   print *, 1 - [integer :: [real ::]]
   print *, 2 * [integer :: [real ::]]
end


$ cat z3.f90
program p
   print *, [integer :: [real ::]] + [integer :: [real ::]]
   print *, [integer :: [real ::]] - [integer :: [real ::]]
   print *, [integer :: [real ::]] * [integer :: [real ::]]
   print *, [integer :: [real ::], 2] + [real :: [real ::], 3]
   print *, [integer :: [real ::], 2] - [real :: [real ::], 3]
   print *, [integer :: [real ::], 2] * [real :: [real ::], 3]
end


$ cat z0.f90
program p
   print *, [integer :: [integer ::], 2]
   print *, [real :: [real ::], 2]
end


$ gfortran-13-20221204 z0.f90 && ./a.out
   2
   2.


$ gfortran-13-20221204 -c z1.f90
f951: internal compiler error: Segmentation fault
0xf488bf crash_signal
../../gcc/toplev.cc:314
0x7d7ebd reduce_unary
../../gcc/fortran/arith.cc:1345
0x7d7e91 reduce_unary
../../gcc/fortran/arith.cc:1332
0x7d8638 eval_intrinsic
../../gcc/fortran/arith.cc:1706
0x84baa4 match_level_2
../../gcc/fortran/matchexp.cc:490
0x84bac2 match_level_3
../../gcc/fortran/matchexp.cc:551
0x84bbb4 match_level_4
../../gcc/fortran/matchexp.cc:599
0x84bbb4 match_and_operand
../../gcc/fortran/matchexp.cc:693
0x84bda2 match_or_operand
../../gcc/fortran/matchexp.cc:722
0x84be72 match_equiv_operand
../../gcc/fortran/matchexp.cc:765
0x84bf44 match_level_5
../../gcc/fortran/matchexp.cc:811
0x84b311 gfc_match_expr(gfc_expr**)
../../gcc/fortran/matchexp.cc:870
0x832a09 match_io_element
../../gcc/fortran/io.cc:3668
0x83533a match_io_list
../../gcc/fortran/io.cc:3716
0x83573e match_io
../../gcc/fortran/io.cc:4394
0x83923a gfc_match_print()
../../gcc/fortran/io.cc:4450
0x86b501 match_word
../../gcc/fortran/parse.cc:67
0x871163 decode_statement
../../gcc/fortran/parse.cc:539
0x87159a next_free
../../gcc/fortran/parse.cc:1403
0x87159a next_statement
../../gcc/fortran/parse.cc:1635

[Bug fortran/107996] ICE in gfc_walk_array_ref, at fortran/trans-array.cc:11429

2022-12-06 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107996

G. Steinmetz  changed:

   What|Removed |Added

   Keywords||ice-on-invalid-code,
   ||rejects-valid

--- Comment #1 from G. Steinmetz  ---

Moreover, this valid code should print 'a' :


$ cat z2.f90
program p
   associate (a => [1])
  print *, [character(size(a(:))) :: 'a']
   end associate
end

$ cat z3.f90
program p
   associate (a => [1])
  print *, [character(size(a)) :: 'a']
   end associate
end


$ gfortran-13-20221204 -c z3.f90
z3.f90:3:42:

3 |   print *, [character(size(a)) :: 'a']
  |  ^
Error: size of variable 'A.1' is too large

[Bug fortran/107996] New: ICE in gfc_walk_array_ref, at fortran/trans-array.cc:11429

2022-12-06 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107996

Bug ID: 107996
   Summary: ICE in gfc_walk_array_ref, at
fortran/trans-array.cc:11429
   Product: gcc
   Version: 13.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gs...@t-online.de
  Target Milestone: ---

Affects versions down to at least r5 :


$ cat z1.f90
program p
   associate (a => 1)
  print *, [character(size(a(:))) :: 'a']
   end associate
end


$ gfortran-13-20221204 -c z1.f90
z1.f90:3:45:

3 |   print *, [character(size(a(:))) :: 'a']
  | 1
internal compiler error: in gfc_walk_array_ref, at fortran/trans-array.cc:11429
0x8dfa84 gfc_walk_array_ref(gfc_ss*, gfc_expr*, gfc_ref*)
../../gcc/fortran/trans-array.cc:11429
0x8eba60 gfc_walk_expr(gfc_expr*)
../../gcc/fortran/trans-array.cc:11791
0x910cf3 gfc_conv_procedure_call(gfc_se*, gfc_symbol*, gfc_actual_arglist*,
gfc_expr*, vec*)
../../gcc/fortran/trans-expr.cc:6325
0x917a9a gfc_conv_expr(gfc_se*, gfc_expr*)
../../gcc/fortran/trans-expr.cc:9461
0x91aba3 gfc_conv_expr_val(gfc_se*, gfc_expr*)
../../gcc/fortran/trans-expr.cc:9514
0x91bc00 gfc_conv_expr_type(gfc_se*, gfc_expr*, tree_node*)
../../gcc/fortran/trans-expr.cc:9528
0x8e1ec2 trans_array_constructor
../../gcc/fortran/trans-array.cc:2783
0x8e1ec2 gfc_add_loop_ss_code
../../gcc/fortran/trans-array.cc:3181
0x8e2225 gfc_conv_loop_setup(gfc_loopinfo*, locus*)
../../gcc/fortran/trans-array.cc:5478
0x950df5 gfc_trans_transfer(gfc_code*)
../../gcc/fortran/trans-io.cc:2671
0x8cedc7 trans_code
../../gcc/fortran/trans.cc:2170
0x94e542 build_dt
../../gcc/fortran/trans-io.cc:2051
0x8cede7 trans_code
../../gcc/fortran/trans.cc:2142
0x97980f gfc_trans_block_construct(gfc_code*)
../../gcc/fortran/trans-stmt.cc:2315
0x8ceee7 trans_code
../../gcc/fortran/trans.cc:2046
0x905e19 gfc_generate_function_code(gfc_namespace*)
../../gcc/fortran/trans-decl.cc:7674
0x87817e translate_all_program_units
../../gcc/fortran/parse.cc:6721
0x87817e gfc_parse_file()
../../gcc/fortran/parse.cc:7027
0x8c653f gfc_be_parse_file
../../gcc/fortran/f95-lang.cc:229

[Bug fortran/107995] New: ICE: Segmentation fault, without backtrace

2022-12-06 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107995

Bug ID: 107995
   Summary: ICE: Segmentation fault, without backtrace
   Product: gcc
   Version: 13.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gs...@t-online.de
  Target Milestone: ---

Affects versions down to at least r5 :


$ cat z1.f90
program p
   implicit none
   integer :: n
   n(n) = 1
   print *, n(n)
end

$ cat z2.f90
program p
   n(n) = 1
   print *, n(n)
end


$ gfortran-13-20221204 -c z1.f90
z1.f90:3:15:

3 |integer :: n
  |   1
Error: Self-referential argument 'n' at (1) is not allowed
z1.f90:5:14:

5 |print *, n(n)
  |  1
Error: Statement function 'n' at (1) is not allowed as an actual argument
gfortran: internal compiler error: Segmentation fault signal terminated program
f951
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
See  for instructions.

[Bug c/107994] New: [12/13 Regression] ICE in fold_convert_loc, at fold-const.cc:2606

2022-12-06 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107994

Bug ID: 107994
   Summary: [12/13 Regression] ICE in fold_convert_loc, at
fold-const.cc:2606
   Product: gcc
   Version: 13.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gs...@t-online.de
  Target Milestone: ---

Changed between 20210822 and 20210905 :


$ cat z1.c
typedef V __attribute__ ((__vector_size__ (32)));
int g;
void foo (V v)
{
  g == v;
  int v;
}


$ cat z2.c
typedef V __attribute__ ((__vector_size__ (32)));
int g;
V foo (V v)
{
  g == v;
  int v;
}


$ gcc-13-20221204 -c z1.c
z1.c:1:9: warning: type defaults to 'int' in declaration of 'V'
[-Wimplicit-int]
1 | typedef V __attribute__ ((__vector_size__ (32)));
  | ^
z1.c: In function 'foo':
z1.c:6:7: error: 'v' redeclared as different kind of symbol
6 |   int v;
  |   ^
z1.c:3:13: note: previous definition of 'v' with type 'V' {aka '__vector(8)
int'}
3 | void foo (V v)
  |   ~~^
z1.c:5:5: internal compiler error: in fold_convert_loc, at fold-const.cc:2606
5 |   g == v;
  |   ~~^~~~
0xafb891 fold_convert_loc(unsigned int, tree_node*, tree_node*)
../../gcc/fold-const.cc:2606
0xb9ebd7 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc/gimplify.cc:17113
0xb9dca2 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc/gimplify.cc:17153
0xba1ff8 gimplify_stmt(tree_node**, gimple**)
../../gcc/gimplify.cc:7219
0xb9d41b gimplify_statement_list
../../gcc/gimplify.cc:2019
0xb9d41b gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc/gimplify.cc:16805
0xba1ff8 gimplify_stmt(tree_node**, gimple**)
../../gcc/gimplify.cc:7219
0xba2912 gimplify_bind_expr
../../gcc/gimplify.cc:1430
0xb9d92a gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc/gimplify.cc:16561
0xba1ff8 gimplify_stmt(tree_node**, gimple**)
../../gcc/gimplify.cc:7219
0xba399e gimplify_body(tree_node*, bool)
../../gcc/gimplify.cc:17620
0xba3f95 gimplify_function_tree(tree_node*)
../../gcc/gimplify.cc:17819
0x9bdab7 cgraph_node::analyze()
../../gcc/cgraphunit.cc:676
0x9c0de6 analyze_functions
../../gcc/cgraphunit.cc:1240
0x9c1f5d symbol_table::finalize_compilation_unit()
../../gcc/cgraphunit.cc:2514

[Bug c/107993] New: ICE: tree check: expected string_cst, have integer_cst in get_target_clone_attr_len, at tree.cc:14872

2022-12-06 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107993

Bug ID: 107993
   Summary: ICE: tree check: expected string_cst, have integer_cst
in get_target_clone_attr_len, at tree.cc:14872
   Product: gcc
   Version: 13.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gs...@t-online.de
  Target Milestone: ---

Started with r6 :
(gcc configured with --enable-checking=yes)


$ cat z1.c
typedef union {} u;
__attribute__((target_clones("arch=alderlake",!"default")))
int f (u *x) {}


$ gcc-13-20221204 -c z1.c
z1.c:3:1: internal compiler error: tree check: expected string_cst, have
integer_cst in get_target_clone_attr_len, at tree.cc:14872
3 | int f (u *x) {}
  | ^~~
0x6b3c56 tree_check_failed(tree_node const*, char const*, int, char const*,
...)
../../gcc/tree.cc:8822
0x121b83e tree_check(tree_node*, char const*, int, char const*, tree_code)
../../gcc/tree.h:3528
0x121b83e get_target_clone_attr_len(tree_node*)
../../gcc/tree.cc:14872
0x8fbf87 handle_target_clones_attribute
../../gcc/c-family/c-attribs.cc:5594
0x7b4a87 decl_attributes(tree_node**, tree_node*, int, tree_node*)
../../gcc/attribs.cc:878
0x7db93d start_function(c_declspecs*, c_declarator*, tree_node*)
../../gcc/c/c-decl.cc:10089
0x852e8e c_parser_declaration_or_fndef
../../gcc/c/c-parser.cc:2751
0x85e30f c_parser_external_declaration
../../gcc/c/c-parser.cc:1925
0x85ec4d c_parser_translation_unit
../../gcc/c/c-parser.cc:1779
0x85ec4d c_parse_file()
../../gcc/c/c-parser.cc:24596
0x8d85e1 c_common_parse_file()
../../gcc/c-family/c-opts.cc:1248

[Bug c++/107924] New: ICE in tree_node, at cp/module.cc:9260

2022-11-29 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107924

Bug ID: 107924
   Summary: ICE in tree_node, at cp/module.cc:9260
   Product: gcc
   Version: 13.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gs...@t-online.de
  Target Milestone: ---

Started with r11 and with files
g++.dg/modules/cexpr-2_a.C  or  g++.dg/modules/fn-inline-1_a.C :


$ cat z1.cc
export module sqrt;
export constexpr unsigned sqrt (unsigned X, unsigned x = 1)
{
  unsigned nx = (x + X/x) / 2;
  if (nx != x)
nx = sqrt (X, nx);
  return nx;
}


$ g++-13-20221127 -c z1.cc -fmodules-ts
$
$ g++-13-20221127 -c z1.cc -fmodules-ts -fsanitize=undefined
z1.cc:1:8: internal compiler error: in tree_node, at cp/module.cc:9260
1 | export module sqrt;
  |^~
0x9a355e trees_out::tree_node(tree_node*)
../../gcc/cp/module.cc:9259
0x9a3fdf trees_out::core_vals(tree_node*)
../../gcc/cp/module.cc:6058
0x9a8ecd trees_out::tree_node_vals(tree_node*)
../../gcc/cp/module.cc:7216
0x9a8ecd trees_out::tree_value(tree_node*)
../../gcc/cp/module.cc:9081
0x9a30e1 trees_out::tree_node(tree_node*)
../../gcc/cp/module.cc:9279
0x9a3fdf trees_out::core_vals(tree_node*)
../../gcc/cp/module.cc:6058
0x9a8ecd trees_out::tree_node_vals(tree_node*)
../../gcc/cp/module.cc:7216
0x9a8ecd trees_out::tree_value(tree_node*)
../../gcc/cp/module.cc:9081
0x9a30e1 trees_out::tree_node(tree_node*)
../../gcc/cp/module.cc:9279
0x9a3fdf trees_out::core_vals(tree_node*)
../../gcc/cp/module.cc:6058
0x9a8ecd trees_out::tree_node_vals(tree_node*)
../../gcc/cp/module.cc:7216
0x9a8ecd trees_out::tree_value(tree_node*)
../../gcc/cp/module.cc:9081
0x9a30e1 trees_out::tree_node(tree_node*)
../../gcc/cp/module.cc:9279
0x9a3fdf trees_out::core_vals(tree_node*)
../../gcc/cp/module.cc:6058
0x9a8ecd trees_out::tree_node_vals(tree_node*)
../../gcc/cp/module.cc:7216
0x9a8ecd trees_out::tree_value(tree_node*)
../../gcc/cp/module.cc:9081
0x9a30e1 trees_out::tree_node(tree_node*)
../../gcc/cp/module.cc:9279
0x9a3fdf trees_out::core_vals(tree_node*)
../../gcc/cp/module.cc:6058
0x9a8ecd trees_out::tree_node_vals(tree_node*)
../../gcc/cp/module.cc:7216
0x9a8ecd trees_out::tree_value(tree_node*)
../../gcc/cp/module.cc:9081

[Bug fortran/107923] ICE in lookup_function_fuzzy_find_candidates / check_interface0

2022-11-29 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107923

G. Steinmetz  changed:

   What|Removed |Added

   Keywords||ice-on-invalid-code

--- Comment #1 from G. Steinmetz  ---

A better elaborated test case :

$ cat zz1.f90
module m
   interface s
  module procedure a, b, a
   end interface
contains
   subroutine a(x)
  integer :: x
   end
   subroutine b(x)
  real :: x
   end
end


$ gfortran-13-20221127 -c zz1.f90# if necessary with -g or -O2
zz1.f90:3:30:

3 |   module procedure a, b, a
  |  1
Error: Entity 'a' at (1) is already present in the interface
f951: internal compiler error: Segmentation fault
0xf36d0f crash_signal
../../gcc/toplev.cc:314
0x80ad07 check_interface0
../../gcc/fortran/interface.cc:1885
0x80e913 check_sym_interfaces
../../gcc/fortran/interface.cc:2021
0x89ee32 do_traverse_symtree
../../gcc/fortran/symbol.cc:4180
0x80ea20 gfc_check_interfaces(gfc_namespace*)
../../gcc/fortran/interface.cc:2132
0x88318d resolve_types
../../gcc/fortran/resolve.cc:17562
0x87e4bc gfc_resolve(gfc_namespace*)
../../gcc/fortran/resolve.cc:17661
0x866092 gfc_parse_file()
../../gcc/fortran/parse.cc:6837
0x8b4d3f gfc_be_parse_file
../../gcc/fortran/f95-lang.cc:229

[Bug fortran/107923] New: ICE in lookup_function_fuzzy_find_candidates / check_interface0

2022-11-29 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107923

Bug ID: 107923
   Summary: ICE in lookup_function_fuzzy_find_candidates /
check_interface0
   Product: gcc
   Version: 13.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gs...@t-online.de
  Target Milestone: ---

Some older versions/snapshots show an ICE, some don't :


$ cat z1.f90
program p
   interface s
  module procedure a, b, a
   end interface
   call s
end


$ cat z2.f90
program p
   interface s
  module procedure a, b, a
   end interface
end


$ cat z3.f90
program p
   interface operator (.op.)
  procedure a b
   end interface
contains
end


$ cat z4.f90
module m
   interface s
  procedure a b
   end interface
end


$ gfortran-13-20221127 -c z1.f90
z1.f90:3:30:

3 |   module procedure a, b, a
  |  1
Error: Entity 'a' at (1) is already present in the interface
f951: internal compiler error: Segmentation fault
0xf36d0f crash_signal
../../gcc/toplev.cc:314
0x86e2fd lookup_function_fuzzy_find_candidates
../../gcc/fortran/resolve.cc:2943
0x86e328 lookup_function_fuzzy_find_candidates
../../gcc/fortran/resolve.cc:2949
0x872d88 gfc_lookup_function_fuzzy(char const*, gfc_symtree*)
../../gcc/fortran/resolve.cc:2964
0x80ad0e check_interface0
../../gcc/fortran/interface.cc:1885
0x80e913 check_sym_interfaces
../../gcc/fortran/interface.cc:2021
0x89ee32 do_traverse_symtree
../../gcc/fortran/symbol.cc:4180
0x80ea20 gfc_check_interfaces(gfc_namespace*)
../../gcc/fortran/interface.cc:2132
0x88318d resolve_types
../../gcc/fortran/resolve.cc:17562
0x87e4bc gfc_resolve(gfc_namespace*)
../../gcc/fortran/resolve.cc:17661
0x866294 resolve_all_program_units
../../gcc/fortran/parse.cc:6631
0x866294 gfc_parse_file()
../../gcc/fortran/parse.cc:6887
0x8b4d3f gfc_be_parse_file
../../gcc/fortran/f95-lang.cc:229

[Bug fortran/107922] New: ICE in gfc_simplify_unpack, at fortran/simplify.cc:8473

2022-11-29 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107922

Bug ID: 107922
   Summary: ICE in gfc_simplify_unpack, at
fortran/simplify.cc:8473
   Product: gcc
   Version: 13.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gs...@t-online.de
  Target Milestone: ---

Affects versions down to at least r5 :


$ cat z1.f90
program p
   type t
   end type
   integer, parameter :: a(2) = 1
   type(t), parameter :: b(2) = unpack(a,[.false.,.true.,.false.],a)
end


$ cat z2.f90
program p
   type t
   end type
   integer, parameter :: a(2) = 1
   type(t), parameter :: b(3) = unpack(a,[.false.,.true.,.false.],a)
end


$ gfortran-13-20221127 -c z1.f90
f951: internal compiler error: Segmentation fault
0xda00af crash_signal
../../gcc/toplev.cc:314
0x85b088 gfc_simplify_unpack(gfc_expr*, gfc_expr*, gfc_expr*)
../../gcc/fortran/simplify.cc:8473
0x7d2b3a do_simplify
../../gcc/fortran/intrinsic.cc:4677
0x7dda1a gfc_intrinsic_func_interface(gfc_expr*, int)
../../gcc/fortran/intrinsic.cc:5056
0x833fe8 resolve_unknown_f
../../gcc/fortran/resolve.cc:2990
0x833fe8 resolve_function
../../gcc/fortran/resolve.cc:3347
0x833fe8 gfc_resolve_expr(gfc_expr*)
../../gcc/fortran/resolve.cc:7195
0x7c2704 gfc_reduce_init_expr(gfc_expr*)
../../gcc/fortran/expr.cc:3168
0x7c5690 gfc_match_init_expr(gfc_expr**)
../../gcc/fortran/expr.cc:3216
0x7af4fb variable_decl
../../gcc/fortran/decl.cc:3028
0x7af4fb gfc_match_data_decl()
../../gcc/fortran/decl.cc:6331
0x81bf43 match_word
../../gcc/fortran/parse.cc:67
0x81bf43 decode_statement
../../gcc/fortran/parse.cc:378
0x81d98a next_free
../../gcc/fortran/parse.cc:1402
0x81d98a next_statement
../../gcc/fortran/parse.cc:1634
0x81f3cb parse_spec
../../gcc/fortran/parse.cc:4190
0x8225dc parse_progunit
../../gcc/fortran/parse.cc:6237
0x823ca1 gfc_parse_file()
../../gcc/fortran/parse.cc:6782
0x871bef gfc_be_parse_file
../../gcc/fortran/f95-lang.cc:229

[Bug fortran/107899] New: ICE in resolve_deallocate_expr, at fortran/resolve.cc:7576

2022-11-28 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107899

Bug ID: 107899
   Summary: ICE in resolve_deallocate_expr, at
fortran/resolve.cc:7576
   Product: gcc
   Version: 13.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gs...@t-online.de
  Target Milestone: ---

Affects versions down to at least r5 :
(target instead of allocatable)


$ cat z1.f90
program p
   type t
   end type
   class(t), target :: x[:]
   if (allocated(x)) deallocate (x)
end


$ cat z2.f90
program p
   type t
   end type
   class(t), target :: x[:]
   deallocate(x)
end


$ gfortran-13-20221127 -c z1.f90 -fcoarray=lib
z1.f90:4:27:

4 |class(t), target :: x[:]
  |   1
Error: Coarray variable 'x' at (1) shall not have codimensions with deferred
shape
z1.f90:5:17:

5 |if (allocated(x)) deallocate (x)
  | 1
Error: 'array' argument of 'allocated' intrinsic at (1) must be ALLOCATABLE
f951: internal compiler error: Segmentation fault
0xf36d0f crash_signal
../../gcc/toplev.cc:314
0x87a956 resolve_deallocate_expr
../../gcc/fortran/resolve.cc:7576
0x87a956 resolve_allocate_deallocate
../../gcc/fortran/resolve.cc:8461
0x87cfac gfc_resolve_code(gfc_code*, gfc_namespace*)
../../gcc/fortran/resolve.cc:12291
0x87b2ff gfc_resolve_blocks(gfc_code*, gfc_namespace*)
../../gcc/fortran/resolve.cc:10979
0x87b658 gfc_resolve_code(gfc_code*, gfc_namespace*)
../../gcc/fortran/resolve.cc:11971
0x87e407 resolve_codes
../../gcc/fortran/resolve.cc:17628
0x87e4ce gfc_resolve(gfc_namespace*)
../../gcc/fortran/resolve.cc:17663
0x866294 resolve_all_program_units
../../gcc/fortran/parse.cc:6631
0x866294 gfc_parse_file()
../../gcc/fortran/parse.cc:6887
0x8b4d3f gfc_be_parse_file
../../gcc/fortran/f95-lang.cc:229

[Bug c/107898] New: [11/12/13 Regression] ICE in irange_intersect, at value-range.cc:1640

2022-11-28 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107898

Bug ID: 107898
   Summary: [11/12/13 Regression] ICE in irange_intersect, at
value-range.cc:1640
   Product: gcc
   Version: 13.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gs...@t-online.de
  Target Milestone: ---

Started between 20220403 and 20220410, 
with file gcc.dg/Walloca-larger-than-2.c :
(and started between 20201018 and 20201108 with -O1+)


$ gcc-13-20221127 -c Walloca-larger-than-2.c -fsanitize=address
-fsanitize=pointer-subtract -fpreprocessed -Walloca-larger-than=5000
Walloca-larger-than-2.c:7:1: warning: parameter names (without types) in
function declaration
7 | extern void* alloca (__SIZE_TYPE__);
  | ^~
Walloca-larger-than-2.c: In function 'test_alloca':
Walloca-larger-than-2.c:17:5: warning: implicit declaration of function 'T'
[-Wimplicit-function-declaration]
   17 | T (alloca (0));
  | ^
Walloca-larger-than-2.c:17:16: warning: 'alloca' argument 1 type is 'int' where
'long unsigned int' is expected in a call to built-in function declared without
prototype [-Wbuiltin-declaration-mismatch]
   17 | T (alloca (0));
  |^
Walloca-larger-than-2.c:7:14: note: built-in 'alloca' declared here
7 | extern void* alloca (__SIZE_TYPE__);
  |  ^~
Walloca-larger-than-2.c:21:16: warning: 'alloca' argument 1 type is 'int' where
'long unsigned int' is expected in a call to built-in function declared without
prototype [-Wbuiltin-declaration-mismatch]
   21 | T (alloca (1));
  |^
Walloca-larger-than-2.c:7:14: note: built-in 'alloca' declared here
7 | extern void* alloca (__SIZE_TYPE__);
  |  ^~
Walloca-larger-than-2.c:24:16: warning: 'alloca' argument 1 type is 'unsigned
int' where 'long unsigned int' is expected in a call to built-in function
declared without prototype [-Wbuiltin-declaration-mismatch]
   24 | T (alloca (n));
  |^
Walloca-larger-than-2.c:7:14: note: built-in 'alloca' declared here
7 | extern void* alloca (__SIZE_TYPE__);
  |  ^~
Walloca-larger-than-2.c:17:5: warning: argument to 'alloca' is zero
[-Walloca-larger-than=]
   17 | T (alloca (0));
  | ^~
Walloca-larger-than-2.c:21:5: warning: use of 'alloca' within a loop
[-Walloca-larger-than=]
   21 | T (alloca (1));
  | ^~
during GIMPLE pass: walloca
Walloca-larger-than-2.c:25:1: internal compiler error: in irange_intersect, at
value-range.cc:2560
   25 | }
  | ^
0x12550c8 irange::irange_intersect(irange const&)
../../gcc/value-range.cc:2559
0x1251a81 irange::legacy_verbose_intersect(irange const*)
../../gcc/value-range.cc:2324
0x1cc78dc irange::intersect(vrange const&)
../../gcc/value-range.h:969
0x1cc78dc alloca_call_type
../../gcc/gimple-ssa-warn-alloca.cc:228
0x1cc8243 pass_walloca::execute(function*)
../../gcc/gimple-ssa-warn-alloca.cc:292

[Bug c++/107897] New: [13 Regression] ICE in verify_curr_properties, at passes.cc:2201

2022-11-28 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107897

Bug ID: 107897
   Summary: [13 Regression] ICE in verify_curr_properties, at
passes.cc:2201
   Product: gcc
   Version: 13.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gs...@t-online.de
  Target Milestone: ---

Started between 20221030 and 20221106,
with file g++.dg/cpp2a/concepts-lambda3.C :


$ gcc-13-20221127 -c concepts-lambda3.C -std=c++20 -flto -fno-inline
concepts-lambda3.C:40:13: error: mangling of 'main(int,
char**):: [with auto:5 = int]' as
'_ZZ4mainENKUlT_E1_clIiEEDaS_' conflicts with a previous mangle
   40 |   auto a0 = [](IsNotLarge auto a) { return [](auto b){ return b; }; };
  | ^
concepts-lambda3.C:37:3: note: previous mangling 'int main(int,
char**)_ZZ4mainENKUlT_E1_clIiEEDaS_(int) const'
   37 |   [](auto t) requires true { return t; }(5);
  |   ^
concepts-lambda3.C:40:13: note: a later '-fabi-version=' (or =0) avoids this
error with a change in mangling
   40 |   auto a0 = [](IsNotLarge auto a) { return [](auto b){ return b; }; };
  | ^
during IPA pass: targetclone
concepts-lambda3.C:63:1: internal compiler error: in verify_curr_properties, at
passes.cc:2201
   63 | }
  | ^
0x10c1cb5 verify_curr_properties
../../gcc/passes.cc:2201
0x10c23dd do_per_function
../../gcc/passes.cc:1701

[Bug fortran/107821] New: ICE in gfc_conv_scalarized_array_ref, at fortran/trans-array.cc:3723

2022-11-22 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107821

Bug ID: 107821
   Summary: ICE in gfc_conv_scalarized_array_ref, at
fortran/trans-array.cc:3723
   Product: gcc
   Version: 13.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gs...@t-online.de
  Target Milestone: ---

Affects versions down to at least r5 :


$ cat z1.f90
program p
   associate (a => 1)
  print *, [character((a(1))) :: '1']
   end associate
end

$ cat z2.f90
program p
   associate (a => 1)
  print *, [character((a((1 :: '1']
   end associate
end

$ cat z3.f90
program p
   associate (a => 1)
  print *, [character(((a(1 :: '1']
   end associate
end

$ cat z0.f90
program p
   associate (a => 1)
  print *, [character(a(1)) :: '1']
   end associate
end


$ gfortran-13-20221120 -c z0.f90
z0.f90:3:26:

3 |   print *, [character(a(1)) :: '1']
  |  1
Error: Scalar INTEGER expression expected at (1)


$ gfortran-13-20221120 -c z1.f90
z1.f90:3:41:

3 |   print *, [character((a(1))) :: '1']
  | 1
internal compiler error: Segmentation fault
0xda0f4f crash_signal
../../gcc/toplev.cc:314
0x87e95a gfc_conv_scalarized_array_ref
../../gcc/fortran/trans-array.cc:3723
0x87f45e gfc_conv_array_ref(gfc_se*, gfc_array_ref*, gfc_expr*, locus*)
../../gcc/fortran/trans-array.cc:3879
0x8ae66e gfc_conv_variable
../../gcc/fortran/trans-expr.cc:3104
0x8aa9ea gfc_conv_expr(gfc_se*, gfc_expr*)
../../gcc/fortran/trans-expr.cc:9469
0x8aaaf6 gfc_conv_expr_op
../../gcc/fortran/trans-expr.cc:3782
0x8aaaf6 gfc_conv_expr(gfc_se*, gfc_expr*)
../../gcc/fortran/trans-expr.cc:9457
0x8ad813 gfc_conv_expr_val(gfc_se*, gfc_expr*)
../../gcc/fortran/trans-expr.cc:9514
0x8ad960 gfc_conv_expr_type(gfc_se*, gfc_expr*, tree_node*)
../../gcc/fortran/trans-expr.cc:9528
0x887e0f trans_array_constructor
../../gcc/fortran/trans-array.cc:2783
0x887e0f gfc_add_loop_ss_code
../../gcc/fortran/trans-array.cc:3181
0x8880f5 gfc_conv_loop_setup(gfc_loopinfo*, locus*)
../../gcc/fortran/trans-array.cc:5478
0x8ddd45 gfc_trans_transfer(gfc_code*)
../../gcc/fortran/trans-io.cc:2671
0x879a37 trans_code
../../gcc/fortran/trans.cc:2170
0x8db6ce build_dt
../../gcc/fortran/trans-io.cc:2051
0x879a17 trans_code
../../gcc/fortran/trans.cc:2142
0x8f71af gfc_trans_block_construct(gfc_code*)
../../gcc/fortran/trans-stmt.cc:2314
0x879917 trans_code
../../gcc/fortran/trans.cc:2046
0x8a2e1e gfc_generate_function_code(gfc_namespace*)
../../gcc/fortran/trans-decl.cc:7674
0x824fae translate_all_program_units
../../gcc/fortran/parse.cc:6696

[Bug fortran/107820] New: ICE in match_mult_operand, at fortran/matchexp.cc:296

2022-11-22 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107820

Bug ID: 107820
   Summary: ICE in match_mult_operand, at fortran/matchexp.cc:296
   Product: gcc
   Version: 13.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gs...@t-online.de
  Target Milestone: ---

Affects versions down to at least r5 :


$ cat z1.f90
program p
   print *, [real :: ([3])] ** 20
end

$ cat z2.f90
program p
   print *, [real :: (3)] ** 20
   print *, 3.0 ** 20
end


$ gfortran-13-20221120 z2.f90 && ./a.out
   3.48678451E+09
   3.48678451E+09


$ gfortran-13-20221120 -c z1.f90
z1.f90:2:23:

2 |print *, [real :: ([3])] ** 20
  |   1
Error: Result of exponentiation at (1) exceeds the range of INTEGER(4)
f951: internal compiler error: Segmentation fault
0xf37d3f crash_signal
../../gcc/toplev.cc:314
0x83abfc match_mult_operand
../../gcc/fortran/matchexp.cc:296
0x83ad98 match_add_operand
../../gcc/fortran/matchexp.cc:356
0x83afec match_level_2
../../gcc/fortran/matchexp.cc:480
0x83b142 match_level_3
../../gcc/fortran/matchexp.cc:551
0x83b234 match_level_4
../../gcc/fortran/matchexp.cc:599
0x83b234 match_and_operand
../../gcc/fortran/matchexp.cc:693
0x83b422 match_or_operand
../../gcc/fortran/matchexp.cc:722
0x83b4f2 match_equiv_operand
../../gcc/fortran/matchexp.cc:765
0x83b5c4 match_level_5
../../gcc/fortran/matchexp.cc:811
0x83a991 gfc_match_expr(gfc_expr**)
../../gcc/fortran/matchexp.cc:870
0x822089 match_io_element
../../gcc/fortran/io.cc:3668
0x8249ba match_io_list
../../gcc/fortran/io.cc:3716
0x824dbe match_io
../../gcc/fortran/io.cc:4394
0x8288ba gfc_match_print()
../../gcc/fortran/io.cc:4450
0x85abf1 match_word
../../gcc/fortran/parse.cc:67
0x860853 decode_statement
../../gcc/fortran/parse.cc:539
0x860c8a next_free
../../gcc/fortran/parse.cc:1402
0x860c8a next_statement
../../gcc/fortran/parse.cc:1634
0x863414 parse_spec
../../gcc/fortran/parse.cc:4006

[Bug fortran/107819] ICE in gfc_check_argument_var_dependency, at fortran/dependency.cc:978

2022-11-22 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107819

--- Comment #1 from G. Steinmetz  ---

Works here with explicitly enforced evaluation (a(n)) :


$ cat z3.f90
program p
   integer :: a(4) = [-1, -2, -3, -4]
   integer :: n(4) = [4, 2, 1, 3]
   call s ((a(n)), a)
   print *, a
contains
   elemental subroutine s (x, y)
  integer, value :: x
  integer, intent(out) :: y
  y = x
   end
end


$ cat z8.f90
program p
   implicit none
   integer, parameter :: m = 99
   integer :: i
   integer :: a(m) = [(-i,i=1,m)]
   call s ((a(m:1:-1)), a)
   print '(10i6)', a
contains
   elemental subroutine s (x, y)
  integer, value :: x
  integer, intent(out) :: y
  y = x
   end
end


$ cat z9.f90
program p
   implicit none
   integer, parameter :: m = 99
   integer :: i
   integer :: a(m) = [(-i,i=1,m)]
   integer :: n(m) = [(i,i=m,1,-1)]
   call s ([a(n)], a)
   print '(10i6)', a
contains
   elemental subroutine s (x, y)
  integer, value :: x
  integer, intent(out) :: y
  y = x
   end
end


$ gfortran-13-20221120 z3.f90 && ./a.out
  -4  -2  -1  -3
$

[Bug fortran/107819] New: ICE in gfc_check_argument_var_dependency, at fortran/dependency.cc:978

2022-11-22 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107819

Bug ID: 107819
   Summary: ICE in gfc_check_argument_var_dependency, at
fortran/dependency.cc:978
   Product: gcc
   Version: 13.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gs...@t-online.de
  Target Milestone: ---

Affects versions down to at least r5 :
(presumably processor dependent)


$ cat z1.f90
program p
   integer :: a(4) = [-1, -2, -3, -4]
   integer :: n(4) = [4, 2, 1, 3]
   call s (a(n), a)
   print *, a
contains
   elemental subroutine s (x, y)
  integer, value :: x
  integer, intent(out) :: y
  y = x
   end
end


$ cat z2.f90
program p
   integer :: a(1) = [-1]
   integer :: n(1) = [1]
   call s (a(n), a)
   print *, a
contains
   elemental subroutine s (x, y)
  integer, value :: x
  integer, intent(out) :: y
  y = x
   end
end


$ cat z6.f90
program p
   integer :: a(1) = [-1]
   integer :: n = 1
   call s (a(n:n), a)
   print *, a
contains
   elemental subroutine s (x, y)
  integer, value :: x
  integer, intent(out) :: y
  y = x
   end
end


$ cat z7.f90
program p
   implicit none
   integer, parameter :: m = 99
   integer :: i
   integer :: a(m) = [(-i,i=1,m)]
   integer :: n(m) = [(i,i=m,1,-1)]
   call s (a(n), a)
   print *, a
contains
   elemental subroutine s (x, y)
  integer, value :: x
  integer, intent(out) :: y
  y = x
   end
end


$ gfortran-13-20221120 -c z1.f90
z1.f90:4:19:

4 |call s (a(n), a)
  |   1
internal compiler error: in gfc_check_argument_var_dependency, at
fortran/dependency.cc:978
0x8add39 gfc_check_argument_var_dependency
../../gcc/fortran/dependency.cc:978
0x8addcc gfc_check_argument_dependency
../../gcc/fortran/dependency.cc:1075
0x8addcc gfc_check_fncall_dependency(gfc_expr*, sym_intent, gfc_symbol*,
gfc_actual_arglist*, gfc_dep_check)
../../gcc/fortran/dependency.cc:1120
0x9640b0 gfc_conv_elemental_dependencies
../../gcc/fortran/trans-stmt.cc:267
0x9640b0 gfc_trans_call(gfc_code*, bool, tree_node*, tree_node*, bool)
../../gcc/fortran/trans-stmt.cc:491
0x8be656 trans_code
../../gcc/fortran/trans.cc:2018
0x8f5379 gfc_generate_function_code(gfc_namespace*)
../../gcc/fortran/trans-decl.cc:7674
0x86775e translate_all_program_units
../../gcc/fortran/parse.cc:6696
0x86775e gfc_parse_file()
../../gcc/fortran/parse.cc:7002
0x8b5a9f gfc_be_parse_file
../../gcc/fortran/f95-lang.cc:229

[Bug fortran/107707] New: ICE in gfc_compare_actual_formal, at fortran/interface.cc:3284

2022-11-15 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107707

Bug ID: 107707
   Summary: ICE in gfc_compare_actual_formal, at
fortran/interface.cc:3284
   Product: gcc
   Version: 13.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gs...@t-online.de
  Target Milestone: ---

Affects versions down to at least r5 :


$ cat z1.f90
program p
   character(3), allocatable :: c
   c = 'abc'
   call s(c)
contains
   subroutine s(x)
  character(real(3)), allocatable :: x
   end
end


$ gfortran-13-20221106 -c z1.f90
z1.f90:7:16:

7 |   character(real(3)), allocatable :: x
  |1
Error: Expression at (1) must be of INTEGER type, found REAL
f951: internal compiler error: Segmentation fault
0xf4697f crash_signal
../../gcc/toplev.cc:314
0x80de4a gfc_compare_actual_formal(gfc_actual_arglist**, gfc_formal_arglist*,
int, int, bool, locus*)
../../gcc/fortran/interface.cc:3284
0x80e5e6 gfc_procedure_use(gfc_symbol*, gfc_actual_arglist**, locus*)
../../gcc/fortran/interface.cc:4167
0x87ad0a resolve_specific_s0
../../gcc/fortran/resolve.cc:3636
0x87ad0a resolve_specific_s
../../gcc/fortran/resolve.cc:3656
0x87ad0a resolve_call
../../gcc/fortran/resolve.cc:3810
0x87839f gfc_resolve_code(gfc_code*, gfc_namespace*)
../../gcc/fortran/resolve.cc:12231
0x87a387 resolve_codes
../../gcc/fortran/resolve.cc:17624
0x87a44e gfc_resolve(gfc_namespace*)
../../gcc/fortran/resolve.cc:17659
0x862214 resolve_all_program_units
../../gcc/fortran/parse.cc:6631
0x862214 gfc_parse_file()
../../gcc/fortran/parse.cc:6887
0x8b0c8f gfc_be_parse_file
../../gcc/fortran/f95-lang.cc:229

[Bug fortran/107706] New: ICE in gfc_conv_procedure_call, at fortran/trans-expr.cc:7572

2022-11-15 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107706

Bug ID: 107706
   Summary: ICE in gfc_conv_procedure_call, at
fortran/trans-expr.cc:7572
   Product: gcc
   Version: 13.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gs...@t-online.de
  Target Milestone: ---

Started with r13 between 20220925 and 20221009 :


$ cat z1.f90
integer function f(i)
   implicit none
   integer, value :: i
   !$omp assume holds(i < g())
   block
   end block
   f = 3
contains
   function g()
  integer :: g(2)
  g = 4
   end
end


$ gfortran-13-20221106 -c z1.f90 -fopenmp
z1.f90:4:30:

4 |!$omp assume holds(i < g())
  |  1
internal compiler error: in gfc_conv_procedure_call, at
fortran/trans-expr.cc:7572
0x8b373b gfc_conv_procedure_call(gfc_se*, gfc_symbol*, gfc_actual_arglist*,
gfc_expr*, vec*)
../../gcc/fortran/trans-expr.cc:7572
0x8a506a gfc_conv_expr(gfc_se*, gfc_expr*)
../../gcc/fortran/trans-expr.cc:9452
0x8a5462 gfc_conv_expr_op
../../gcc/fortran/trans-expr.cc:3903
0x8a5462 gfc_conv_expr(gfc_se*, gfc_expr*)
../../gcc/fortran/trans-expr.cc:9448
0x8e8aad gfc_trans_omp_assume
../../gcc/fortran/trans-openmp.cc:4588
0x8e8aad gfc_trans_omp_directive(gfc_code*)
../../gcc/fortran/trans-openmp.cc:7532
0x873e17 trans_code
../../gcc/fortran/trans.cc:2245
0x89d4ce gfc_generate_function_code(gfc_namespace*)
../../gcc/fortran/trans-decl.cc:7659
0x81f57e translate_all_program_units
../../gcc/fortran/parse.cc:6696
0x81f57e gfc_parse_file()
../../gcc/fortran/parse.cc:7002
0x86ccbf gfc_be_parse_file
../../gcc/fortran/f95-lang.cc:229

[Bug c/107705] New: [12/13 Regression] ICE: tree check: expected class 'type', have 'exceptional' (error_mark) in ix86_function_type_abi, at config/i386/i386.cc:1529

2022-11-15 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107705

Bug ID: 107705
   Summary: [12/13 Regression] ICE: tree check: expected class
'type', have 'exceptional' (error_mark) in
ix86_function_type_abi, at config/i386/i386.cc:1529
   Product: gcc
   Version: 13.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gs...@t-online.de
  Target Milestone: ---

Started between 20210822 and 20210905 :


$ cat z1.c
int f (void)
{
  int (*p) (void) = 0;
  return p ();
  int p = 1;
}


$ gcc-13-20221106 -c z1.c
z1.c: In function 'f':
z1.c:5:7: error: conflicting types for 'p'; have 'int'
5 |   int p = 1;
  |   ^
z1.c:3:9: note: previous definition of 'p' with type 'int (*)(void)'
3 |   int (*p) (void) = 0;
  | ^
z1.c:4:10: internal compiler error: tree check: expected class 'type', have
'exceptional' (error_mark) in ix86_function_type_abi, at
config/i386/i386.cc:1529
4 |   return p ();
  |  ^~~~
0x6aed15 tree_class_check_failed(tree_node const*, tree_code_class, char
const*, int, char const*)
../../gcc/tree.cc:8896
0x130184c tree_class_check(tree_node const*, tree_code_class, char const*, int,
char const*)
../../gcc/tree.h:3911
0x130184c ix86_function_type_abi(tree_node const*)
../../gcc/config/i386/i386.cc:1529
0x130373d ix86_return_in_memory
../../gcc/config/i386/i386.cc:4249
0xb289d0 aggregate_value_p(tree_node const*, tree_node const*)
../../gcc/function.cc:2119
0xbbbea5 gimplify_modify_expr_rhs
../../gcc/gimplify.cc:5775
0xbbcb0e gimplify_modify_expr
../../gcc/gimplify.cc:6100
0xbad0f7 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc/gimplify.cc:16352
0xbb0fd8 gimplify_stmt(tree_node**, gimple**)
../../gcc/gimplify.cc:7211
0xbabe5e gimplify_and_add(tree_node*, gimple**)
../../gcc/gimplify.cc:492
0xbabe5e gimplify_return_expr
../../gcc/gimplify.cc:1680
0xbabe5e gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc/gimplify.cc:16614
0xbb0fd8 gimplify_stmt(tree_node**, gimple**)
../../gcc/gimplify.cc:7211
0xbac3cb gimplify_statement_list
../../gcc/gimplify.cc:2019
0xbac3cb gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc/gimplify.cc:16797
0xbb0fd8 gimplify_stmt(tree_node**, gimple**)
../../gcc/gimplify.cc:7211
0xbb1963 gimplify_bind_expr
../../gcc/gimplify.cc:1430
0xbac8da gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc/gimplify.cc:16553
0xbb0fd8 gimplify_stmt(tree_node**, gimple**)
../../gcc/gimplify.cc:7211
0xbb2bde gimplify_body(tree_node*, bool)
../../gcc/gimplify.cc:17612

[Bug fortran/107576] [10/11/12/13 Regression] ICE in gfc_conv_procedure_call, at fortran/trans-expr.cc:6193

2022-11-14 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107576

--- Comment #7 from G. Steinmetz  ---

Yes, call s(z) is valid in z1, but is necessary to trigger
the ICE somehow with -std=legacy and null().

Yes, 15.4.2.2(3) was it, explicit interface of the callee with
all the characteristics of that procedure(subr/func) and dummies.

Two things are mixed here.. The following is e.g. handled correctly,
with a different error, but rejected without an explicit interface:

$ cat z3.f90
program p
   call s(null())
end

$ cat z3c.f90
program p
   call s(null())
contains
   subroutine s(x)
  integer, pointer :: x
   end
end

$ cat z3i.f90
program p
   interface
  subroutine s(x)
 integer, pointer :: x
  end
   end interface
   call s(null())
end

$ gfortran -c z3c.f90
$ gfortran -c z3i.f90
$ gfortran -c z3.f90
z3.f90:2:10:

2 |call s(null())
  |  1
Error: MOLD argument to NULL required at (1)

[Bug c/107683] New: [13 Regression] ICE in int_fits_type_p, at tree.cc:8044

2022-11-14 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107683

Bug ID: 107683
   Summary: [13 Regression] ICE in int_fits_type_p, at
tree.cc:8044
   Product: gcc
   Version: 13.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gs...@t-online.de
  Target Milestone: ---

Started between 20221023 and 20221030 :
(gcc configured with --enable-checking=yes)


$ cat z1.c
enum e : int
enum e { E };


$ gcc-13-20221106 -c z1.c
z1.c:2:6: error: 'enum' declared with but defined without fixed underlying type
2 | enum e { E };
  |  ^
z1.c:2:10: internal compiler error: Segmentation fault
2 | enum e { E };
  |  ^
0xeeafcf crash_signal
../../gcc/toplev.cc:314
0x1246f30 int_fits_type_p(tree_node const*, tree_node const*)
../../gcc/tree.cc:8044
0x7c4d8b build_enumerator(unsigned int, unsigned int, c_enum_contents*,
tree_node*, tree_node*)
../../gcc/c/c-decl.cc:9786
0x82c01f c_parser_enum_specifier
../../gcc/c/c-parser.cc:3469
0x82c01f c_parser_declspecs(c_parser*, c_declspecs*, bool, bool, bool, bool,
bool, bool, bool, c_lookahead_kind)
../../gcc/c/c-parser.cc:3150
0x82cc91 c_parser_enum_specifier
../../gcc/c/c-parser.cc:3367
0x82cc91 c_parser_declspecs(c_parser*, c_declspecs*, bool, bool, bool, bool,
bool, bool, bool, c_lookahead_kind)
../../gcc/c/c-parser.cc:3150
0x850305 c_parser_declaration_or_fndef
../../gcc/c/c-parser.cc:2091
0x85cf8f c_parser_external_declaration
../../gcc/c/c-parser.cc:1833
0x85d8bd c_parser_translation_unit
../../gcc/c/c-parser.cc:1695
0x85d8bd c_parse_file()
../../gcc/c/c-parser.cc:24359
0x8da031 c_common_parse_file()
../../gcc/c-family/c-opts.cc:1244

[Bug c/107682] New: [13 Regression] ICE in c_parser_braced_init, at c/c-parser.cc:5619

2022-11-14 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107682

Bug ID: 107682
   Summary: [13 Regression] ICE in c_parser_braced_init, at
c/c-parser.cc:5619
   Product: gcc
   Version: 13.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gs...@t-online.de
  Target Milestone: ---

Started between 20220821 and 20220828 :
(gcc configured with --enable-checking=yes)


$ cat z1.c
int x() = {};

$ cat z2.c
int x(n) = {};


$ gcc-13-20221106 -c z1.c
z1.c:1:1: error: function 'x' is initialized like a variable
1 | int x() = {};
  | ^~~
z1.c:1:1: internal compiler error: in fold_convert_loc, at fold-const.cc:2618
0xb06210 fold_convert_loc(unsigned int, tree_node*, tree_node*)
../../gcc/fold-const.cc:2618
0x80074c pop_init_level(unsigned int, int, obstack*, unsigned int)
../../gcc/c/c-typeck.cc:9100
0x8353e0 c_parser_braced_init
../../gcc/c/c-parser.cc:5619
0x8366b1 c_parser_initializer
../../gcc/c/c-parser.cc:5521
0x851387 c_parser_declaration_or_fndef
../../gcc/c/c-parser.cc:2436
0x85cf8f c_parser_external_declaration
../../gcc/c/c-parser.cc:1833
0x85d8bd c_parser_translation_unit
../../gcc/c/c-parser.cc:1695
0x85d8bd c_parse_file()
../../gcc/c/c-parser.cc:24359
0x8da031 c_common_parse_file()
../../gcc/c-family/c-opts.cc:1244

[Bug fortran/107576] [10/11/12/13 Regression] ICE in gfc_conv_procedure_call, at fortran/trans-expr.cc:6193

2022-11-14 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107576

--- Comment #5 from G. Steinmetz  ---

I had in mind Fortran 2018, 15.4.2.2 Explicit interface,
and therefore had added the examples z1c.f90 and z2c.f90.

Some other compilers (via Compiler Explorer) show an error 
for both z1.f90 and z2.f90 :

latest flang-new :
error: Semantic errors in /app/example.f90
error: Null pointer argument requires an explicit interface
 call s(null(z))

latest ifort/ifx :
error #8615: Intrinsic NULL() is passed as actual argument. An explicit
interface specifying that the corresponding dummy is pointer, allocatable or
optional is required.
   call s(null(z))

Would be interesting what e.g. NAG and Cray say about it.

[Bug fortran/107681] New: [13 Regression] ICE in gfc_type_is_extensible, at fortran/resolve.cc:9018

2022-11-14 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107681

Bug ID: 107681
   Summary: [13 Regression] ICE in gfc_type_is_extensible, at
fortran/resolve.cc:9018
   Product: gcc
   Version: 13.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gs...@t-online.de
  Target Milestone: ---

Started between 20220717 and 20220724 :
(gcc configured with --enable-checking=yes)


$ cat z1.f90
program p
   type t
  integer, allocatable :: a
   end type
   class(t) :: x[*]
   associate (y => x)
   end associate
end


$ cat z2.f90
program p
   type t
  integer, allocatable :: a
   end type
   class(t) :: x[:]
   associate (y => x)
   end associate
end


$ gfortran-12 -c z1.f90 -fcoarray=lib
z1.f90:5:19:

5 |class(t) :: x[*]
  |   1
Error: CLASS variable 'x' at (1) must be dummy, allocatable or pointer


$ gfortran-13-20221106 -c z1.f90 -fcoarray=lib
z1.f90:5:19:

5 |class(t) :: x[*]
  |   1
Error: CLASS variable 'x' at (1) must be dummy, allocatable or pointer
z1.f90:6:20:

6 |associate (y => x)
  |1
Error: Invalid array reference of a non-array entity at (1)
f951: internal compiler error: Segmentation fault
0xf4697f crash_signal
../../gcc/toplev.cc:314
0x6b337f gfc_type_is_extensible(gfc_symbol*)
../../gcc/fortran/resolve.cc:9018
0x6b337f resolve_fl_var_and_proc
../../gcc/fortran/resolve.cc:12970
0x87c32d resolve_fl_variable
../../gcc/fortran/resolve.cc:13089
0x87c32d resolve_symbol
../../gcc/fortran/resolve.cc:16183
0x89ad62 do_traverse_symtree
../../gcc/fortran/symbol.cc:4180
0x87efd4 resolve_types
../../gcc/fortran/resolve.cc:17542
0x87a43c gfc_resolve(gfc_namespace*)
../../gcc/fortran/resolve.cc:17657
0x87840c gfc_resolve(gfc_namespace*)
../../gcc/fortran/resolve.cc:17644
0x87840c resolve_block_construct
../../gcc/fortran/resolve.cc:10825
0x87840c gfc_resolve_code(gfc_code*, gfc_namespace*)
../../gcc/fortran/resolve.cc:12258
0x87a387 resolve_codes
../../gcc/fortran/resolve.cc:17624
0x87a44e gfc_resolve(gfc_namespace*)
../../gcc/fortran/resolve.cc:17659
0x862214 resolve_all_program_units
../../gcc/fortran/parse.cc:6631
0x862214 gfc_parse_file()
../../gcc/fortran/parse.cc:6887
0x8b0c8f gfc_be_parse_file
../../gcc/fortran/f95-lang.cc:229

[Bug fortran/107680] New: ICE in arith_power, at fortran/arith.cc:989 and :1006

2022-11-14 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107680

Bug ID: 107680
   Summary: ICE in arith_power, at fortran/arith.cc:989 and :1006
   Product: gcc
   Version: 13.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gs...@t-online.de
  Target Milestone: ---

Affects versions down to at least r5 :


$ cat z1.f90
program p
   print *, [real :: ([1])] ** 2.0
end

$ cat z2.f90
program p
   print *, [complex :: ([1])] ** 2.0
end

$ cat z3.f90
program p
   print *, [complex :: ([1])] ** (1.0,2.0)
end


$ gfortran-13-20221106 -c z1.f90
f951: internal compiler error: Segmentation fault
0xf4697f crash_signal
../../gcc/toplev.cc:314
0x7c4b87 arith_power
../../gcc/fortran/arith.cc:989
0x7c2ce9 reduce_binary_ac
../../gcc/fortran/arith.cc:1365
0x7c2d3e reduce_binary_ac
../../gcc/fortran/arith.cc:1369
0x7c2f9f reduce_binary
../../gcc/fortran/arith.cc:1520
0x7c33d2 eval_intrinsic
../../gcc/fortran/arith.cc:1701
0x835df6 match_mult_operand
../../gcc/fortran/matchexp.cc:288
0x835f98 match_add_operand
../../gcc/fortran/matchexp.cc:356
0x8361ec match_level_2
../../gcc/fortran/matchexp.cc:480
0x836342 match_level_3
../../gcc/fortran/matchexp.cc:551
0x836434 match_level_4
../../gcc/fortran/matchexp.cc:599
0x836434 match_and_operand
../../gcc/fortran/matchexp.cc:693
0x836622 match_or_operand
../../gcc/fortran/matchexp.cc:722
0x8366f2 match_equiv_operand
../../gcc/fortran/matchexp.cc:765
0x8367c4 match_level_5
../../gcc/fortran/matchexp.cc:811
0x835b91 gfc_match_expr(gfc_expr**)
../../gcc/fortran/matchexp.cc:870
0x81d289 match_io_element
../../gcc/fortran/io.cc:3668
0x81fbba match_io_list
../../gcc/fortran/io.cc:3716
0x81ffbe match_io
../../gcc/fortran/io.cc:4394
0x823aba gfc_match_print()
../../gcc/fortran/io.cc:4450

[Bug fortran/107679] New: [13 Regression] ICE in maybe_register_def, at tree-into-ssa.cc:1914

2022-11-14 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107679

Bug ID: 107679
   Summary: [13 Regression] ICE in maybe_register_def, at
tree-into-ssa.cc:1914
   Product: gcc
   Version: 13.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gs...@t-online.de
  Target Milestone: ---

Started between 20220918 and 20220925, at -O1+ :
(gcc configured with --enable-checking=yes)


$ cat z1.f90
subroutine s1(x)
   integer, intent(out) :: x
end
subroutine s2(z)
   integer, value :: z
   call s1(z)
end


$ cat z2.f90
subroutine s1(x)
   integer, intent(out) :: x
   x = 3
end
subroutine s2(z)
   integer, value :: z
   call s1(z)
end


$ gfortran-13-20221106 -c z1.f90 -O2
during GIMPLE pass: ccp
z1.f90:7:3:

7 | end
  |   ^
internal compiler error: in maybe_register_def, at tree-into-ssa.cc:1914
0xffb188 maybe_register_def
../../gcc/tree-into-ssa.cc:1914
0xffb188 rewrite_update_stmt
../../gcc/tree-into-ssa.cc:2063
0xffb188 rewrite_update_dom_walker::before_dom_children(basic_block_def*)
../../gcc/tree-into-ssa.cc:2236
0x1cce2a7 dom_walker::walk(basic_block_def*)
../../gcc/domwalk.cc:311
0xff80e9 rewrite_blocks
../../gcc/tree-into-ssa.cc:2296
0xfff24e update_ssa(unsigned int)
../../gcc/tree-into-ssa.cc:3581
0x11f022e execute_update_addresses_taken()
../../gcc/tree-ssa.cc:2177
0xe47700 execute_function_todo
../../gcc/passes.cc:2066
0xe480b2 execute_todo
../../gcc/passes.cc:2145

[Bug fortran/107596] New: ICE in gfc_match_submodule, at fortran/module.cc:773

2022-11-09 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107596

Bug ID: 107596
   Summary: ICE in gfc_match_submodule, at fortran/module.cc:773
   Product: gcc
   Version: 13.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gs...@t-online.de
  Target Milestone: ---

Started with r6 :


$ cat z1.f90
submodule(m)
submodule(m)


$ cat z2.f90
module m
end
submodule(m)1
submodule(m)2
end


$ gfortran-13-20221106 -c z1.f90
z1.f90:1:12:

1 | submodule(m)
  |1
Error: Syntax error in SUBMODULE statement at (1)
f951: internal compiler error: in gfc_match_submodule, at fortran/module.cc:773
0x83b802 gfc_match_submodule()
../../gcc/fortran/module.cc:773
0x855df1 match_word
../../gcc/fortran/parse.cc:67
0x85b8cd decode_statement
../../gcc/fortran/parse.cc:564
0x85be8a next_free
../../gcc/fortran/parse.cc:1402
0x85be8a next_statement
../../gcc/fortran/parse.cc:1634
0x861e39 gfc_parse_file()
../../gcc/fortran/parse.cc:6765
0x8b0c8f gfc_be_parse_file
../../gcc/fortran/f95-lang.cc:229

[Bug fortran/107595] New: ICE in ix86_push_argument, at config/i386/i386.cc:4335

2022-11-09 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107595

Bug ID: 107595
   Summary: ICE in ix86_push_argument, at config/i386/i386.cc:4335
   Product: gcc
   Version: 13.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gs...@t-online.de
  Target Milestone: ---

Affects versions down to at least r5 :
(GNU Extension: Old-style initialization )


$ cat z1.f90
program p
   type t
  integer :: a
  integer, pointer :: b
   end type
   type(t) x /t(4, null())/
   print *, x%b
end


$ cat z2.f90
program p
   type t
  integer :: a
  integer, pointer :: b
   end type
   type(t) :: x = t(4, null())
   print *, x%b
end


$ gfortran-13-20221106 -c z2.f90
$
$ gfortran-13-20221106 -c z1.f90
z1.f90:8:3:

8 | end
  |   ^
internal compiler error: Segmentation fault
0xf4697f crash_signal
../../gcc/toplev.cc:314
0x134e81d ix86_push_argument
../../gcc/config/i386/i386.cc:4335
0x9bcce3 expand_call(tree_node*, rtx_def*, int)
../../gcc/calls.cc:2688
0xb1cb29 expand_expr_real_1(tree_node*, rtx_def*, machine_mode,
expand_modifier, rtx_def**, bool)
../../gcc/expr.cc:11868
0x13138ac expand_expr
../../gcc/expr.h:310
0x13138ac output_constant
../../gcc/varasm.cc:5250
0x1314d97 output_constant
../../gcc/varasm.cc:5158
0x1314d97 output_constructor_regular_field
../../gcc/varasm.cc:5545
0x1314d97 output_constructor
../../gcc/varasm.cc:5812
0x1316ba9 output_constant
../../gcc/varasm.cc:5158
0x1316ba9 assemble_variable_contents
../../gcc/varasm.cc:2231
0x13218dc assemble_variable(tree_node*, int, int, int)
../../gcc/varasm.cc:2410
0x1324f84 varpool_node::assemble_decl()
../../gcc/varpool.cc:596
0xa2b037 output_in_order
../../gcc/cgraphunit.cc:2151
0xa2b037 symbol_table::compile()
../../gcc/cgraphunit.cc:2355
0xa2e97f symbol_table::compile()
../../gcc/cgraphunit.cc:2546
0xa2e97f symbol_table::finalize_compilation_unit()
../../gcc/cgraphunit.cc:2543

[Bug c++/107594] New: ICE in module_state, at cp/module.cc:3810

2022-11-09 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107594

Bug ID: 107594
   Summary: ICE in module_state, at cp/module.cc:3810
   Product: gcc
   Version: 13.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gs...@t-online.de
  Target Milestone: ---

Started with r11 :
(gcc configured with --enable-checking=yes)


$ cat z1.cc
import ;


$ gcc-13-20221106 -c z1.cc -fmodules-ts -nostdinc
z1.cc:1:8: error: no include path in which to search for nix
1 | import ;
  |^
z1.cc:1:1: internal compiler error: in module_state, at cp/module.cc:3810
1 | import ;
  | ^~
0x98332e module_state::module_state(tree_node*, module_state*, bool)
../../gcc/cp/module.cc:3808
0x99b3a1 get_module(tree_node*, module_state*, bool)
../../gcc/cp/module.cc:13952
0x95554c module_token_filter::resume(int, int, tree_node*, unsigned int)
../../gcc/cp/lex.cc:513
0x95554c module_token_lang(int, int, tree_node*, unsigned int, unsigned long)
../../gcc/cp/lex.cc:563
0xa3b56b cp_lexer_new_main
../../gcc/cp/parser.cc:728
0xa3b56b c_parse_file()
../../gcc/cp/parser.cc:48815
0xbe0a71 c_common_parse_file()
../../gcc/c-family/c-opts.cc:1244

[Bug fortran/107577] New: [13 Regression] ICE in find_array_spec, at fortran/resolve.cc:5008

2022-11-08 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107577

Bug ID: 107577
   Summary: [13 Regression] ICE in find_array_spec, at
fortran/resolve.cc:5008
   Product: gcc
   Version: 13.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gs...@t-online.de
  Target Milestone: ---

Started between 20220717 and 20220724 :


$ cat z1.f90
program p
   implicit none
   associate (y => f(4))
  if (lbound (y, 1) /= 1) stop 1
  if (y(1) /= 1) stop 2
   end associate
end


$ gfortran-13-20221106 -c z1.f90
z1.f90:3:19:

3 |associate (y => f(4))
  |   1
Error: Function 'f' at (1) has no IMPLICIT type
z1.f90:3:23:

3 |associate (y => f(4))
  |   1
Error: Symbol 'y' at (1) has no IMPLICIT type
z1.f90:3:19:

3 |associate (y => f(4))
  |   1
Error: Selector at (1) has no type

in gfc_format_decoder, at fortran/error.cc:1071
0x7fab72 gfc_format_decoder
../../gcc/fortran/error.cc:1071
0x1f8bff0 pp_format(pretty_printer*, text_info*)
../../gcc/pretty-print.cc:1475
0x1f6af10 diagnostic_report_diagnostic(diagnostic_context*, diagnostic_info*)
../../gcc/diagnostic.cc:1548
0x7fabd9 gfc_report_diagnostic
../../gcc/fortran/error.cc:883
0x7fad68 gfc_error_opt
../../gcc/fortran/error.cc:1453
0x7fc5d0 gfc_error(char const*, ...)
../../gcc/fortran/error.cc:1482
0x880aba find_array_spec
../../gcc/fortran/resolve.cc:5008
0x880aba gfc_resolve_ref(gfc_expr*)
../../gcc/fortran/resolve.cc:5355
0x8708d7 resolve_variable
../../gcc/fortran/resolve.cc:5870
0x8708d7 gfc_resolve_expr(gfc_expr*)
../../gcc/fortran/resolve.cc:7196
0x8747df gfc_resolve_expr(gfc_expr*)
../../gcc/fortran/resolve.cc:2234
0x8747df resolve_actual_arglist
../../gcc/fortran/resolve.cc:2153
0x87048e resolve_function
../../gcc/fortran/resolve.cc:3292
0x87048e gfc_resolve_expr(gfc_expr*)
../../gcc/fortran/resolve.cc:7194
0x8739c9 gfc_resolve_expr(gfc_expr*)
../../gcc/fortran/resolve.cc:7161
0x8739c9 resolve_operator
../../gcc/fortran/resolve.cc:4093
0x86feff gfc_resolve_expr(gfc_expr*)
../../gcc/fortran/resolve.cc:7187
0x877231 gfc_resolve_expr(gfc_expr*)
../../gcc/fortran/resolve.cc:7161
0x877231 gfc_resolve_blocks(gfc_code*, gfc_namespace*)
../../gcc/fortran/resolve.cc:10842
0x8775d8 gfc_resolve_code(gfc_code*, gfc_namespace*)
../../gcc/fortran/resolve.cc:11970

[Bug fortran/107576] [10/11/12/13 Regression] ICE in gfc_conv_procedure_call, at fortran/trans-expr.cc:6193

2022-11-08 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107576

G. Steinmetz  changed:

   What|Removed |Added

   Keywords||accepts-invalid,
   ||ice-on-invalid-code

--- Comment #1 from G. Steinmetz  ---

Variant z2.f90 with reversed order always compiles,
for every tested release, with and without -std=legacy :
(but no explicit interface, so error expected)


$ cat z2.f90
program p
   integer, pointer :: z(:) => null()
   call s(null(z))
   call s(z)
end

$ gfortran-13-20221106 -c z2.f90
$ gfortran-13-20221106 -c z2.f90 -std=legacy


Test cases with an explicit interface and specified pointer dummy (ok) :

$ cat z1c.f90
program p
   integer, pointer :: z(:) => null()
   call s(z)
   call s(null(z))
contains
   subroutine s(x)
  integer, pointer :: x(:)
   end
end

$ cat z2c.f90
program p
   integer, pointer :: z(:) => null()
   call s(null(z))
   call s(z)
contains
   subroutine s(x)
  integer, pointer :: x(:)
   end
end

[Bug fortran/107576] New: [10/11/12/13 Regression] ICE in gfc_conv_procedure_call, at fortran/trans-expr.cc:6193

2022-11-08 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107576

Bug ID: 107576
   Summary: [10/11/12/13 Regression] ICE in
gfc_conv_procedure_call, at fortran/trans-expr.cc:6193
   Product: gcc
   Version: 13.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gs...@t-online.de
  Target Milestone: ---

Started with r7 :


$ cat z1.f90
program p
   integer, pointer :: z(:) => null()
   call s(z)
   call s(null(z))
end


$ gfortran-6 -c z1.f90 -std=legacy
$
$ gfortran-13-20221106 -c z1.f90 -std=legacy
z1.f90:4:18:

4 |call s(null(z))
  |  1
Warning: Unexpected NULL() intrinsic at (1) to dummy '_formal_0'
z1.f90:4:18: internal compiler error: in gfc_conv_procedure_call, at
fortran/trans-expr.cc:6193
0x8afc1a gfc_conv_procedure_call(gfc_se*, gfc_symbol*, gfc_actual_arglist*,
gfc_expr*, vec*)
../../gcc/fortran/trans-expr.cc:6191
0x8ed790 gfc_trans_call(gfc_code*, bool, tree_node*, tree_node*, bool)
../../gcc/fortran/trans-stmt.cc:422
0x8740f8 trans_code
../../gcc/fortran/trans.cc:2018
0x89d4ce gfc_generate_function_code(gfc_namespace*)
../../gcc/fortran/trans-decl.cc:7659
0x81f57e translate_all_program_units
../../gcc/fortran/parse.cc:6696
0x81f57e gfc_parse_file()
../../gcc/fortran/parse.cc:7002
0x86ccbf gfc_be_parse_file
../../gcc/fortran/f95-lang.cc:229

[Bug c++/107575] New: ICE: tree check: expected tree that contains 'decl common' structure, have 'error_mark' in duplicate_decls, at cp/decl.cc:2605

2022-11-08 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107575

Bug ID: 107575
   Summary: ICE: tree check: expected tree that contains 'decl
common' structure, have 'error_mark' in
duplicate_decls, at cp/decl.cc:2605
   Product: gcc
   Version: 13.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gs...@t-online.de
  Target Milestone: ---

Started with r11 :


$ cat z1.cc
void f (void) {
  virtual int f(void) const;
  virtual int f(void);
}


$ g++-13-20221106 -c z1.cc
z1.cc: In function 'void f()':
z1.cc:2:3: error: 'virtual' outside class declaration
2 |   virtual int f(void) const;
  |   ^~~
z1.cc:2:23: error: non-member function 'int f()' cannot have cv-qualifier
2 |   virtual int f(void) const;
  |   ^
z1.cc: At global scope:
z1.cc:2:15: error: ambiguating new declaration of 'int f()'
2 |   virtual int f(void) const;
  |   ^
z1.cc:1:6: note: old declaration 'void f()'
1 | void f (void) {
  |  ^
z1.cc: In function 'void f()':
z1.cc:3:3: error: 'virtual' outside class declaration
3 |   virtual int f(void);
  |   ^~~
z1.cc:3:21: internal compiler error: tree check: expected tree that contains
'decl common' structure, have 'error_mark' in duplicate_decls, at
cp/decl.cc:2605
3 |   virtual int f(void);
  | ^
0x70381d tree_contains_struct_check_failed(tree_node const*,
tree_node_structure_enum, char const*, int, char const*)
../../gcc/tree.cc:9020
0x8e2b53 contains_struct_check(tree_node*, tree_node_structure_enum, char
const*, int, char const*)
../../gcc/tree.h:3646
0x8e2b53 duplicate_decls(tree_node*, tree_node*, bool, bool)
../../gcc/cp/decl.cc:2605
0x9d1ba3 pushdecl(tree_node*, bool)
../../gcc/cp/name-lookup.cc:3686
0x8f026c start_decl(cp_declarator const*, cp_decl_specifier_seq*, int,
tree_node*, tree_node*, tree_node**)
../../gcc/cp/decl.cc:5776
0xa32749 cp_parser_init_declarator
../../gcc/cp/parser.cc:22757
0xa05e62 cp_parser_simple_declaration
../../gcc/cp/parser.cc:15288
0xa07a19 cp_parser_declaration_statement
../../gcc/cp/parser.cc:14369
0xa080db cp_parser_statement
../../gcc/cp/parser.cc:12440
0xa09204 cp_parser_statement_seq_opt
../../gcc/cp/parser.cc:12857
0xa092e7 cp_parser_compound_statement
../../gcc/cp/parser.cc:12809
0xa31760 cp_parser_function_body
../../gcc/cp/parser.cc:25183
0xa31760 cp_parser_ctor_initializer_opt_and_function_body
../../gcc/cp/parser.cc:25234
0xa31dda cp_parser_function_definition_after_declarator
../../gcc/cp/parser.cc:31392
0xa3331c cp_parser_function_definition_from_specifiers_and_declarator
../../gcc/cp/parser.cc:31309
0xa3331c cp_parser_init_declarator
../../gcc/cp/parser.cc:22637
0xa05e62 cp_parser_simple_declaration
../../gcc/cp/parser.cc:15288
0xa3aceb cp_parser_declaration
../../gcc/cp/parser.cc:14974
0xa3b808 cp_parser_translation_unit
../../gcc/cp/parser.cc:5080
0xa3b808 c_parse_file()
../../gcc/cp/parser.cc:48817

[Bug c++/107574] New: [10/11/12/13 Regression] ICE: tree check: expected record_type or union_type or qual_union_type, have integer_type in cp_fold_convert, at cp/cvt.cc:613

2022-11-08 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107574

Bug ID: 107574
   Summary: [10/11/12/13 Regression] ICE: tree check: expected
record_type or union_type or qual_union_type, have
integer_type in cp_fold_convert, at cp/cvt.cc:613
   Product: gcc
   Version: 13.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gs...@t-online.de
  Target Milestone: ---

Affects versions down to r9 :


$ cat z1.cc
struct A { int i; };
struct B:A { int j; };
struct C:B { int k; static_assert((int(B::*))::k, ""); };


$ g++-13-20221106 -c z1.cc
z1.cc:3:50: internal compiler error: tree check: expected record_type or
union_type or qual_union_type, have integer_type in cp_fold_convert, at
cp/cvt.cc:613
3 | struct C:B { int k; static_assert((int(B::*))::k, ""); };
  |  ^
0x70312c tree_check_failed(tree_node const*, char const*, int, char const*,
...)
../../gcc/tree.cc:8846
0x8af521 tree_check3(tree_node*, char const*, int, char const*, tree_code,
tree_code, tree_code)
../../gcc/tree.h:3572
0x8af521 cp_fold_convert(tree_node*, tree_node*)
../../gcc/cp/cvt.cc:612
0x8666a4 cxx_eval_constant_expression
../../gcc/cp/constexpr.cc:7602
0x8708fa cxx_eval_outermost_constant_expr
../../gcc/cp/constexpr.cc:8142
0x8757ea maybe_constant_value(tree_node*, tree_node*, bool)
../../gcc/cp/constexpr.cc:8412
0x8aa095 cp_fully_fold(tree_node*)
../../gcc/cp/cp-gimplify.cc:2370
0xb46c51 cp_build_binary_op(op_location_t const&, tree_code, tree_node*,
tree_node*, int)
../../gcc/cp/typeck.cc:6565
0xb4bb63 convert_ptrmem(tree_node*, tree_node*, bool, bool, int)
../../gcc/cp/typeck.cc:8171
0xb522f2 cp_build_c_cast(unsigned int, tree_node*, tree_node*, int)
../../gcc/cp/typeck.cc:9189
0xb528b1 build_c_cast(unsigned int, tree_node*, cp_expr)
../../gcc/cp/typeck.cc:9095
0x9f0682 cp_parser_cast_expression
../../gcc/cp/parser.cc:9978
0x9f0ccf cp_parser_binary_expression
../../gcc/cp/parser.cc:10091
0x9f1a74 cp_parser_assignment_expression
../../gcc/cp/parser.cc:10431
0x9f48a5 cp_parser_constant_expression
../../gcc/cp/parser.cc:10726
0x9f504e cp_parser_static_assert
../../gcc/cp/parser.cc:16280
0xa39204 cp_parser_member_declaration
../../gcc/cp/parser.cc:27068
0xa013b2 cp_parser_member_specification_opt
../../gcc/cp/parser.cc:26936
0xa013b2 cp_parser_class_specifier
../../gcc/cp/parser.cc:26011
0xa04240 cp_parser_type_specifier
../../gcc/cp/parser.cc:19387

[Bug fortran/107560] New: ICE in gfc_get_derived_type, at fortran/trans-types.cc:2811

2022-11-07 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107560

Bug ID: 107560
   Summary: ICE in gfc_get_derived_type, at
fortran/trans-types.cc:2811
   Product: gcc
   Version: 13.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gs...@t-online.de
  Target Milestone: ---

Affects versions down to at least r5 :


$ cat z1.f90
program p
   type t
  character(+'1') :: c
   end type
   type(t) :: x = t('a')
end


$ cat z2.f90
program p
   type t
  character(+z'1') :: c
   end type
   type(t) :: x = t('a')
end


$ gfortran-13-20221106 -c z1.f90
z1.f90:6:3:

6 | end
  |   1
internal compiler error: in gfc_get_derived_type, at
fortran/trans-types.cc:2811
0x8fe77e gfc_get_derived_type(gfc_symbol*, int)
../../gcc/fortran/trans-types.cc:2811
0x8feaa8 gfc_typenode_for_spec(gfc_typespec*, int)
../../gcc/fortran/trans-types.cc:1207
0x8fed10 gfc_sym_type(gfc_symbol*, bool)
../../gcc/fortran/trans-types.cc:2319
0x88f479 gfc_emit_parameter_debug_info
../../gcc/fortran/trans-decl.cc:5504
0x857982 do_traverse_symtree
../../gcc/fortran/symbol.cc:4180
0x89d718 gfc_generate_function_code(gfc_namespace*)
../../gcc/fortran/trans-decl.cc:7823
0x81f57e translate_all_program_units
../../gcc/fortran/parse.cc:6696
0x81f57e gfc_parse_file()
../../gcc/fortran/parse.cc:7002
0x86ccbf gfc_be_parse_file
../../gcc/fortran/f95-lang.cc:229

[Bug fortran/107559] New: ICE in resolve_equivalence, at fortran/resolve.cc:17230

2022-11-07 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107559

Bug ID: 107559
   Summary: ICE in resolve_equivalence, at
fortran/resolve.cc:17230
   Product: gcc
   Version: 13.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gs...@t-online.de
  Target Milestone: ---

Affects versions down to at least r5 :


$ cat z1.f90
module m
   implicit none
   integer, protected :: a
   integer :: b
   equivalence (a, b)
end


$ gfortran-13-20221106 -c z1.f90
z1.f90:5:18:

5 |equivalence (a, b)
  |  1
Error: Either all or none of the objects in the EQUIVALENCE set at (1) shall
have the PROTECTED attribute


$ gfortran-13-20221106 -c z1.f90 -std=f95
z1.f90:3:25:

3 |integer, protected :: a
  | 1
Error: Fortran 2003: PROTECTED attribute at (1)
z1.f90:5:17:

5 |equivalence (a, b)
  | 1
Error: Symbol 'a' at (1) has no IMPLICIT type

Segmentation fault
0xf4697f crash_signal
../../gcc/toplev.cc:314
0x7faa18 gfc_format_decoder
../../gcc/fortran/error.cc:1071
0x1f8bff0 pp_format(pretty_printer*, text_info*)
../../gcc/pretty-print.cc:1475
0x1f6af10 diagnostic_report_diagnostic(diagnostic_context*, diagnostic_info*)
../../gcc/diagnostic.cc:1548
0x7fabd9 gfc_report_diagnostic
../../gcc/fortran/error.cc:883
0x7fad68 gfc_error_opt
../../gcc/fortran/error.cc:1453
0x7fbb20 gfc_notify_std(int, char const*, ...)
../../gcc/fortran/error.cc:1037
0x87f5de resolve_equivalence
../../gcc/fortran/resolve.cc:17230
0x87f5de resolve_types
../../gcc/fortran/resolve.cc:17575
0x87a43c gfc_resolve(gfc_namespace*)
../../gcc/fortran/resolve.cc:17657
0x862012 gfc_parse_file()
../../gcc/fortran/parse.cc:6837
0x8b0c8f gfc_be_parse_file
../../gcc/fortran/f95-lang.cc:229

[Bug c++/107558] New: [10/11/12/13 Regression] ICE in fld_incomplete_type_of, at ipa-free-lang-data.cc:258

2022-11-07 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107558

Bug ID: 107558
   Summary: [10/11/12/13 Regression] ICE in
fld_incomplete_type_of, at ipa-free-lang-data.cc:258
   Product: gcc
   Version: 13.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gs...@t-online.de
  Target Milestone: ---

Started with r9, between 20200508 and 20200612, reduced from file
llvm-project-llvmorg-14.0.6/clang/test/OpenMP/nvptx_lambda_capturing.cpp :


$ cat z1.cc
template 
int foo(const T ) {
  #pragma omp target parallel
  t();
  return 0;
}
struct S {
  int a = 15;
  int foo() {
auto & = [&]() { return a; };
#pragma omp target
L();
#pragma omp target parallel
L();
return a + ::foo(L);
  }
} s;
int main(int argc, char **argv) {
  int  = argc;
  int & = 1;
  int *d = 
  int a;
  auto & = [&]() { return argc + b + c + reinterpret_cast(d) + a;
};
#pragma omp target firstprivate(argc) map(to : a)
  L();
#pragma omp target parallel
  L();
  return argc + s.foo();
}


$ cat z2.cc
  int a = 15;
  int foo() {
auto & = [&]() { return a; };
#pragma omp target parallel
L();
}


$ gcc-13-20221106 -c z2.cc -fopenmp -flto -fmerge-all-constants
z2.cc: In function 'int foo()':
z2.cc:6:1: warning: no return statement in function returning non-void
[-Wreturn-type]
6 | }
  | ^
during IPA pass: *free_lang_data
z2.cc: At global scope:
z2.cc:6:1: internal compiler error: in fld_incomplete_type_of, at
ipa-free-lang-data.cc:258
0x1aa1387 fld_incomplete_type_of
../../gcc/ipa-free-lang-data.cc:257
0x1aa26dd fld_simplified_type
../../gcc/ipa-free-lang-data.cc:344
0x1aa26dd free_lang_data_in_decl
../../gcc/ipa-free-lang-data.cc:653
0x1aa26dd free_lang_data_in_cgraph
../../gcc/ipa-free-lang-data.cc:1068
0x1aa26dd free_lang_data
../../gcc/ipa-free-lang-data.cc:1109
0x1aa26dd execute
../../gcc/ipa-free-lang-data.cc:1176

[Bug c/107557] [12/13 Regression] ICE in make_ssa_name_fn, at tree-ssanames.cc:360

2022-11-07 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107557

G. Steinmetz  changed:

   What|Removed |Added

 Target||x86_64-pc-linux-gnu
   Keywords||ice-on-valid-code

--- Comment #1 from G. Steinmetz  ---

Or this combination :


$ gcc-13-20221106 -c z1.c -flto -fsanitize=undefined
z1.c: In function 'main':
z1.c:15:30: warning: passing argument 2 of 'test' from incompatible pointer
type [-Wincompatible-pointer-types]
   15 |   return f(, ) + test(m, );
  |  ^~~
  |  |
  |  int (* (*)[(long int)(((m) <= 0 ?
__builtin___ubsan_handle_vla_bound_not_positive(&*.Lubsan_data0, (long unsigned
int)(m)) : (void)0, (m))) - 1])(void)
z1.c:6:25: note: expected 'int (* (*)(void))[(long int)(n) - 1]' but argument
is of type 'int (* (*)[(long int)(((m) <= 0 ?
__builtin___ubsan_handle_vla_bound_not_positive(&*.Lubsan_data0, (long unsigned
int)(m)) : (void)0, (m))) - 1])(void)'
6 | int test(int n, int (*(*fn)(void))[n])
  | ^
during IPA pass: modref
z1.c: At top level:
z1.c:16:1: internal compiler error: tree code 'ssa_name' is not supported in
LTO streams
   16 | }
  | ^
0xb9c2ab lto_write_tree
../../gcc/lto-streamer-out.cc:561
0xb9c2ab lto_output_tree_1
../../gcc/lto-streamer-out.cc:599
0xba2b17 DFS::DFS(output_block*, tree_node*, bool, bool, bool)
../../gcc/lto-streamer-out.cc:899
0xba3a18 lto_output_tree(output_block*, tree_node*, bool, bool)
../../gcc/lto-streamer-out.cc:1866
0xb9beb1 write_global_stream
../../gcc/lto-streamer-out.cc:2861
0xba64bf lto_output_decl_state_streams(output_block*, lto_out_decl_state*)
../../gcc/lto-streamer-out.cc:2908
0xba64bf produce_asm_for_decls()
../../gcc/lto-streamer-out.cc:3302
0xc1ee6f write_lto
../../gcc/passes.cc:2780
0xc22c2e ipa_write_summaries_1
../../gcc/passes.cc:2841
0xc22c2e ipa_write_summaries()
../../gcc/passes.cc:2897
0x8e4874 ipa_passes
../../gcc/cgraphunit.cc:2218
0x8e4874 symbol_table::compile()
../../gcc/cgraphunit.cc:2291
0x8e764f symbol_table::compile()
../../gcc/cgraphunit.cc:2546
0x8e764f symbol_table::finalize_compilation_unit()
../../gcc/cgraphunit.cc:2543

[Bug c/107557] New: [12/13 Regression] ICE in make_ssa_name_fn, at tree-ssanames.cc:360

2022-11-07 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107557

Bug ID: 107557
   Summary: [12/13 Regression] ICE in make_ssa_name_fn, at
tree-ssanames.cc:360
   Product: gcc
   Version: 13.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gs...@t-online.de
  Target Milestone: ---

Started between 20210822 and 20210905 at -O3|-Ofast, with file
llvm-project-llvmorg-14.0.6/clang/test/CodeGen/vlt_to_pointer.c :


$ cat z1.c
int c[1][3*2];
int f(int * const m, int (**v)[*m * 2])
{
  return &(c[0][*m]) == &((*v)[0][*m]);
}
int test(int n, int (*(*fn)(void))[n])
{
  return (*fn())[0];
}
int main()
{
  int m = 3;
  int (*d)[3*2] = c;
  int (*fn[m])(void);
  return f(, ) + test(m, );
}


$ gcc-13-20221106 -c z1.c -m32 -Ofast -fnon-call-exceptions -ftrapv
-fsanitize=undefined
z1.c: In function 'main':
z1.c:15:30: warning: passing argument 2 of 'test' from incompatible pointer
type [-Wincompatible-pointer-types]
   15 |   return f(, ) + test(m, );
  |  ^~~
  |  |
  |  int (* (*)[(((m) <= 0 ?
__builtin___ubsan_handle_vla_bound_not_positive(&*.Lubsan_data0, (unsigned
int)(m)) : (void)0, (m))) - 1])(void)
z1.c:6:25: note: expected 'int (* (*)(void))[(n) - 1]' but argument is of type
'int (* (*)[(((m) <= 0 ?
__builtin___ubsan_handle_vla_bound_not_positive(&*.Lubsan_data0, (unsigned
int)(m)) : (void)0, (m))) - 1])(void)'
6 | int test(int n, int (*(*fn)(void))[n])
  | ^
during GIMPLE pass: einline
z1.c:15:22: internal compiler error: in make_ssa_name_fn, at
tree-ssanames.cc:360
   15 |   return f(, ) + test(m, );
  |  ^~~~
0xf0e385 make_ssa_name_fn(function*, tree_node*, gimple*, unsigned int)
../../gcc/tree-ssanames.cc:357
0xd7104e make_ssa_name
../../gcc/tree-ssanames.h:97
0xd7104e remap_ssa_name
../../gcc/tree-inline.cc:237
0xd74257 copy_tree_body_r(tree_node**, int*, void*)
../../gcc/tree-inline.cc:1226
0xfa17b2 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/tree.cc:11281
0xd70124 remap_type_1
../../gcc/tree-inline.cc:596
0xd70498 remap_type(tree_node*, copy_body_data*)
../../gcc/tree-inline.cc:713
0xd7037e remap_type_1
../../gcc/tree-inline.cc:532
0xd70498 remap_type(tree_node*, copy_body_data*)
../../gcc/tree-inline.cc:713
0xd70057 remap_type_1
../../gcc/tree-inline.cc:425
0xd70498 remap_type(tree_node*, copy_body_data*)
../../gcc/tree-inline.cc:713
0xd700e6 remap_type_1
../../gcc/tree-inline.cc:509
0xd70498 remap_type(tree_node*, copy_body_data*)
../../gcc/tree-inline.cc:713
0xd70057 remap_type_1
../../gcc/tree-inline.cc:425
0xd70498 remap_type(tree_node*, copy_body_data*)
../../gcc/tree-inline.cc:713
0xd7918c initialize_inlined_parameters
../../gcc/tree-inline.cc:3659
0xd7918c expand_call_inline
../../gcc/tree-inline.cc:5020
0xd7af89 gimple_expand_calls_inline
../../gcc/tree-inline.cc:5323
0xd7af89 optimize_inline_calls(tree_node*)
../../gcc/tree-inline.cc:5495
0x190544e early_inliner(function*)
../../gcc/ipa-inline.cc:3038

[Bug fortran/107426] New: [12/13 Regression] ICE in gfc_compare_derived_types, at fortran/interface.cc:636

2022-10-26 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107426

Bug ID: 107426
   Summary: [12/13 Regression] ICE in gfc_compare_derived_types,
at fortran/interface.cc:636
   Product: gcc
   Version: 13.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gs...@t-online.de
  Target Milestone: ---

Started between 20210905 and 20210919 :


$ cat z1.f90
module m
contains
   subroutine p() bind(c)
  use, intrinsic :: iso_c_binding
  integer, target :: a = 1
  type(c_ptr) :: z
  interface
 subroutine s(x) bind(cc)   !!
use, intrinsic :: iso_c_binding
integer(c_int), value :: x
 end
  end interface
  z = c_loc(a)
  call s(z)
   end
end


$ gfortran-13-20221023 -c z0.f90   # corrected cc -> c at marker !!
z0.f90:14:15:

   14 |   call s(z)
  |   1
Error: Type mismatch in argument 'x' at (1); passed TYPE(c_ptr) to INTEGER(4)


$ gfortran-13-20221023 -c z1.f90
z1.f90:8:32:

8 |  subroutine s(x) bind(cc)   !!
  |1
Error: Missing closing paren for binding label at (1)
z1.f90:9:43:

9 | use, intrinsic :: iso_c_binding
  |   1
Error: Unexpected USE statement in INTERFACE block at (1)
z1.f90:10:38:

   10 | integer(c_int), value :: x
  |  1
Error: Unexpected data declaration statement in INTERFACE block at (1)
z1.f90:11:12:

   11 |  end
  |1
Error: END INTERFACE statement expected at (1)
f951: internal compiler error: Segmentation fault
0xf43b3f crash_signal
../../gcc/toplev.cc:314
0x806bce gfc_compare_derived_types(gfc_symbol*, gfc_symbol*)
../../gcc/fortran/interface.cc:636
0x800803 gfc_check_assign(gfc_expr*, gfc_expr*, int, bool)
../../gcc/fortran/expr.cc:3830
0x86d655 resolve_ordinary_assign
../../gcc/fortran/resolve.cc:11222
0x87628b gfc_resolve_code(gfc_code*, gfc_namespace*)
../../gcc/fortran/resolve.cc:12123
0x878307 resolve_codes
../../gcc/fortran/resolve.cc:17624
0x87823e resolve_codes
../../gcc/fortran/resolve.cc:17607
0x8783ce gfc_resolve(gfc_namespace*)
../../gcc/fortran/resolve.cc:17659
0x85ff92 gfc_parse_file()
../../gcc/fortran/parse.cc:6837
0x8aec0f gfc_be_parse_file
../../gcc/fortran/f95-lang.cc:229

[Bug fortran/107425] New: [12/13 Regression] ICE in gimplify_var_or_parm_decl, at gimplify.cc:3060

2022-10-26 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107425

Bug ID: 107425
   Summary: [12/13 Regression] ICE in gimplify_var_or_parm_decl,
at gimplify.cc:3060
   Product: gcc
   Version: 13.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gs...@t-online.de
  Target Milestone: ---

Started between 20220116 and 20220123 :
(j has no value)


$ cat z1.f90
program p
   integer :: x(8)
   !$omp taskwait depend(iterator(i=1:8), in:x(j))
end


$ gfortran-12-20220116 -c z1.f90 -fopenmp
$
$ gfortran-13-20221023 -c z1.f90 -fopenmp
z1.f90:3:50:

3 |!$omp taskwait depend(iterator(i=1:8), in:x(j))
  |  ^
internal compiler error: in gimplify_var_or_parm_decl, at gimplify.cc:3060
0xc030eb gimplify_var_or_parm_decl
../../gcc/gimplify.cc:3060
0xc0fd1f gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc/gimplify.cc:16815
0xc0dc52 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc/gimplify.cc:16457
0xc0d7f3 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc/gimplify.cc:17134
0xc19633 gimplify_compound_lval
../../gcc/gimplify.cc:3303
0xc0d87a gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc/gimplify.cc:16306
0xc20d8a gimplify_addr_expr
../../gcc/gimplify.cc:6555
0xc0f47d gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc/gimplify.cc:16401
0xc1f78f gimplify_modify_expr
../../gcc/gimplify.cc:6147
0xc0fc37 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc/gimplify.cc:16354
0xc13b18 gimplify_stmt(tree_node**, gimple**)
../../gcc/gimplify.cc:7213
0xc0ef0b gimplify_statement_list
../../gcc/gimplify.cc:2021
0xc0ef0b gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc/gimplify.cc:16799
0xc13b18 gimplify_stmt(tree_node**, gimple**)
../../gcc/gimplify.cc:7213
0xc144a3 gimplify_bind_expr
../../gcc/gimplify.cc:1430
0xc0f41a gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc/gimplify.cc:16555
0xc13b18 gimplify_stmt(tree_node**, gimple**)
../../gcc/gimplify.cc:7213
0xc0ef0b gimplify_statement_list
../../gcc/gimplify.cc:2021
0xc0ef0b gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc/gimplify.cc:16799
0xc13b18 gimplify_stmt(tree_node**, gimple**)
../../gcc/gimplify.cc:7213

[Bug fortran/107424] New: [13 Regression] ICE in gfc_trans_omp_do, at fortran/trans-openmp.cc:5397

2022-10-26 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107424

Bug ID: 107424
   Summary: [13 Regression] ICE in gfc_trans_omp_do, at
fortran/trans-openmp.cc:5397
   Product: gcc
   Version: 13.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gs...@t-online.de
  Target Milestone: ---

Started between 20220501 and 20220508 :


$ cat z1.f90
program p
   integer :: i, j
   !$omp do simd collapse(2)
   do i = 1, 9, 2
  do j = 1, i
  end do
   end do
end


$ gfortran-13-20220501 -c z1.f90 -fopenmp
z1.f90:5:17:

5 |   do j = 1, i
  | 1
Error: !$OMP DO SIMD collapsed loops don't form rectangular iteration space at
(1)


$ gfortran-13-20221023 -c z1.f90 -fopenmp
z1.f90:3:28:

3 |!$omp do simd collapse(2)
  |1
internal compiler error: in gfc_trans_omp_do, at fortran/trans-openmp.cc:5397
0x953457 gfc_trans_omp_do
../../gcc/fortran/trans-openmp.cc:5397
0x9549a1 gfc_trans_omp_do_simd
../../gcc/fortran/trans-openmp.cc:6526
0x956cd2 gfc_trans_omp_directive(gfc_code*)
../../gcc/fortran/trans-openmp.cc:7554
0x8b7897 trans_code
../../gcc/fortran/trans.cc:2245
0x8ef2a9 gfc_generate_function_code(gfc_namespace*)
../../gcc/fortran/trans-decl.cc:7659
0x8608de translate_all_program_units
../../gcc/fortran/parse.cc:6696
0x8608de gfc_parse_file()
../../gcc/fortran/parse.cc:7002
0x8aec0f gfc_be_parse_file
../../gcc/fortran/f95-lang.cc:229

[Bug fortran/107423] New: ICE in parse_spec, at fortran/parse.cc:4017

2022-10-26 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107423

Bug ID: 107423
   Summary: ICE in parse_spec, at fortran/parse.cc:4017
   Product: gcc
   Version: 13.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gs...@t-online.de
  Target Milestone: ---

Affects versions down to r8 with option -std=f95
and file gfortran.dg/pdt_12.f03 or this reduction :


$ cat z1.f90
program p
   type t(k)
  integer, kind :: k
  integer :: a
   end type
contains
   function f()
  type(t(4)), allocatable :: x
  allocate (t(4) :: x)
   end
end


$ gfortran-13-20221023 -c z1.f90
$
$ gfortran-13-20221023 -c z1.f90 -std=f95
z1.f90:3:23:

3 |   integer, kind :: k
  |   1
Error: Fortran 2003: KIND attribute at (1) in a TYPE definition
z1.f90:8:15:

8 |   type(t(4)), allocatable :: x
  |   1
Error: Invalid character in name at (1)
z1.f90:9:18:

9 |   allocate (t(4) :: x)
  |  1
Error: Derived type 't' cannot be used as a variable at (1)
z1.f90:10:6:

   10 |end
  |  1
Error: Fortran 2008: END statement instead of END FUNCTION statement at (1)
z1.f90:11:3:

   11 | end
  |   1
Error: Fortran 2008: END statement instead of END FUNCTION statement at (1)
f951: internal compiler error: Segmentation fault
0xf43b3f crash_signal
../../gcc/toplev.cc:314
0x85c4de parse_spec
../../gcc/fortran/parse.cc:4017
0x85ea5c parse_progunit
../../gcc/fortran/parse.cc:6237
0x85ee41 parse_contained
../../gcc/fortran/parse.cc:6138
0x85ece6 parse_progunit
../../gcc/fortran/parse.cc:6309
0x860121 gfc_parse_file()
../../gcc/fortran/parse.cc:6782
0x8aec0f gfc_be_parse_file
../../gcc/fortran/f95-lang.cc:229

[Bug c++/107422] New: [12/13 Regression] ICE in lvalue_kind, at cp/tree.cc:293

2022-10-26 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107422

Bug ID: 107422
   Summary: [12/13 Regression] ICE in lvalue_kind, at
cp/tree.cc:293
   Product: gcc
   Version: 13.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gs...@t-online.de
  Target Milestone: ---

Started with r12 before 20210502 :
(gcc configured with --enable-checking=yes)


$ cat z1.cc
typedef decltype (__builtin_trap) t;
template  struct s;
union
{
  template  using b = decltype (t () (s  {}));
  template  b  get ();
};  // } u;


$ g++-13-20221023 -c z1.cc -fno-pretty-templates
z1.cc:5:26: error: 'template using::b = decltype
(t()(s{}))' invalid; an anonymous union may only have public non-static data
members [-fpermissive]
5 |   template  using b = decltype (t () (s  {}));
  |  ^
'
Segmentation fault
7 | };  // } u;
  | ^
0x11d0e4f crash_signal
../../gcc/toplev.cc:314
0xb15510 lvalue_kind(tree_node const*)
../../gcc/cp/tree.cc:293
0xae9fa7 finish_decltype_type(tree_node*, bool, int)
../../gcc/cp/semantics.cc:11488
0xb271af strip_typedefs(tree_node*, bool*, unsigned int)
../../gcc/cp/tree.cc:1788
0x91ae45 dump_type
../../gcc/cp/error.cc:538
0x91a6fc dump_type_prefix
../../gcc/cp/error.cc:981
0x92578d dump_function_decl
../../gcc/cp/error.cc:1804
0x9287f6 decl_to_string
../../gcc/cp/error.cc:3297
0x9287f6 cp_printer
../../gcc/cp/error.cc:4471
0x2202490 pp_format(pretty_printer*, text_info*)
../../gcc/pretty-print.cc:1475
0x21e13c0 diagnostic_report_diagnostic(diagnostic_context*, diagnostic_info*)
../../gcc/diagnostic.cc:1548
0x21e1b0a diagnostic_impl
../../gcc/diagnostic.cc:1712
0x21e224a permerror(unsigned int, char const*, ...)
../../gcc/diagnostic.cc:1979
0x8c30e7 fixup_anonymous_aggr(tree_node*)
../../gcc/cp/decl.cc:5194
0x8ea67c shadow_tag(cp_decl_specifier_seq*)
../../gcc/cp/decl.cc:5498
0xa011c9 cp_parser_simple_declaration
../../gcc/cp/parser.cc:15422
0xa35d9b cp_parser_declaration
../../gcc/cp/parser.cc:14970
0xa368b8 cp_parser_translation_unit
../../gcc/cp/parser.cc:5076
0xa368b8 c_parse_file()
../../gcc/cp/parser.cc:48860
0xbcef21 c_common_parse_file()
../../gcc/c-family/c-opts.cc:1247

  1   2   3   4   5   6   7   8   >