[Bug c/99322] New: [11 Regression] ICE in change_scope, at final.c:1480

2021-03-01 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99322

Bug ID: 99322
   Summary: [11 Regression] ICE in change_scope, at final.c:1480
   Product: gcc
   Version: 11.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 20201018 and 20201108 :


$ cat z1.c
void g ();
void f ()
{
  #pragma omp parallel
  for (;;)
for (int i = 0; i < 8; ++i)
  g ();
  { L1: }
  &&L1;
}


$ gcc-11-20210228 -c z1.c -fopenmp -O2 -g
$ gcc-11-20210228 -c z1.c -fopenmp -O3
$
$ gcc-11-20210228 -c z1.c -fopenmp -O3 -g
during RTL pass: final
z1.c: In function 'f._omp_fn.0':
z1.c:4:11: internal compiler error: Segmentation fault
4 |   #pragma omp parallel
  |   ^~~
0xb5eeff crash_signal
../../gcc/toplev.c:327
0x87295d change_scope
../../gcc/final.c:1480
0x8792c1 reemit_insn_block_notes
../../gcc/final.c:1581
0x8792c1 final_start_function_1
../../gcc/final.c:1785
0x879549 rest_of_handle_final
../../gcc/final.c:4675
0x879549 execute
../../gcc/final.c:4754

---

z1.c: In function 'f._omp_fn.0':
z1.c:10:1: error: location references block not in block tree
   10 | }
  | ^
L1:
during IPA pass: *free_lang_data
z1.c:10:1: internal compiler error: verify_gimple failed
0xd94884 verify_gimple_in_cfg(function*, bool)
../../gcc/tree-cfg.c:5477
0xc45d3e execute_function_todo
../../gcc/passes.c:2042
0xc46b7d do_per_function
../../gcc/passes.c:1694
0xc46be2 execute_todo
../../gcc/passes.c:2096

[Bug c/99323] New: [9/10/11 Regression] ICE in add_hint, at diagnostic-show-locus.c:2234

2021-03-01 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99323

Bug ID: 99323
   Summary: [9/10/11 Regression] ICE in add_hint, at
diagnostic-show-locus.c:2234
   Product: gcc
   Version: 11.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gs...@t-online.de
  Target Milestone: ---

With testfile gcc.c-torture/compile/limits-externdecl.c
and options -Wall -no-integrated-cpp, started with r8 :


$ gcc-11-20210228 -c limits-externdecl.c -no-integrated-cpp
$
$ gcc-11-20210228 -c limits-externdecl.c -Wall -no-integrated-cpp
limits-externdecl.c:55:26: warning: missing braces around initializer
[-Wmissing-braces]
   55 | REFERENCE references[] = {
  |  ^
   56 |   LIM5 (X)

limits-externdecl.c:58:1: internal compiler error: in add_hint, at
diagnostic-show-locus.c:2234
   58 | };
  | ^
0x15769cf add_hint
../../gcc/diagnostic-show-locus.c:2233
0x15769cf print_trailing_fixits
../../gcc/diagnostic-show-locus.c:2316
0x15769cf print_line
../../gcc/diagnostic-show-locus.c:2555
0x15769cf diagnostic_show_locus(diagnostic_context*, rich_location*,
diagnostic_t)
../../gcc/diagnostic-show-locus.c:2637
0x6e9ef5 c_diagnostic_finalizer
../../gcc/c-family/c-opts.c:175
0x157029b diagnostic_report_diagnostic(diagnostic_context*, diagnostic_info*)
../../gcc/diagnostic.c:1251
0x157091e diagnostic_impl
../../gcc/diagnostic.c:1406
0x1572272 warning_at(rich_location*, int, char const*, ...)
../../gcc/diagnostic.c:1558
0x662913 pop_init_level(unsigned int, int, obstack*, unsigned int)
../../gcc/c/c-typeck.c:8839
0x684a0a c_parser_braced_init
../../gcc/c/c-parser.c:5280
0x686d1e c_parser_initializer
../../gcc/c/c-parser.c:5201
0x694e3a c_parser_declaration_or_fndef
../../gcc/c/c-parser.c:2276
0x69c717 c_parser_external_declaration
../../gcc/c/c-parser.c:1777
0x69d239 c_parser_translation_unit
../../gcc/c/c-parser.c:1650
0x69d239 c_parse_file()
../../gcc/c/c-parser.c:21984
0x6ed0a2 c_common_parse_file()
../../gcc/c-family/c-opts.c:1218

[Bug c/99324] New: ICE in mark_addressable, at gimple-expr.c:918

2021-03-01 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99324

Bug ID: 99324
   Summary: ICE in mark_addressable, at gimple-expr.c:918
   Product: gcc
   Version: 11.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 r6, with missing ";" at /// :


$ cat z1.c
#include 
void f (int x, ...)
{
  va_list a;
  va_arg (a, int);
  int b () ///;
  int c[va_arg (a, int)];
  va_end (a);
  return;
}


$ gcc-11-20210228 -c z1.c
z1.c: In function 'b':
z1.c:7:3: internal compiler error: Segmentation fault
7 |   int c[va_arg (a, int)];
  |   ^~~
0xb5eeff crash_signal
../../gcc/toplev.c:327
0x8c6733 mark_addressable(tree_node*)
../../gcc/gimple-expr.c:918
0x6ce03c build_va_arg(unsigned int, tree_node*, tree_node*)
../../gcc/c-family/c-common.c:4630
0x6751b6 c_parser_postfix_expression
../../gcc/c/c-parser.c:9141
0x67e012 c_parser_unary_expression
../../gcc/c/c-parser.c:8224
0x67f03f c_parser_cast_expression
../../gcc/c/c-parser.c:8066
0x67f2f9 c_parser_binary_expression
../../gcc/c/c-parser.c:7869
0x680305 c_parser_conditional_expression
../../gcc/c/c-parser.c:7592
0x680861 c_parser_expr_no_commas
../../gcc/c/c-parser.c:7507
0x67d1f6 c_parser_direct_declarator_inner
../../gcc/c/c-parser.c:4095
0x694483 c_parser_declaration_or_fndef
../../gcc/c/c-parser.c:2148
0x695709 c_parser_declaration_or_fndef
../../gcc/c/c-parser.c:2498
0x693bb9 c_parser_compound_statement_nostart
../../gcc/c/c-parser.c:5700
0x693ff3 c_parser_compound_statement
../../gcc/c/c-parser.c:5597
0x6958a8 c_parser_declaration_or_fndef
../../gcc/c/c-parser.c:2539
0x69c717 c_parser_external_declaration
../../gcc/c/c-parser.c:1777
0x69d239 c_parser_translation_unit
../../gcc/c/c-parser.c:1650
0x69d239 c_parse_file()
../../gcc/c/c-parser.c:21984
0x6ed0a2 c_common_parse_file()
../../gcc/c-family/c-opts.c:1218

[Bug c/99325] New: [11 Regression] ICE in maybe_print_line_1, at c-family/c-ppoutput.c:454

2021-03-01 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99325

Bug ID: 99325
   Summary: [11 Regression] ICE in maybe_print_line_1, at
c-family/c-ppoutput.c:454
   Product: gcc
   Version: 11.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 20201115 and 20201122 :


$ cat z1.c
#line 9223372036854775807
#pragma message "abc"


$ gcc-11-20210228 -c z1.c -no-integrated-cpp
z1.c:1:7: warning: line number out of range
1 | #line 9223372036854775807
  |   ^~~
z1.c:-1: internal compiler error: Segmentation fault
0xb5eeff crash_signal
../../gcc/toplev.c:327
0x6edd15 maybe_print_line_1
../../gcc/c-family/c-ppoutput.c:454
0x6edd15 maybe_print_line
../../gcc/c-family/c-ppoutput.c:479
0x6ee7fe token_streamer::stream(cpp_reader*, cpp_token const*, unsigned int)
../../gcc/c-family/c-ppoutput.c:270
0x6eea03 scan_translation_unit
../../gcc/c-family/c-ppoutput.c:322
0x6eea03 preprocess_file(cpp_reader*)
../../gcc/c-family/c-ppoutput.c:102
0x6ecf90 c_common_init()
../../gcc/c-family/c-opts.c:1195
0x62f8bd lang_dependent_init
../../gcc/toplev.c:1889
0x62f8bd do_compile
../../gcc/toplev.c:2186

[Bug fortran/99326] New: [9/10/11 Regression] ICE in gfc_build_dummy_array_decl, at fortran/trans-decl.c:1299

2021-03-01 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99326

Bug ID: 99326
   Summary: [9/10/11 Regression] ICE in
gfc_build_dummy_array_decl, at
fortran/trans-decl.c:1299
   Product: gcc
   Version: 11.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 r9, changed between 20181014 and 20181021 :


$ cat z1.f90
program p
   type t0
   end type
   type t
  class(t0), allocatable :: a(:)
   end type
contains
   subroutine s(x)
  class(t0) :: x(:)
  type(t) :: z
  associate (y => x)
 z%a = y
  end associate
   end
end


$ gfortran-9-20181014 -c z1.f90
z1.f90:11:23:

11 |   associate (y => x)
   |   1
Error: Assumed shape array at (1) must be a dummy argument


$ gfortran-11-20210228 -c z1.f90
z1.f90:1:9:

1 | program p
  | 1
internal compiler error: in gfc_build_dummy_array_decl, at
fortran/trans-decl.c:1299
0x754a97 gfc_build_dummy_array_decl
../../gcc/fortran/trans-decl.c:1299
0x759043 gfc_get_symbol_decl(gfc_symbol*)
../../gcc/fortran/trans-decl.c:1697
0x75c05f generate_local_decl
../../gcc/fortran/trans-decl.c:5950
0x71af42 do_traverse_symtree
../../gcc/fortran/symbol.c:4170
0x75d004 generate_local_vars
../../gcc/fortran/trans-decl.c:6156
0x75d004 gfc_generate_function_code(gfc_namespace*)
../../gcc/fortran/trans-decl.c:6815
0x75cfe4 gfc_generate_contained_functions
../../gcc/fortran/trans-decl.c:5874
0x75cfe4 gfc_generate_function_code(gfc_namespace*)
../../gcc/fortran/trans-decl.c:6812
0x6e3a46 translate_all_program_units
../../gcc/fortran/parse.c:6351
0x6e3a46 gfc_parse_file()
../../gcc/fortran/parse.c:6620
0x72fd7f gfc_be_parse_file
../../gcc/fortran/f95-lang.c:212

[Bug c/99347] New: [9/10/11 Regression] ICE in create_block_for_bookkeeping, at sel-sched.c:4549

2021-03-02 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99347

Bug ID: 99347
   Summary: [9/10/11 Regression] ICE in
create_block_for_bookkeeping, at sel-sched.c:4549
   Product: gcc
   Version: 11.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gs...@t-online.de
  Target Milestone: ---

Using following options and testfile gcc.dg/tree-ssa/ifc-pr69489-2.c
This issue started with r9, between 20190331 and 20190414 :
(under the hood related to pr95636 ?)


$ gcc-11-20210228 -c ifc-pr69489-2.c -O1 -fvar-tracking-assignments
-fschedule-insns -fselective-scheduling
cc1: warning: var-tracking-assignments changes selective scheduling
during RTL pass: sched1
ifc-pr69489-2.c: In function 'foo':
ifc-pr69489-2.c:15:1: internal compiler error: in create_block_for_bookkeeping,
at sel-sched.c:4549
   15 | }
  | ^
0xb2c995 create_block_for_bookkeeping
../../gcc/sel-sched.c:4549
0xb2c995 find_place_for_bookkeeping
../../gcc/sel-sched.c:4686
0xb2c995 generate_bookkeeping_insn
../../gcc/sel-sched.c:4786
0xb2c995 move_op_at_first_insn
../../gcc/sel-sched.c:6063
0xb2d037 code_motion_path_driver
../../gcc/sel-sched.c:6657
0xb2d2ce code_motion_process_successors
../../gcc/sel-sched.c:6342
0xb2d2ce code_motion_path_driver
../../gcc/sel-sched.c:6608
0xb2d703 move_op
../../gcc/sel-sched.c:6702
0xb2d703 move_exprs_to_boundary
../../gcc/sel-sched.c:5223
0xb2d703 schedule_expr_on_boundary
../../gcc/sel-sched.c:5436
0xb30b94 fill_insns
../../gcc/sel-sched.c:5578
0xb32943 schedule_on_fences
../../gcc/sel-sched.c:7353
0xb32943 sel_sched_region_2
../../gcc/sel-sched.c:7491
0xb334dd sel_sched_region_1
../../gcc/sel-sched.c:7533
0xb33fab sel_sched_region(int)
../../gcc/sel-sched.c:7634
0xb349e9 run_selective_scheduling()
../../gcc/sel-sched.c:7720
0xb1642d rest_of_handle_sched
../../gcc/sched-rgn.c:3724
0xb1642d execute
../../gcc/sched-rgn.c:3834

[Bug c/99347] [9/10/11 Regression] ICE in create_block_for_bookkeeping, at sel-sched.c:4549

2021-03-02 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99347

G. Steinmetz  changed:

   What|Removed |Added

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

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

Similar with gcc.dg/autopar/pr90211.c plus some additional options.
This started with r10, between 20190811 and 20190818 :


$ gcc-11-20210228 -c pr90211.c -fprofile-generate -gstatement-frontiers \
 -O1 -fvar-tracking-assignments -fschedule-insns -fselective-scheduling
cc1: warning: var-tracking-assignments changes selective scheduling
during RTL pass: sched1
pr90211.c: In function 'foo':
pr90211.c:24:1: internal compiler error: in create_block_for_bookkeeping, at
sel-sched.c:4549
   24 | }
  | ^
0xb2c995 create_block_for_bookkeeping
../../gcc/sel-sched.c:4549
0xb2c995 find_place_for_bookkeeping
../../gcc/sel-sched.c:4686
#...

[Bug fortran/99348] New: ICE in resolve_structure_cons, at fortran/resolve.c:1286

2021-03-02 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99348

Bug ID: 99348
   Summary: ICE in resolve_structure_cons, at
fortran/resolve.c:1286
   Product: gcc
   Version: 11.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 r9, between 20181028 and 20181104 :


$ cat z1.f90
program p
   type t
  character(3) :: c
   end type
   type(t), parameter :: x(1) = t('abc')
   print *, x%c%len
end


$ gfortran-11-20210228 -c z1.f90
f951: internal compiler error: Segmentation fault
0xc0666f crash_signal
../../gcc/toplev.c:327
0x702c1c resolve_structure_cons
../../gcc/fortran/resolve.c:1286
0x6f1161 gfc_resolve_expr(gfc_expr*)
../../gcc/fortran/resolve.c:7156
0x687212 find_inquiry_ref
../../gcc/fortran/expr.c:1776
0x68a7ad simplify_ref_chain
../../gcc/fortran/expr.c:2027
0x689e3d gfc_simplify_expr(gfc_expr*, int)
../../gcc/fortran/expr.c:2266
0x68a65b simplify_parameter_variable
../../gcc/fortran/expr.c:2110
0x68a3dd gfc_simplify_expr(gfc_expr*, int)
../../gcc/fortran/expr.c:2248
0x6e753f gfc_match_varspec(gfc_expr*, int, bool, bool)
../../gcc/fortran/primary.c:2442
0x6e92d3 gfc_match_rvalue(gfc_expr**)
../../gcc/fortran/primary.c:3611
0x6bd92e match_primary
../../gcc/fortran/matchexp.c:157
0x6bd92e match_level_1
../../gcc/fortran/matchexp.c:211
0x6bd92e match_mult_operand
../../gcc/fortran/matchexp.c:267
0x6bdb78 match_add_operand
../../gcc/fortran/matchexp.c:356
0x6bddcc match_level_2
../../gcc/fortran/matchexp.c:480
0x6bdf22 match_level_3
../../gcc/fortran/matchexp.c:551
0x6be014 match_level_4
../../gcc/fortran/matchexp.c:599
0x6be014 match_and_operand
../../gcc/fortran/matchexp.c:693
0x6be202 match_or_operand
../../gcc/fortran/matchexp.c:722
0x6be2d2 match_equiv_operand
../../gcc/fortran/matchexp.c:765

[Bug fortran/99348] ICE in resolve_structure_cons, at fortran/resolve.c:1286

2021-03-02 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99348

G. Steinmetz  changed:

   What|Removed |Added

   Keywords||ice-on-valid-code

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

Compiles and works without "parameter" :


$ cat z2.f90
program p
   type t
  character(3) :: c
   end type
   type(t) :: x(1) = t('abc')
   print *, x%c%len
end


$ gfortran-11-20210228 z1.f90 && ./a.out
   3
$

[Bug fortran/99349] New: ICE in match_data_constant, at fortran/decl.c:426

2021-03-02 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99349

Bug ID: 99349
   Summary: ICE in match_data_constant, at fortran/decl.c:426
   Product: gcc
   Version: 11.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 r9, between 20181028 and 20181104 :


$ cat z1.f90
function f()
   logical, parameter :: a((1.)/0) = .true.
   integer :: b
   data b /a%kind/
end


$ gfortran-11-20210228 -c z1.f90
f951: internal compiler error: Segmentation fault
0xc0666f crash_signal
../../gcc/toplev.c:327
0x66dab4 match_data_constant
../../gcc/fortran/decl.c:426
0x66dc63 top_val_list
../../gcc/fortran/decl.c:499
0x66df72 gfc_match_data()
../../gcc/fortran/decl.c:716
0x6d87e1 match_word
../../gcc/fortran/parse.c:65
0x6dca2e decode_statement
../../gcc/fortran/parse.c:469
0x6dd79c next_free
../../gcc/fortran/parse.c:1316
0x6dd79c next_statement
../../gcc/fortran/parse.c:1548
0x6dee0b parse_spec
../../gcc/fortran/parse.c:3967
0x6e1bdc parse_progunit
../../gcc/fortran/parse.c:5896
0x6e35e7 gfc_parse_file()
../../gcc/fortran/parse.c:6451
0x72fd7f gfc_be_parse_file
../../gcc/fortran/f95-lang.c:212

[Bug fortran/99350] New: [9/10/11 Regression] ICE in gfc_get_symbol_decl, at fortran/trans-decl.c:1869

2021-03-02 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99350

Bug ID: 99350
   Summary: [9/10/11 Regression] ICE in gfc_get_symbol_decl, at
fortran/trans-decl.c:1869
   Product: gcc
   Version: 11.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gs...@t-online.de
  Target Milestone: ---

Changed between 20200510 and 20200517 :


$ cat z1.f90
program p
   type t
  character(:), pointer :: a
   end type
   type(t) :: z
   character((1.)/0), target :: c = 'abc'
   z%a => c
   associate (y => z%a)
  print *, y
   end associate
end


$ cat z2.f90
program p
   type t
  character(:), pointer :: a
   end type
   type(t) :: z
   character((0.)/0), target :: c = 'abc'
   z%a => c
   associate (y => z%a)
  print *, y
   end associate
end


$ gfortran-11-20200510 -c z1.f90
z1.f90:6:19:

6 |character((1.)/0), target :: c = 'abc'
  |   1
Error: Division by zero at (1)


$ gfortran-11-20210228 -c z1.f90
z1.f90:1:9:

1 | program p
  | 1
internal compiler error: in gfc_get_symbol_decl, at fortran/trans-decl.c:1869
0x7596ec gfc_get_symbol_decl(gfc_symbol*)
../../gcc/fortran/trans-decl.c:1869
0x75c05f generate_local_decl
../../gcc/fortran/trans-decl.c:5950
0x71af42 do_traverse_symtree
../../gcc/fortran/symbol.c:4170
0x75d004 generate_local_vars
../../gcc/fortran/trans-decl.c:6156
0x75d004 gfc_generate_function_code(gfc_namespace*)
../../gcc/fortran/trans-decl.c:6815
0x6e3a46 translate_all_program_units
../../gcc/fortran/parse.c:6351
0x6e3a46 gfc_parse_file()
../../gcc/fortran/parse.c:6620
0x72fd7f gfc_be_parse_file
../../gcc/fortran/f95-lang.c:212

[Bug fortran/99351] New: ICE in gfc_finish_var_decl, at fortran/trans-decl.c:695

2021-03-02 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99351

Bug ID: 99351
   Summary: ICE in gfc_finish_var_decl, at
fortran/trans-decl.c:695
   Product: gcc
   Version: 11.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
   character(3), parameter :: c = 'abc'
contains
   subroutine s
  sync all (errmsg=c)
   end
end


$ cat z2.f90
module m
   integer, parameter :: a = 0
contains
   subroutine s
  sync images (*, stat=a)
   end
end


$ gfortran-11-20210221 -c z1.f90 -fcoarray=single   # seems to be accepted
$
$ gfortran-11-20210221 -c z1.f90 -fcoarray=lib
z1.f90:5:25:

5 |   sync all (errmsg=c)
  | 1
internal compiler error: in gfc_finish_var_decl, at fortran/trans-decl.c:695
0x7a5d01 gfc_finish_var_decl
../../gcc/fortran/trans-decl.c:695
0x7a4640 gfc_get_symbol_decl(gfc_symbol*)
../../gcc/fortran/trans-decl.c:1872
0x7c0208 gfc_conv_variable
../../gcc/fortran/trans-expr.c:2913
0x7bacea gfc_conv_expr(gfc_se*, gfc_expr*)
../../gcc/fortran/trans-expr.c:8916
0x814088 gfc_trans_sync(gfc_code*, gfc_exec_op)
../../gcc/fortran/trans-stmt.c:1242
0x7767e7 trans_code
../../gcc/fortran/trans.c:2052
0x7a9b05 gfc_generate_function_code(gfc_namespace*)
../../gcc/fortran/trans-decl.c:6880
0x777059 gfc_generate_module_code(gfc_namespace*)
../../gcc/fortran/trans.c:2322
0x720b21 translate_all_program_units
../../gcc/fortran/parse.c:6338
0x720b21 gfc_parse_file()
../../gcc/fortran/parse.c:6620
0x76df2f gfc_be_parse_file
../../gcc/fortran/f95-lang.c:212

[Bug fortran/99368] New: ICE in build_function_decl, at fortran/trans-decl.c:2381

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

Bug ID: 99368
   Summary: ICE in build_function_decl, at
fortran/trans-decl.c:2381
   Product: gcc
   Version: 11.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gs...@t-online.de
  Target Milestone: ---

This issue depends on alphabetical order of involved names,
that is, case z1 gives an ICE ("x"<"y"), z2 gives an error.
Special case: same name. Affects versions down to at least r5.


$ diff z1.f90 z2.f90
6c6
<   namelist /x/ y
---
>   namelist /z/ y


$ cat z1.f90
program p
   type y
   end type
contains
   subroutine s
  namelist /x/ y
  character(3) y
   end
end


$ cat z2.f90
program p
   type y
   end type
contains
   subroutine s
  namelist /z/ y
  character(3) y
   end
end


$ gfortran-11-20210228 -c z2.f90
z2.f90:6:17:

6 |   namelist /z/ y
  | 1
Error: PROCEDURE attribute conflicts with NAMELIST attribute in 'y' at (1)


$ gfortran-11-20210228 -c z1.f90
z1.f90:2:9:

2 |type y
  | 1
internal compiler error: in build_function_decl, at fortran/trans-decl.c:2381
0x752129 build_function_decl
../../gcc/fortran/trans-decl.c:2378
0x759a6c gfc_get_symbol_decl(gfc_symbol*)
../../gcc/fortran/trans-decl.c:1756
0x75c9a5 generate_namelist_decl
../../gcc/fortran/trans-decl.c:5241
0x75ce8e generate_local_nml_decl
../../gcc/fortran/trans-decl.c:6147
0x71af42 do_traverse_symtree
../../gcc/fortran/symbol.c:4170
0x75d011 generate_local_vars
../../gcc/fortran/trans-decl.c:6157
0x75d011 gfc_generate_function_code(gfc_namespace*)
../../gcc/fortran/trans-decl.c:6815
0x75cfe4 gfc_generate_contained_functions
../../gcc/fortran/trans-decl.c:5874
0x75cfe4 gfc_generate_function_code(gfc_namespace*)
../../gcc/fortran/trans-decl.c:6812
0x6e3a46 translate_all_program_units
../../gcc/fortran/parse.c:6351
0x6e3a46 gfc_parse_file()
../../gcc/fortran/parse.c:6620
0x72fd7f gfc_be_parse_file
../../gcc/fortran/f95-lang.c:212

[Bug fortran/99369] New: [10/11 Regression] ICE in gfc_resolve_expr, at fortran/resolve.c:7167

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

Bug ID: 99369
   Summary: [10/11 Regression] ICE in gfc_resolve_expr, at
fortran/resolve.c:7167
   Product: gcc
   Version: 11.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gs...@t-online.de
  Target Milestone: ---

This issue appeared between 20191124 and 20191201.
The change occurs between 54 (ok) and 55 (ICE) letters :
(an operator-name may only consist of letters)


$ cat z1_54.f90
module mabcdefgxyzabcdefgxyzabcdefgxyzabcdefgxyzabcdefgxyzabc
   type tabcdefgxyzabcdefgxyzabcdefgxyzabcdefgxyzabcdefgxyzabc
   end type
   interface operator
(.oabcdefgxyzabcdefgxyzabcdefgxyzabcdefgxyzabcdefgxyzabc.)
  procedure fabcdefgxyzabcdefgxyzabcdefgxyzabcdefgxyzabcdefgxyzabc
   end interface
contains
   function fabcdefgxyzabcdefgxyzabcdefgxyzabcdefgxyzabcdefgxyzabc &
(uabcdefgxyzabcdefgxyzabcdefgxyzabcdefgxyzabcdefgxyzabc, &
 vabcdefgxyzabcdefgxyzabcdefgxyzabcdefgxyzabcdefgxyzabc)
  type (tabcdefgxyzabcdefgxyzabcdefgxyzabcdefgxyzabcdefgxyzabc), intent(in)
:: &
 uabcdefgxyzabcdefgxyzabcdefgxyzabcdefgxyzabcdefgxyzabc, &
 vabcdefgxyzabcdefgxyzabcdefgxyzabcdefgxyzabcdefgxyzabc
   end
end
program p
   use mabcdefgxyzabcdefgxyzabcdefgxyzabcdefgxyzabcdefgxyzabc
   type (tabcdefgxyzabcdefgxyzabcdefgxyzabcdefgxyzabcdefgxyzabc) :: &
  uabcdefgxyzabcdefgxyzabcdefgxyzabcdefgxyzabcdefgxyzabc, &
  vabcdefgxyzabcdefgxyzabcdefgxyzabcdefgxyzabcdefgxyzabc
   wabcdefgxyzabcdefgxyzabcdefgxyzabcdefgxyzabcdefgxyzabc = &
  uabcdefgxyzabcdefgxyzabcdefgxyzabcdefgxyzabcdefgxyzabc &
 .oabcdefgxyzabcdefgxyzabcdefgxyzabcdefgxyzabcdefgxyzabc. &
  vabcdefgxyzabcdefgxyzabcdefgxyzabcdefgxyzabcdefgxyzabc
end


$ cat z1_55.f90
module mabcdefgxyzabcdefgxyzabcdefgxyzabcdefgxyzabcdefgxyzabcd
   type tabcdefgxyzabcdefgxyzabcdefgxyzabcdefgxyzabcdefgxyzabcd
   end type
   interface operator
(.oabcdefgxyzabcdefgxyzabcdefgxyzabcdefgxyzabcdefgxyzabcd.)
  procedure fabcdefgxyzabcdefgxyzabcdefgxyzabcdefgxyzabcdefgxyzabcd
   end interface
contains
   function fabcdefgxyzabcdefgxyzabcdefgxyzabcdefgxyzabcdefgxyzabcd &
(uabcdefgxyzabcdefgxyzabcdefgxyzabcdefgxyzabcdefgxyzabcd, &
 vabcdefgxyzabcdefgxyzabcdefgxyzabcdefgxyzabcdefgxyzabcd)
  type (tabcdefgxyzabcdefgxyzabcdefgxyzabcdefgxyzabcdefgxyzabcd),
intent(in) :: &
 uabcdefgxyzabcdefgxyzabcdefgxyzabcdefgxyzabcdefgxyzabcd, &
 vabcdefgxyzabcdefgxyzabcdefgxyzabcdefgxyzabcdefgxyzabcd
   end
end
program p
   use mabcdefgxyzabcdefgxyzabcdefgxyzabcdefgxyzabcdefgxyzabcd
   type (tabcdefgxyzabcdefgxyzabcdefgxyzabcdefgxyzabcdefgxyzabcd) :: &
  uabcdefgxyzabcdefgxyzabcdefgxyzabcdefgxyzabcdefgxyzabcd, &
  vabcdefgxyzabcdefgxyzabcdefgxyzabcdefgxyzabcdefgxyzabcd
   wabcdefgxyzabcdefgxyzabcdefgxyzabcdefgxyzabcdefgxyzabcd = &
  uabcdefgxyzabcdefgxyzabcdefgxyzabcdefgxyzabcdefgxyzabcd &
 .oabcdefgxyzabcdefgxyzabcdefgxyzabcdefgxyzabcdefgxyzabcd. &
  vabcdefgxyzabcdefgxyzabcdefgxyzabcdefgxyzabcdefgxyzabcd
end


$ cat z1_63.f90
module mabcdefgxyzabcdefgxyzabcdefgxyzabcdefgxyzabcdefgxyzabcdefgxyzab
   type tabcdefgxyzabcdefgxyzabcdefgxyzabcdefgxyzabcdefgxyzabcdefgxyzab
   end type
   interface operator
(.oabcdefgxyzabcdefgxyzabcdefgxyzabcdefgxyzabcdefgxyzabcdefgxyzab.)
  procedure fabcdefgxyzabcdefgxyzabcdefgxyzabcdefgxyzabcdefgxyzabcdefgxyzab
   end interface
contains
   function fabcdefgxyzabcdefgxyzabcdefgxyzabcdefgxyzabcdefgxyzabcdefgxyzab &
(uabcdefgxyzabcdefgxyzabcdefgxyzabcdefgxyzabcdefgxyzabcdefgxyzab, &
 vabcdefgxyzabcdefgxyzabcdefgxyzabcdefgxyzabcdefgxyzabcdefgxyzab)
  type (tabcdefgxyzabcdefgxyzabcdefgxyzabcdefgxyzabcdefgxyzabcdefgxyzab),
intent(in) :: &
 uabcdefgxyzabcdefgxyzabcdefgxyzabcdefgxyzabcdefgxyzabcdefgxyzab, &
 vabcdefgxyzabcdefgxyzabcdefgxyzabcdefgxyzabcdefgxyzabcdefgxyzab
   end
end
program p
   use mabcdefgxyzabcdefgxyzabcdefgxyzabcdefgxyzabcdefgxyzabcdefgxyzab
   type (tabcdefgxyzabcdefgxyzabcdefgxyzabcdefgxyzabcdefgxyzabcdefgxyzab) :: &
  uabcdefgxyzabcdefgxyzabcdefgxyzabcdefgxyzabcdefgxyzabcdefgxyzab, &
  vabcdefgxyzabcdefgxyzabcdefgxyzabcdefgxyzabcdefgxyzabcdefgxyzab
   wabcdefgxyzabcdefgxyzabcdefgxyzabcdefgxyzabcdefgxyzabcdefgxyzab = &
  uabcdefgxyzabcdefgxyzabcdefgxyzabcdefgxyzabcdefgxyzabcdefgxyzab &
 .oabcdefgxyzabcdefgxyzabcdefgxyzabcdefgxyzabcdefgxyzabcdefgxyzab. &
  vabcdefgxyzabcdefgxyzabcdefgxyzabcdefgxyzabcdefgxyzabcdefgxyzab
end


$ gfortran-11-20210228 -c z1_54.f90
$
$ gfortran-11-20210228 -c z1_55.f90
f951: internal compiler error: Segmentation fault
0xc0666f crash_signal
../../gcc/toplev.c:327
0x6f0e23 gfc_resolve_expr(gfc_expr*)
../../gcc/fortran/resolve.c:7167
0x6f97a4 gfc_resolve_expr(gfc_expr*)
../../gcc/fortran/resolve.c:11720
0x6f97a4 gfc_resolve_c

[Bug fortran/99369] [10/11 Regression] ICE in gfc_resolve_expr, at fortran/resolve.c:7167

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

--- Comment #2 from G. Steinmetz  ---

The threshold value (ok|ICE) could maybe vary depending on the environment.
Therefore, it is best to try z1_63.f90 (the last example given).

On CE it produces a buffer overflow with trunk:
https://godbolt.org/z/3fGTdP

[Bug fortran/99817] New: [10/11 Regression] ICE in create_function_arglist, at fortran/trans-decl.c:2838 (etc.)

2021-03-29 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99817

Bug ID: 99817
   Summary: [10/11 Regression] ICE in create_function_arglist, at
fortran/trans-decl.c:2838 (etc.)
   Product: gcc
   Version: 11.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gs...@t-online.de
  Target Milestone: ---

Changed between 20210314 and 20210328 :


$ cat z1.f90
subroutine s1 (x)
   character(*) :: x(*)[*]
end


$ cat z2.f90
subroutine s2 (x)
   character(*), dimension(*), codimension[*] :: x
   integer :: i
   i = len(x)
end


$ gfortran-11-20210314 -c z1.f90 -fcoarray=lib
$ gfortran-11-20210314 -c z1.f90 -fcoarray=single
$ gfortran-11-20210328 -c z1.f90 -fcoarray=single
$
$ gfortran-11-20210328 -c z1.f90 -fcoarray=lib
z1.f90:1:13:

1 | subroutine s1 (x)
  | 1
internal compiler error: Segmentation fault
0xc09d4f crash_signal
../../gcc/toplev.c:327
0x754ed9 create_function_arglist
../../gcc/fortran/trans-decl.c:2838
0x75a153 gfc_create_function_decl(gfc_namespace*, bool)
../../gcc/fortran/trans-decl.c:3089
0x7603b6 gfc_generate_function_code(gfc_namespace*)
../../gcc/fortran/trans-decl.c:6778
0x6e5de6 translate_all_program_units
../../gcc/fortran/parse.c:6351
0x6e5de6 gfc_parse_file()
../../gcc/fortran/parse.c:6620
0x7320ef gfc_be_parse_file
../../gcc/fortran/f95-lang.c:212

[Bug fortran/99817] [10/11 Regression] ICE in create_function_arglist, at fortran/trans-decl.c:2838 (etc.)

2021-03-29 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99817

G. Steinmetz  changed:

   What|Removed |Added

   Keywords||ice-on-valid-code

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

Related variants :


$ cat z3.f90
subroutine s3 (x, y)
   character(*), dimension(:) :: x[*]
   character(*) :: y
end


$ cat z4.f90
subroutine s4 (x, y, z)
   character(*), dimension(:) :: x[2, *]
   character(*), dimension(*) :: y
   character(*) :: z
end


$ gfortran-11-20210328 -c z3.f90 -fcoarray=lib
z3.f90:1:13:

1 | subroutine s3 (x, y)
  | 1
internal compiler error: Segmentation fault
0xc09d4f crash_signal
../../gcc/toplev.c:327
0x754bd9 create_function_arglist
../../gcc/fortran/trans-decl.c:2625
#...


$ gfortran-11-20210328 -c z4.f90 -fcoarray=lib
z4.f90:1:13:

1 | subroutine s4 (x, y, z)
  | 1
internal compiler error: in create_function_arglist, at
fortran/trans-decl.c:2628
0x75539e create_function_arglist
../../gcc/fortran/trans-decl.c:2628
#...

[Bug fortran/99818] New: [10/11 Regression] ICE in gfc_get_tree_for_caf_expr, at fortran/trans-expr.c:2186

2021-03-29 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99818

Bug ID: 99818
   Summary: [10/11 Regression] ICE in gfc_get_tree_for_caf_expr,
at fortran/trans-expr.c:2186
   Product: gcc
   Version: 11.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gs...@t-online.de
  Target Milestone: ---

Changed between 20210207 and 20210214 :


$ cat z1.f90
module m
   type t
  integer :: a
   contains
  procedure :: s
   end type
contains
   subroutine s(x)
  class(t) :: x[*]
   end
end
program p
   use m
   associate (y => t(1))
  call y%s
   end associate
end


$ gfortran-11-20210207 -c z1.f90 -fcoarray=single
z1.f90:15:12:

   15 |   call y%s
  |1
Error: VARIABLE attribute of 'y' conflicts with PROCEDURE attribute at (1)

$ gfortran-11-20210207 -c z1.f90 -fcoarray=lib
z1.f90:15:12:

   15 |   call y%s
  |1
Error: VARIABLE attribute of 'y' conflicts with PROCEDURE attribute at (1)


$ gfortran-11-20210328 -c z1.f90 -fcoarray=single
$
$ gfortran-11-20210328 -c z1.f90 -fcoarray=lib
z1.f90:15:14:

   15 |   call y%s
  |  1
internal compiler error: in gfc_get_tree_for_caf_expr, at
fortran/trans-expr.c:2186
0x76304b gfc_get_tree_for_caf_expr(gfc_expr*)
../../gcc/fortran/trans-expr.c:2186
0x76fb7b gfc_conv_procedure_call(gfc_se*, gfc_symbol*, gfc_actual_arglist*,
gfc_expr*, vec*)
../../gcc/fortran/trans-expr.c:6837
0x7a8d28 gfc_trans_call(gfc_code*, bool, tree_node*, tree_node*, bool)
../../gcc/fortran/trans-stmt.c:424
0x7391a8 trans_code
../../gcc/fortran/trans.c:1990
0x7ad12f gfc_trans_block_construct(gfc_code*)
../../gcc/fortran/trans-stmt.c:2304
0x738f67 trans_code
../../gcc/fortran/trans.c:2018
0x75f5e4 gfc_generate_function_code(gfc_namespace*)
../../gcc/fortran/trans-decl.c:6884
0x6e5de6 translate_all_program_units
../../gcc/fortran/parse.c:6351
0x6e5de6 gfc_parse_file()
../../gcc/fortran/parse.c:6620
0x7320ef gfc_be_parse_file
../../gcc/fortran/f95-lang.c:212

[Bug fortran/99819] New: [9/10/11 Regression] ICE in gfc_defer_symbol_init, at fortran/trans-decl.c:841

2021-03-29 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99819

Bug ID: 99819
   Summary: [9/10/11 Regression] ICE in gfc_defer_symbol_init, at
fortran/trans-decl.c:841
   Product: gcc
   Version: 11.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 r6 :


$ cat z1.f90
program p
   type t
   end type
contains
   function f(x, y)
  class(t) :: x(:)
  class(*) :: y(size(x))
   end
   function g(z)
  class(*) :: z(:)
  type(t) :: u(size(z))
   end
end


$ gfortran-5 -c z1.f90
$
$ gfortran-11-20210328 -c z1.f90
z1.f90:9:15:

9 |function g(z)
  |   1
internal compiler error: Segmentation fault
0xc09d4f crash_signal
../../gcc/toplev.c:327
0x75328b gfc_defer_symbol_init
../../gcc/fortran/trans-decl.c:841
0x756e5f gfc_defer_symbol_init
../../gcc/fortran/trans-decl.c:1229
0x756e5f gfc_build_dummy_array_decl
../../gcc/fortran/trans-decl.c:1209
0x75b443 gfc_get_symbol_decl(gfc_symbol*)
../../gcc/fortran/trans-decl.c:1697
0x76ac18 gfc_conv_variable
../../gcc/fortran/trans-expr.c:2913
0x766dda gfc_conv_expr(gfc_se*, gfc_expr*)
../../gcc/fortran/trans-expr.c:8938
0x769c40 gfc_conv_expr_lhs(gfc_se*, gfc_expr*)
../../gcc/fortran/trans-expr.c:8968
0x73cea8 gfc_conv_ss_descriptor
../../gcc/fortran/trans-array.c:3050
0x7473ac gfc_conv_expr_descriptor(gfc_se*, gfc_expr*)
../../gcc/fortran/trans-array.c:7367
0x77a102 gfc_conv_intrinsic_size
../../gcc/fortran/trans-intrinsic.c:8063
0x79186b gfc_conv_intrinsic_function(gfc_se*, gfc_expr*)
../../gcc/fortran/trans-intrinsic.c:10702
0x766dba gfc_conv_expr(gfc_se*, gfc_expr*)
../../gcc/fortran/trans-expr.c:8930
0x769c83 gfc_conv_expr_val(gfc_se*, gfc_expr*)
../../gcc/fortran/trans-expr.c:8983
0x769dd0 gfc_conv_expr_type(gfc_se*, gfc_expr*, tree_node*)
../../gcc/fortran/trans-expr.c:8997
0x742bbf gfc_trans_dummy_array_bias(gfc_symbol*, tree_node*,
gfc_wrapped_block*)
../../gcc/fortran/trans-array.c:6770
0x75d0dc gfc_trans_deferred_vars(gfc_symbol*, gfc_wrapped_block*)
../../gcc/fortran/trans-decl.c:4905
0x75f6d2 gfc_generate_function_code(gfc_namespace*)
../../gcc/fortran/trans-decl.c:6988
0x75f3e4 gfc_generate_contained_functions
../../gcc/fortran/trans-decl.c:5878
0x75f3e4 gfc_generate_function_code(gfc_namespace*)
../../gcc/fortran/trans-decl.c:6816

[Bug fortran/99837] New: ICE in parse_associate, at fortran/parse.c:4780

2021-03-30 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99837

Bug ID: 99837
   Summary: ICE in parse_associate, at fortran/parse.c:4780
   Product: gcc
   Version: 11.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gs...@t-online.de
  Target Milestone: ---

Follow-up of pr88357, affects versions down to at least r5.
With a missing attribute allocatable or pointer :


$ 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-11-20210328 -c z1.f90 -fcoarray=single
f951: internal compiler error: in parse_associate, at fortran/parse.c:4780
0x6e3f39 parse_associate
../../gcc/fortran/parse.c:4780
0x6e3f39 parse_executable
../../gcc/fortran/parse.c:5524
0x6e401f parse_progunit
../../gcc/fortran/parse.c:5922
0x6e5671 gfc_parse_file()
../../gcc/fortran/parse.c:6437
0x7320ef gfc_be_parse_file
../../gcc/fortran/f95-lang.c:212



With that attribute :

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

$ gfortran-11-20210328 -c z0z1.f90 -fcoarray=single
z0z1.f90:1:9:

1 | program p
  | 1
Error: Pointer assignment target in initialization expression does not have the
TARGET attribute at (1)

[Bug fortran/99837] ICE in parse_associate, at fortran/parse.c:4780

2021-03-30 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99837

G. Steinmetz  changed:

   What|Removed |Added

   Keywords||ice-on-invalid-code

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

Similar cases with "select type" instead :


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


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

[Bug fortran/99838] New: ICE in gfc_format_decoder, at fortran/error.c:970

2021-03-30 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99838

Bug ID: 99838
   Summary: ICE in gfc_format_decoder, at fortran/error.c:970
   Product: gcc
   Version: 11.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gs...@t-online.de
  Target Milestone: ---

With option -Warray-temporaries, affects versions down to at least r5 :


$ cat z1.f90
program p
   type t
  integer :: a
   end type
   type(t) :: x(3)[*]
   data x%a /1, 2, 3/
end


$ gfortran-11-20210328 -c z1.f90 -fcoarray=lib
$ gfortran-11-20210328 -c z1.f90 -Warray-temporaries -fcoarray=single
$
$ gfortran-11-20210328 -c z1.f90 -Warray-temporaries -fcoarray=lib

z1.f90:1:9:

1 | program p
  | 1
in gfc_format_decoder, at fortran/error.c:970
0x686202 gfc_format_decoder
../../gcc/fortran/error.c:970
0x162f05e pp_format(pretty_printer*, text_info*)
../../gcc/pretty-print.c:1475
0x1622fe1 diagnostic_report_diagnostic(diagnostic_context*, diagnostic_info*)
../../gcc/diagnostic.c:1244
0x685fc5 gfc_report_diagnostic
../../gcc/fortran/error.c:782
0x685fc5 gfc_warning
../../gcc/fortran/error.c:815
0x686d86 gfc_warning(int, char const*, ...)
../../gcc/fortran/error.c:846
0x73c613 gfc_trans_create_temp_array(stmtblock_t*, stmtblock_t*, gfc_ss*,
tree_node*, tree_node*, bool, bool, bool, locus*)
../../gcc/fortran/trans-array.c:1355
0x746663 trans_array_constructor
../../gcc/fortran/trans-array.c:2724
0x746663 gfc_add_loop_ss_code
../../gcc/fortran/trans-array.c:3012
0x746d95 gfc_conv_loop_setup(gfc_loopinfo*, locus*)
../../gcc/fortran/trans-array.c:5317
0x776b0d gfc_trans_assignment_1
../../gcc/fortran/trans-expr.c:11179
0x753cd8 generate_coarray_sym_init
../../gcc/fortran/trans-decl.c:5736
0x71d2b2 do_traverse_symtree
../../gcc/fortran/symbol.c:4170
0x753135 generate_coarray_init
../../gcc/fortran/trans-decl.c:5786
0x75f9c4 gfc_generate_function_code(gfc_namespace*)
../../gcc/fortran/trans-decl.c:6822
0x6e5de6 translate_all_program_units
../../gcc/fortran/parse.c:6351
0x6e5de6 gfc_parse_file()
../../gcc/fortran/parse.c:6620
0x7320ef gfc_be_parse_file
../../gcc/fortran/f95-lang.c:212

[Bug fortran/99839] New: ICE in inline_matmul_assign, at fortran/frontend-passes.c:4234

2021-03-30 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99839

Bug ID: 99839
   Summary: ICE in inline_matmul_assign, at
fortran/frontend-passes.c:4234
   Product: gcc
   Version: 11.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 r7, at -O1+ :


$ cat z1.f90
program p
   real :: x(3, 3) = 1.0
   class(*), allocatable :: z(:, :)
   z = matmul(x, x)
end


$ gfortran-11-20210328 -c z1.f90 -O0
$ 
$ gfortran-11-20210328 -c z1.f90 -O2
f951: internal compiler error: in inline_matmul_assign, at
fortran/frontend-passes.c:4234
0x7bf248 inline_matmul_assign
../../gcc/fortran/frontend-passes.c:4234
0x7bfd69 gfc_code_walker(gfc_code**, int (*)(gfc_code**, int*, void*), int
(*)(gfc_expr**, int*, void*), void*)
../../gcc/fortran/frontend-passes.c:5320
0x7c1172 optimize_namespace
../../gcc/fortran/frontend-passes.c:1500
0x7c154f gfc_run_passes(gfc_namespace*)
../../gcc/fortran/frontend-passes.c:169
0x6fd1a7 gfc_resolve(gfc_namespace*)
../../gcc/fortran/resolve.c:17436
0x6e56e4 resolve_all_program_units
../../gcc/fortran/parse.c:6290
0x6e56e4 gfc_parse_file()
../../gcc/fortran/parse.c:6542
0x7320ef gfc_be_parse_file
../../gcc/fortran/f95-lang.c:212

[Bug fortran/99840] New: [9/10/11 Regression] ICE in gfc_simplify_matmul, at fortran/simplify.c:4777

2021-03-30 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99840

Bug ID: 99840
   Summary: [9/10/11 Regression] ICE in gfc_simplify_matmul, at
fortran/simplify.c:4777
   Product: gcc
   Version: 11.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 r8, compiles with r7 :


$ cat z1.f90
program p
   integer, parameter :: x(0,0) = 0
   integer :: y(0,0)
   y = matmul(x, transpose(x))
end


$ gfortran-7 -c z1.f90
$
$ gfortran-11-20210328 -c z1.f90
 f951: internal compiler error: Segmentation fault
0xc09d4f crash_signal
../../gcc/toplev.c:327
0x716f87 gfc_simplify_matmul(gfc_expr*, gfc_expr*)
../../gcc/fortran/simplify.c:4777
0x69b9d3 do_simplify
../../gcc/fortran/intrinsic.c:4664
0x6a63fa gfc_intrinsic_func_interface(gfc_expr*, int)
../../gcc/fortran/intrinsic.c:5050
0x6f5699 resolve_unknown_f
../../gcc/fortran/resolve.c:2926
0x6f5699 resolve_function
../../gcc/fortran/resolve.c:3270
0x6f5699 gfc_resolve_expr(gfc_expr*)
../../gcc/fortran/resolve.c:7105
0x6fbb24 gfc_resolve_expr(gfc_expr*)
../../gcc/fortran/resolve.c:11728
0x6fbb24 gfc_resolve_code(gfc_code*, gfc_namespace*)
../../gcc/fortran/resolve.c:11824
0x6fd0b7 resolve_codes
../../gcc/fortran/resolve.c:17395
0x6fd17e gfc_resolve(gfc_namespace*)
../../gcc/fortran/resolve.c:17430
0x6e56e4 resolve_all_program_units
../../gcc/fortran/parse.c:6290
0x6e56e4 gfc_parse_file()
../../gcc/fortran/parse.c:6542
0x7320ef gfc_be_parse_file
../../gcc/fortran/f95-lang.c:212

[Bug fortran/97455] ICE on invalid code (wrong pointer assignment) in SELECT TYPE construct

2021-03-31 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97455

G. Steinmetz  changed:

   What|Removed |Added

 CC||gs...@t-online.de

--- Comment #2 from G. Steinmetz  ---

Update, backtrace and a variation :


$ cat z1.f90
subroutine s
   select type (x => x(:))
   end select
end


$ cat z2.f90
subroutine s
   select type (x ==> x)
   end select
end


$ gfortran-11-20210328 -c z1.f90
f951: internal compiler error: Segmentation fault
0xc09d4f crash_signal
../../gcc/toplev.c:327
0x6576ba delete_root
../../gcc/fortran/bbt.c:150
0x65787e gfc_delete_bbt(void*, void*, int (*)(void*, void*))
../../gcc/fortran/bbt.c:197
0x7224d8 gfc_delete_symtree(gfc_symtree**, char const*)
../../gcc/fortran/symbol.c:2962
0x723bd6 gfc_restore_last_undo_checkpoint()
../../gcc/fortran/symbol.c:3706
0x6dab47 reject_statement
../../gcc/fortran/parse.c:2678
0x6de324 match_word
../../gcc/fortran/parse.c:70
0x6de324 decode_statement
../../gcc/fortran/parse.c:428
0x6dfb3c next_free
../../gcc/fortran/parse.c:1316
0x6dfb3c next_statement
../../gcc/fortran/parse.c:1548
0x6e1f04 parse_spec
../../gcc/fortran/parse.c:3783
0x6e3f7c parse_progunit
../../gcc/fortran/parse.c:5896
0x6e5a20 gfc_parse_file()
../../gcc/fortran/parse.c:6444
0x7320ef gfc_be_parse_file
../../gcc/fortran/f95-lang.c:212

[Bug fortran/99852] New: Missing error "Arithmetic overflow" for some cases

2021-03-31 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99852

Bug ID: 99852
   Summary: Missing error "Arithmetic overflow" for some cases
   Product: gcc
   Version: 11.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gs...@t-online.de
  Target Milestone: ---

Following examples produce an error for c and d, but not for a and b :
(similar for wik=2,4,8,16)


$ cat z1.f90
program p
   implicit none
   integer, parameter :: wik = 1
   integer(wik), parameter :: a = huge(1_wik) + 1_wik
   integer(wik) :: b = huge(1_wik) + 1_wik
   integer(wik) :: c
   c = huge(1_wik) + 1_wik
   associate (d => huge(1_wik) + 1_wik)
  print *, a, b, c, d
   end associate
end


$ cat z2.f90
program p
   implicit none
   integer, parameter :: wik = 1
   integer(wik), parameter :: a = -huge(1_wik) - 2_wik
   integer(wik) :: b = -huge(1_wik) - 2_wik
   integer(wik) :: c
   c = -huge(1_wik) - 2_wik
   associate (d => -huge(1_wik) - 2_wik)
  print *, a, b, c, d
   end associate
end


$ gfortran-11-20210328 -c z1.f90
z1.f90:7:7:

7 |c = huge(1_wik) + 1_wik
  |   1
Error: Arithmetic overflow at (1)
z1.f90:8:19:

8 |associate (d => huge(1_wik) + 1_wik)
  |   1
Error: Arithmetic overflow at (1)

[Bug fortran/99852] Missing error "Arithmetic overflow" for some cases

2021-03-31 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99852

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

In addition a side mark, the following gives for all a-d :


$ cat z3.f90
program p
   implicit none
   integer, parameter :: wik = 1
   integer(wik), parameter :: a = -huge(1_wik) - 1_wik
   integer(wik) :: b = -huge(1_wik) - 1_wik
   integer(wik) :: c
   c = -huge(1_wik) - 1_wik
   associate (d => -huge(1_wik) - 1_wik)
  print *, a, b, c, d
   end associate
end


$ gfortran-11-20210328 -c z3.f90 -pedantic
z3.f90:4:33:

4 |integer(wik), parameter :: a = -huge(1_wik) - 1_wik
  | 1
Warning: Integer outside symmetric range implied by Standard Fortran at (1)
z3.f90:5:22:

5 |integer(wik) :: b = -huge(1_wik) - 1_wik
  |  1
Warning: Integer outside symmetric range implied by Standard Fortran at (1)
z3.f90:7:7:

7 |c = -huge(1_wik) - 1_wik
  |   1
Warning: Integer outside symmetric range implied by Standard Fortran at (1)
z3.f90:8:19:

8 |associate (d => -huge(1_wik) - 1_wik)
  |   1
Warning: Integer outside symmetric range implied by Standard Fortran at (1)

[Bug fortran/99853] New: ICE: Cannot convert 'LOGICAL(4)' to 'INTEGER(8)' (etc.)

2021-03-31 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99853

Bug ID: 99853
   Summary: ICE: Cannot convert 'LOGICAL(4)' to 'INTEGER(8)'
(etc.)
   Product: gcc
   Version: 11.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gs...@t-online.de
  Target Milestone: ---

With option -std=f95, -std=f2003, -std=f2008 or -std=f2018 :
(affects versions down to at least r5)


$ cat z1.f90
program p
   select case (.true.)
   case (1_8)
   end select
end


$ gfortran-11-20210328 -c z1.f90
z1.f90:2:16:

2 |select case (.true.)
  |1
Warning: Extension: Conversion from LOGICAL(4) to INTEGER(8) at (1)


$ gfortran-11-20210328 -c z1.f90 -std=f2008
z1.f90:2:16:

2 |select case (.true.)
  |1
internal compiler error: Cannot convert 'LOGICAL(4)' to 'INTEGER(8)' at (1)
0x6c38d9 gfc_report_diagnostic
../../gcc/fortran/error.c:782
0x6c4ffa gfc_internal_error(char const*, ...)
../../gcc/fortran/error.c:1402
0x6e4808 gfc_convert_type_warn(gfc_expr*, gfc_typespec*, int, int, bool)
../../gcc/fortran/intrinsic.c:5397
0x72f277 resolve_select
../../gcc/fortran/resolve.c:8714
0x738b97 gfc_resolve_code(gfc_code*, gfc_namespace*)
../../gcc/fortran/resolve.c:12055
0x73a9f7 resolve_codes
../../gcc/fortran/resolve.c:17395
0x73aabe gfc_resolve(gfc_namespace*)
../../gcc/fortran/resolve.c:17430
0x723024 resolve_all_program_units
../../gcc/fortran/parse.c:6290
0x723024 gfc_parse_file()
../../gcc/fortran/parse.c:6542
0x7705ff gfc_be_parse_file
../../gcc/fortran/f95-lang.c:212

[Bug fortran/99853] ICE: Cannot convert 'LOGICAL(4)' to 'INTEGER(8)' (etc.)

2021-03-31 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99853

G. Steinmetz  changed:

   What|Removed |Added

   Keywords||ice-on-invalid-code

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

More test cases :


$ cat z2.f90
program p
   select case (.true.)
   case (1_16)
   end select
end


$ cat z3.f90
program p
   select case (.true._1)
   case (1_2)
   end select
end


$ cat z4.f90
program p
   select case (.true._8)
   case (1_16)
   end select
end


$ cat z5.f90
program p
   select case (1_2)
   case (.true.)
   end select
end


$ cat z6.f90
program p
   select case (1_4)
   case (.true._8)
   end select
end


---


While cases like the following give :


$ cat z0.f90
program p
   select case (.true.)
   case (1)
   end select
end


$ cat z0b.f90
program p
   select case (.true.)
   case (1_1)
   end select
end


$ cat z0c.f90
program p
   select case (.true._16)
   case (1_8)
   end select
end


$ gfortran-11-20210328 -c z0.f90 -std=f2008
z0.f90:3:9:

3 |case (1)
  | 1
Error: Expression in CASE statement at (1) must be of type LOGICAL

[Bug fortran/99818] [10/11 Regression] ICE in gfc_get_tree_for_caf_expr, at fortran/trans-expr.c:2186

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

--- Comment #4 from G. Steinmetz  ---

> Have you ever tried to put a tent up in a storm?
... geez, how difficult and lengthy ...

The number of bug reports is admittedly increasing,
but the number of still unknown bugs is decreasing, isn't it?

And my impression is indeed that the number of
unfixed/unknown bugs in gfortran is now roughly limited
to huge(1_alpha), with alpha=~1.5 ;-)

The bug reproduction rate is likely less than one :-)

[Bug fortran/70244] [OOP] ICE in spec_dimen_size(): Bad dimension

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

G. Steinmetz  changed:

   What|Removed |Added

 CC||gs...@t-online.de

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

Some presumably related examples, where z1.f90 gives an ICE,
while minimal less complex examples z2.f90 and z3.f90 compile :


$ cat z1.f90
program p
   type t
  procedure(g), pointer, nopass :: f
   end type
   type(t) :: a(1)
   a(1)%f => g
contains
   function g() result(z)
  real :: z(2,2)
   end
end


$ cat z2.f90
program p
   type t
  procedure(g), pointer, nopass :: f
   end type
   type(t) :: a
   a%f => g
contains
   function g() result(z)
  real :: z(2,2)
   end
end


$ cat z3.f90
program p
   type t
  procedure(g), pointer, nopass :: f
   end type
   type(t) :: a(1)
   a(1)%f => g
contains
   function g() result(z)
  real :: z(2)
   end
end


$ gfortran-11-20210418 -c z1.f90
f951: internal compiler error: spec_dimen_size(): Bad dimension
0x686b09 gfc_report_diagnostic
../../gcc/fortran/error.c:782
0x68822a gfc_internal_error(char const*, ...)
../../gcc/fortran/error.c:1402
0x65705e spec_dimen_size(gfc_array_spec*, int, __mpz_struct (*) [1])
../../gcc/fortran/array.c:2300
0x6f299f expression_shape
../../gcc/fortran/resolve.c:5439
0x6f299f gfc_expression_rank(gfc_expr*)
../../gcc/fortran/resolve.c:5513
0x6f4a6e resolve_variable
../../gcc/fortran/resolve.c:5943
0x6f4a6e gfc_resolve_expr(gfc_expr*)
../../gcc/fortran/resolve.c:7107
0x6fc384 gfc_resolve_expr(gfc_expr*)
../../gcc/fortran/resolve.c:7072
0x6fc384 gfc_resolve_code(gfc_code*, gfc_namespace*)
../../gcc/fortran/resolve.c:11820
0x6fd997 resolve_codes
../../gcc/fortran/resolve.c:17396
0x6fda5e gfc_resolve(gfc_namespace*)
../../gcc/fortran/resolve.c:17431
0x6e5fb4 resolve_all_program_units
../../gcc/fortran/parse.c:6290
0x6e5fb4 gfc_parse_file()
../../gcc/fortran/parse.c:6542
0x7329cf gfc_be_parse_file
../../gcc/fortran/f95-lang.c:212

[Bug fortran/100154] New: [9/10/11 Regression] ICE in gfc_conv_procedure_call, at fortran/trans-expr.c:6131

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

Bug ID: 100154
   Summary: [9/10/11 Regression] ICE in gfc_conv_procedure_call,
at fortran/trans-expr.c:6131
   Product: gcc
   Version: 11.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gs...@t-online.de
  Target Milestone: ---

Changed between 20180916 and 20180923 :


$ cat z1.f90
program p
   n = fget('c')
end


$ gfortran-9-20180916 -c z1.f90
$
$ gfortran-11-20210418 -c z1.f90
z1.f90:2:16:

2 |n = fget('c')
  |1
internal compiler error: Segmentation fault
0xc0b22f crash_signal
../../gcc/toplev.c:327
0x771d0f gfc_conv_procedure_call(gfc_se*, gfc_symbol*, gfc_actual_arglist*,
gfc_expr*, vec*)
../../gcc/fortran/trans-expr.c:6131
0x78e23e gfc_conv_intrinsic_funcall
../../gcc/fortran/trans-intrinsic.c:4443
0x791467 gfc_conv_intrinsic_function(gfc_se*, gfc_expr*)
../../gcc/fortran/trans-intrinsic.c:10170
0x76766a gfc_conv_expr(gfc_se*, gfc_expr*)
../../gcc/fortran/trans-expr.c:8967
0x7774a1 gfc_trans_assignment_1
../../gcc/fortran/trans-expr.c:11259
0x739707 trans_code
../../gcc/fortran/trans.c:1932
0x75fd34 gfc_generate_function_code(gfc_namespace*)
../../gcc/fortran/trans-decl.c:6884
0x6e66b6 translate_all_program_units
../../gcc/fortran/parse.c:6351
0x6e66b6 gfc_parse_file()
../../gcc/fortran/parse.c:6620
0x7329cf gfc_be_parse_file
../../gcc/fortran/f95-lang.c:212

[Bug fortran/100155] New: [9/10/11 Regression] ICE in gfc_conv_intrinsic_size, at fortran/trans-intrinsic.c:805

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

Bug ID: 100155
   Summary: [9/10/11 Regression] ICE in gfc_conv_intrinsic_size,
at fortran/trans-intrinsic.c:805
   Product: gcc
   Version: 11.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gs...@t-online.de
  Target Milestone: ---

Changed between 20181014 and 20181021 :
(r8 changed between 20190503 and 20190614)


$ cat z1.f90
program p
   type t
   end type
contains
   recursive function f(x) result(z)
  class(*):: x(:)
  type(t) :: z(size(x))
  class(t), allocatable :: a(:)
  class(t), allocatable :: b(:)
  b = f((a))
   end
end


$ cat z2.f90
program p
   type t
   end type
contains
   recursive function f(x) result(z)
  class(*):: x(:)
  type(t) :: z(size(x))
  class(t), pointer :: a(:)
  class(t), allocatable :: b(:)
  b = f((a))
   end
end


$ gfortran-9-20181014 -c z1.f90
$
$ gfortran-11-20210418 -c z1.f90
z1.f90:10:16:

   10 |   b = f((a))
  |1
internal compiler error: Segmentation fault
0xc0b22f crash_signal
../../gcc/toplev.c:327
0x77abf7 gfc_conv_intrinsic_size
../../gcc/fortran/trans-intrinsic.c:8055
0x79211b gfc_conv_intrinsic_function(gfc_se*, gfc_expr*)
../../gcc/fortran/trans-intrinsic.c:10702
0x76766a gfc_conv_expr(gfc_se*, gfc_expr*)
../../gcc/fortran/trans-expr.c:8967
0x769b0a gfc_apply_interface_mapping(gfc_interface_mapping*, gfc_se*,
gfc_expr*)
../../gcc/fortran/trans-expr.c:4830
0x73c647 gfc_set_loop_bounds_from_array_spec(gfc_interface_mapping*, gfc_se*,
gfc_array_spec*)
../../gcc/fortran/trans-array.c:940
0x773e5e gfc_conv_procedure_call(gfc_se*, gfc_symbol*, gfc_actual_arglist*,
gfc_expr*, vec*)
../../gcc/fortran/trans-expr.c:7041
0x77547c gfc_trans_arrayfunc_assign
../../gcc/fortran/trans-expr.c:10441
0x778fd4 gfc_trans_assignment(gfc_expr*, gfc_expr*, bool, bool, bool, bool)
../../gcc/fortran/trans-expr.c:11610
0x739707 trans_code
../../gcc/fortran/trans.c:1932
0x75fd34 gfc_generate_function_code(gfc_namespace*)
../../gcc/fortran/trans-decl.c:6884
0x75fb34 gfc_generate_contained_functions
../../gcc/fortran/trans-decl.c:5878
0x75fb34 gfc_generate_function_code(gfc_namespace*)
../../gcc/fortran/trans-decl.c:6816
0x6e66b6 translate_all_program_units
../../gcc/fortran/parse.c:6351
0x6e66b6 gfc_parse_file()
../../gcc/fortran/parse.c:6620
0x7329cf gfc_be_parse_file
../../gcc/fortran/f95-lang.c:212

[Bug fortran/100155] [9/10/11 Regression] ICE in gfc_conv_intrinsic_size, at fortran/trans-intrinsic.c:805

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

G. Steinmetz  changed:

   What|Removed |Added

   Keywords||ice-on-valid-code

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

Compiles without these extra parentheses in f((a)) :


$ cat z0.f90
program p
   type t
   end type
contains
   recursive function f(x) result(z)
  class(*):: x(:)
  type(t) :: z(size(x))
  class(t), allocatable :: a(:)
  class(t), allocatable :: b(:)
  b = f(a)
   end
end

[Bug fortran/100156] New: ICE in gfc_trans_array_cobounds, at fortran/trans-array.c:6257

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

Bug ID: 100156
   Summary: ICE in gfc_trans_array_cobounds, at
fortran/trans-array.c:6257
   Product: gcc
   Version: 11.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gs...@t-online.de
  Target Milestone: ---

With option -fcoarray=single, affects versions down to at least r5 :
(compiles with -fcoarray=lib)
(compiles always without attribute volatile)


$ cat z1.f90
program p
   integer, volatile :: a = 1
   integer, volatile :: b[*] = 1
   if (a /= b) stop
end


$ gfortran-11-20210418 -c z1.f90 -fcoarray=lib
$
$ gfortran-11-20210418 -c z1.f90 -fcoarray=single
z1.f90:5:3:

5 | end
  |   1
internal compiler error: Segmentation fault
0xc0b22f crash_signal
../../gcc/toplev.c:327
0x7425b1 gfc_trans_array_cobounds(tree_node*, stmtblock_t*, gfc_symbol const*)
../../gcc/fortran/trans-array.c:6257
0x75e271 gfc_trans_deferred_vars(gfc_symbol*, gfc_wrapped_block*)
../../gcc/fortran/trans-decl.c:4858
0x75fe22 gfc_generate_function_code(gfc_namespace*)
../../gcc/fortran/trans-decl.c:6988
0x6e66b6 translate_all_program_units
../../gcc/fortran/parse.c:6351
0x6e66b6 gfc_parse_file()
../../gcc/fortran/parse.c:6620
0x7329cf gfc_be_parse_file
../../gcc/fortran/f95-lang.c:212

[Bug fortran/100158] New: Some issues with fortran testsuite files

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

Bug ID: 100158
   Summary: Some issues with fortran testsuite files
   Product: gcc
   Version: 11.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gs...@t-online.de
  Target Milestone: ---

In the following some issues with fortran test files itself :

---

Two test files substr* are placed at top level,
should be better moved to catalog gfortran.dg

$ ls ./gcc-11-20210418/gcc/testsuite
   200704 19. Apr 00:32 gfortran.dg
   57 19. Apr 00:32 gfortran.fortran-torture
  438 19. Apr 00:32 substr_10.f90
  766 19. Apr 00:32 substr_9.f90

---

pr100018 contributed a file PR10018.f90 in gfortran.dg,
with a missing digit, should be renamed to PR100018.f90

---

These two testsuite files are identical,
one seems to be superfluous :

$ diff gfortran.dg/pr99602c.f90 gfortran.dg/pr99602d.f90
$

---

Some testsuite files disappeared without an entry in ChangeLog*.
What happend with dtio_5.f90 and pdt_5.f03 ?

They existed here :
./gcc-10-20200110/gcc/testsuite/gfortran.dg/pdt_5.f03
./gcc-10-20200110/gcc/testsuite/gfortran.dg/dtio_5.f90

---

Other testsuite files existed here and are later gone somehow
without an entry in ChangeLog* :

./gcc-8-20201210/gcc/testsuite/gfortran.dg/external_procedures_4.f90

./gcc-7-20191107/gcc/testsuite/gfortran.dg/pr78686.f90

./gcc-7-20191107/gcc/testsuite/gfortran.dg/pr91686.f90

./gcc-5-20171003/gcc/testsuite/gfortran.dg/pr58754.f90

---

[Bug testsuite/100159] New: Typos in testsuite files

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

Bug ID: 100159
   Summary: Typos in testsuite files
   Product: gcc
   Version: 11.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: testsuite
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gs...@t-online.de
  Target Milestone: ---

Found the following :


A missing letter : s/cpluspls/cplusplus/

./gcc/testsuite/g++.dg/template/nontype29.C:6:#if __cpluspls >= 201103L
./gcc/testsuite/g++.dg/template/nontype29.C:63:#if __cpluspls >= 201103L


An extra letter, likely s/expreession/expression/

./gcc/testsuite/gcc.dg/Wstring-compare.c:24:// {
dg-bogus "in this expreession" "unwanted note" { target *-*-* } .-1 }
./gcc/testsuite/gcc.dg/Wstring-compare.c:47:// {
dg-bogus "in this expreession" "unwanted note" { target *-*-* } .-1 }
./gcc/testsuite/gcc.dg/Wstring-compare.c:89:// {
dg-bogus "in this expreession" "unwanted note" { target *-*-* } .-1 }
./gcc/testsuite/gcc.dg/Wstring-compare.c:134: 
// { dg-bogus "in this expreession" "unwanted note" { target *-*-* } .-1 }
./gcc/testsuite/gcc.dg/Wstring-compare.c:164:// {
dg-bogus "in this expreession" "unwanted note" { target *-*-* } .-1 }

[Bug testsuite/100192] New: Typos in testsuite files, dg-options etc.

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

Bug ID: 100192
   Summary: Typos in testsuite files, dg-options etc.
   Product: gcc
   Version: 12.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: testsuite
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gs...@t-online.de
  Target Milestone: ---

More findings :


Wrong letter "a" (third) : s/paramater/parameter/

./gcc/testsuite/gcc.dg/Warray-bounds-64.c:10:   { dg-options "-O2 -Wall
-Warray-parameter -Wno-vla-paramater" } */
./gcc/testsuite/gcc.dg/Warray-parameter.c:8:   { dg-options "-Wall
-Warray-parameter -Wno-vla-paramater" } */

./gcc/builtins.c:9989:   back to a BUILT_IN_STRCMP. Remember to delete the
3rd paramater
./gcc/d/dmd/expressionsem.c:4932:// lazy paramaters can be
called without violating purity and safety
./gcc/dwarf2out.c:23541:  /* Generate child dies for template paramaters.  */
./gcc/dwarf2out.c:25470:  /* Generate child dies for template paramaters.  */



Missing letter "u" : s/unqoted/unquoted/

./gcc/testsuite/gcc.dg/format/gcc_diag-11.c:378:  cdiag ("unqoted x_y ident"); 
/* { dg-warning "unquoted identifier or keyword 'x_y'" } */



Trivial : s/intrnisic/intrinsic/

 ./gcc/testsuite/gfortran.dg/matmul_bounds_9.f90:3:! { dg-shouldfail "Fortran
runtime error: Incorrect extent in argument B in MATMUL intrnisic for dimension
2: is 1, should be 2" }



No comment before dg-error (should start here with "!") :

./gcc/testsuite/gfortran.dg/array_constructor_3.f90:4:print *, (//)  {
dg-error "Empty array constructor" }
---
./gcc/testsuite/gfortran.dg/array_constructor_3.f90:4:print *, (//) ! {
dg-error "Empty array constructor" }

[Bug fortran/100193] New: [9/10/11/12 Regression] ICE in alloc_scalar_allocatable_for_assignment, at fortran/trans-expr.c:10837

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

Bug ID: 100193
   Summary: [9/10/11/12 Regression] ICE in
alloc_scalar_allocatable_for_assignment, at
fortran/trans-expr.c:10837
   Product: gcc
   Version: 12.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 (z%g= is invalid, r5 compiles it) :


$ cat z1.f90
module m
   implicit none
   type t
  procedure(f), pointer, nopass :: g
   end type
contains
   function f()
  character(:), allocatable :: f
  f = 'abc'
   end
   subroutine s
  type(t) :: z
  z%g = 'x'
  if ( z%g() /= 'abc' ) stop
   end
end
program p
   use m
   implicit none
   call s
end


$ gfortran-5 -c z1.f90
$
$ gfortran-11-20210418 -c z1.f90
z1.f90:13:15:

   13 |   z%g = 'x'
  |   1
internal compiler error: Segmentation fault
0xc0b22f crash_signal
../../gcc/toplev.c:327
0x778bf2 alloc_scalar_allocatable_for_assignment
../../gcc/fortran/trans-expr.c:10837
0x778bf2 gfc_trans_assignment_1
../../gcc/fortran/trans-expr.c:11497
0x739707 trans_code
../../gcc/fortran/trans.c:1932
0x75fd34 gfc_generate_function_code(gfc_namespace*)
../../gcc/fortran/trans-decl.c:6884
0x739f79 gfc_generate_module_code(gfc_namespace*)
../../gcc/fortran/trans.c:2332
0x6e61b1 translate_all_program_units
../../gcc/fortran/parse.c:6338
0x6e61b1 gfc_parse_file()
../../gcc/fortran/parse.c:6620
0x7329cf gfc_be_parse_file
../../gcc/fortran/f95-lang.c:212

[Bug fortran/100194] New: [9/10/11/12 Regression] ICE in gfc_trans_create_temp_array, at fortran/trans-array.c:1351

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

Bug ID: 100194
   Summary: [9/10/11/12 Regression] ICE in
gfc_trans_create_temp_array, at
fortran/trans-array.c:1351
   Product: gcc
   Version: 12.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gs...@t-online.de
  Target Milestone: ---

Changed between 20190113 and 20190120 :


$ cat z1.f90
subroutine s(x)
   real :: x(..)
   call t(x)
contains
   subroutine t(y)
  real, contiguous :: y(..)
   end
end


$ gfortran-9-20190113 -c z1.f90
$
$ gfortran-11-20210418 -c z1.f90
z1.f90:3:12:

3 |call t(x)
  |1
internal compiler error: in gfc_trans_create_temp_array, at
fortran/trans-array.c:1351
0x73d26a gfc_trans_create_temp_array(stmtblock_t*, stmtblock_t*, gfc_ss*,
tree_node*, tree_node*, bool, bool, bool, locus*)
../../gcc/fortran/trans-array.c:1351
0x7475d2 gfc_conv_loop_setup(gfc_loopinfo*, locus*)
../../gcc/fortran/trans-array.c:5309
0x76bcee gfc_conv_subref_array_arg(gfc_se*, gfc_expr*, int, sym_intent, bool,
gfc_symbol const*, char const*, gfc_symbol*, bool)
../../gcc/fortran/trans-expr.c:4929
0x773875 gfc_conv_procedure_call(gfc_se*, gfc_symbol*, gfc_actual_arglist*,
gfc_expr*, vec*)
../../gcc/fortran/trans-expr.c:6450
0x7a95e8 gfc_trans_call(gfc_code*, bool, tree_node*, tree_node*, bool)
../../gcc/fortran/trans-stmt.c:424
0x739ad8 trans_code
../../gcc/fortran/trans.c:2000
0x75fd34 gfc_generate_function_code(gfc_namespace*)
../../gcc/fortran/trans-decl.c:6884
0x6e66b6 translate_all_program_units
../../gcc/fortran/parse.c:6351
0x6e66b6 gfc_parse_file()
../../gcc/fortran/parse.c:6620
0x7329cf gfc_be_parse_file
../../gcc/fortran/f95-lang.c:212

[Bug fortran/100194] [9/10/11/12 Regression] ICE in gfc_trans_create_temp_array, at fortran/trans-array.c:1351

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

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

Compiles these variants :


$ cat z2.f90
subroutine s(x)
   real, contiguous :: x(..)
   call t(x)
contains
   subroutine t(y)
  real :: y(..)
   end
end


$ cat z3.f90
subroutine s(x)
   real, contiguous :: x(..)
   call t(x)
contains
   subroutine t(y)
  real, contiguous :: y(..)
   end
end

[Bug fortran/100195] New: ICE in gimplify_expr, at gimplify.c:15095

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

Bug ID: 100195
   Summary: ICE in gimplify_expr, at gimplify.c:15095
   Product: gcc
   Version: 12.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 20191215 and 20200105) :


$ cat z1.f90
program p
   type t
   end type
   class(t), allocatable :: a(:)
   !$acc update host(a)
end


$ gfortran-10-20191215 -c z1.f90 -fopenacc
z1.f90:5:21:

5 |!$acc update host(a)
  | 1
Error: ALLOCATABLE object 'a' of polymorphic type in MAP clause at (1)


$ gfortran-11-20210418 -c z1.f90 -fopenacc
z1.f90:5:23:

5 |!$acc update host(a)
  |   ^
internal compiler error: in gimplify_expr, at gimplify.c:15095
0x9aa933 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc/gimplify.c:15095
0x9aa593 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc/gimplify.c:14204
0x9a2651 gimplify_scan_omp_clauses
../../gcc/gimplify.c:9430
0x9a7bf3 gimplify_omp_target_update
../../gcc/gimplify.c:13413
0x9a7bf3 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc/gimplify.c:14623
0x9aa978 gimplify_stmt(tree_node**, gimple**)
../../gcc/gimplify.c:6877
0x9a8d33 gimplify_statement_list
../../gcc/gimplify.c:1879
0x9a8d33 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc/gimplify.c:14528
0x9aa978 gimplify_stmt(tree_node**, gimple**)
../../gcc/gimplify.c:6877
0x9aaed1 gimplify_bind_expr
../../gcc/gimplify.c:1421
0x9a85f2 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
../../gcc/gimplify.c:14284
0x9aa978 gimplify_stmt(tree_node**, gimple**)
../../gcc/gimplify.c:6877
0x9ab99d gimplify_body(tree_node*, bool)
../../gcc/gimplify.c:15320
0x9abdff gimplify_function_tree(tree_node*)
../../gcc/gimplify.c:15474
0x8480f7 cgraph_node::analyze()
../../gcc/cgraphunit.c:670
0x84aa47 analyze_functions
../../gcc/cgraphunit.c:1236
0x84b40d symbol_table::finalize_compilation_unit()
../../gcc/cgraphunit.c:2510

[Bug fortran/100196] New: [9/10/11/12 Regression] ICE in reduce_binary_ca, at fortran/arith.c:1364

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

Bug ID: 100196
   Summary: [9/10/11/12 Regression] ICE in reduce_binary_ca, at
fortran/arith.c:1364
   Product: gcc
   Version: 12.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 r8 (before 20180525) :


$ cat z1.f90
program p
   real, parameter :: a(0) = 0
   real :: b = 1 + [a]
end


$ cat z5.f90
program p
   real, parameter :: a(0) = 0
   real, parameter :: b(1) = 1 + [a]
end


$ gfortran-7 -c z5.f90
$
$ gfortran-7 -c z1.f90
z1.f90:3:12:

real :: b = 1 + [a]
1
Error: Incompatible ranks 0 and 1 in assignment at (1)


$ gfortran-11-20210418 -c z1.f90
f951: internal compiler error: Segmentation fault
0xc0b22f crash_signal
../../gcc/toplev.c:327
0x65083f reduce_binary_ca
../../gcc/fortran/arith.c:1364
0x6508d2 reduce_binary_ca
../../gcc/fortran/arith.c:1351
0x650b45 reduce_binary
../../gcc/fortran/arith.c:1434
0x650ddb eval_intrinsic
../../gcc/fortran/arith.c:1612
0x68cfba simplify_intrinsic_op
../../gcc/fortran/expr.c:1184
0x68cfba gfc_simplify_expr(gfc_expr*, int)
../../gcc/fortran/expr.c:2237
0x6f7589 resolve_operator
../../gcc/fortran/resolve.c:4431
0x6f3a6f gfc_resolve_expr(gfc_expr*)
../../gcc/fortran/resolve.c:7098
0x68c184 gfc_reduce_init_expr(gfc_expr*)
../../gcc/fortran/expr.c:3094
0x68f460 gfc_match_init_expr(gfc_expr**)
../../gcc/fortran/expr.c:3142
0x67aa44 variable_decl
../../gcc/fortran/decl.c:2892
0x67aa44 gfc_match_data_decl()
../../gcc/fortran/decl.c:6201
0x6de9c3 match_word
../../gcc/fortran/parse.c:65
0x6de9c3 decode_statement
../../gcc/fortran/parse.c:376
0x6e040c next_free
../../gcc/fortran/parse.c:1316
0x6e040c next_statement
../../gcc/fortran/parse.c:1548
0x6e1a7b parse_spec
../../gcc/fortran/parse.c:3967
0x6e484c parse_progunit
../../gcc/fortran/parse.c:5896
0x6e5f41 gfc_parse_file()
../../gcc/fortran/parse.c:6437

[Bug c/97860] New: [11 Regression] ICE in handle_argspec_attribute, at c-family/c-attribs.c:3244

2020-11-16 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97860

Bug ID: 97860
   Summary: [11 Regression] ICE in handle_argspec_attribute, at
c-family/c-attribs.c:3244
   Product: gcc
   Version: 11.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gs...@t-online.de
  Target Milestone: ---

Changed somewhere between 20200823 and 20201004 :


$ cat z1.c
void f (int n)
{
  typedef int T[0];
  typedef T a[n];
  void *g (a);
}


$ gcc-10-20201114 -c z1.c
$
$ gcc-11-20201115 -c z1.c
z1.c: In function 'f':
z1.c:5:3: internal compiler error: in handle_argspec_attribute, at
c-family/c-attribs.c:3244
5 |   void *g (a);
  |   ^~~~
0x6f34c9 handle_argspec_attribute
../../gcc/c-family/c-attribs.c:3244
0x6299f1 decl_attributes(tree_node**, tree_node*, int, tree_node*)
../../gcc/attribs.c:724
0x642595 push_parm_decl(c_parm const*, tree_node**)
../../gcc/c/c-decl.c:5871
0x67788c c_parser_parms_list_declarator
../../gcc/c/c-parser.c:4300
0x677be8 c_parser_parms_declarator
../../gcc/c/c-parser.c:4226
0x671163 c_parser_direct_declarator_inner
../../gcc/c/c-parser.c:4139
0x671583 c_parser_declarator(c_parser*, bool, c_dtr_syn, bool*)
../../gcc/c/c-parser.c:3889
0x6882b7 c_parser_declaration_or_fndef
../../gcc/c/c-parser.c:2148
0x6879e9 c_parser_compound_statement_nostart
../../gcc/c/c-parser.c:5709
0x687e23 c_parser_compound_statement
../../gcc/c/c-parser.c:5606
0x6896b1 c_parser_declaration_or_fndef
../../gcc/c/c-parser.c:2543
0x690297 c_parser_external_declaration
../../gcc/c/c-parser.c:1777
0x690db9 c_parser_translation_unit
../../gcc/c/c-parser.c:1650
0x690db9 c_parse_file()
../../gcc/c/c-parser.c:21882
0x6dfb82 c_common_parse_file()
../../gcc/c-family/c-opts.c:1196

[Bug c/97861] New: [11 Regression] ICE in warn_parm_array_mismatch, at c-family/c-warn.c:3378

2020-11-16 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97861

Bug ID: 97861
   Summary: [11 Regression] ICE in warn_parm_array_mismatch, at
c-family/c-warn.c:3378
   Product: gcc
   Version: 11.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 20200823 and 20201004 :


$ cat z1.c
__attribute__((access(read_only, 2))) void f (int, int*);
void f (int a) { }


$ gcc-11-20201115 -c z1.c
z1.c:2:1: internal compiler error: Segmentation fault
2 | void f (int a) { }
  | ^~~~
0xb3b52f crash_signal
../../gcc/toplev.c:330
0x6fef74 warn_parm_array_mismatch(unsigned int, tree_node*, tree_node*)
../../gcc/c-family/c-warn.c:3378
0x641a94 start_function(c_declspecs*, c_declarator*, tree_node*)
../../gcc/c/c-decl.c:9589
0x688a86 c_parser_declaration_or_fndef
../../gcc/c/c-parser.c:2444
0x690297 c_parser_external_declaration
../../gcc/c/c-parser.c:1777
0x690db9 c_parser_translation_unit
../../gcc/c/c-parser.c:1650
0x690db9 c_parse_file()
../../gcc/c/c-parser.c:21882
0x6dfb82 c_common_parse_file()
../../gcc/c-family/c-opts.c:1196

[Bug c/97862] New: [11 Regression] ICE in expand_omp_for_init_vars, at omp-expand.c:2524

2020-11-16 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97862

Bug ID: 97862
   Summary: [11 Regression] ICE in expand_omp_for_init_vars, at
omp-expand.c:2524
   Product: gcc
   Version: 11.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 20200705 and 20200712 :


$ cat z1.c
void f ()
{
  int i, j;
#pragma omp for collapse(2)
  for (i = 0; i < 1; ++i)
for (j = 0; j < i; ++j);
}


$ gcc-11-20200705 -c z1.c -fopenmp
$
$ gcc-11-20201115 -c z1.c -fopenmp
during GIMPLE pass: ompexp
z1.c: In function 'f':
z1.c:4:9: internal compiler error: Segmentation fault
4 | #pragma omp for collapse(2)
  | ^~~
0xb3b52f crash_signal
../../gcc/toplev.c:330
0x145ebc6 expand_omp_for_init_vars
../../gcc/omp-expand.c:2524
0x146be17 expand_omp_for_static_nochunk
../../gcc/omp-expand.c:5261
0x1474b6c expand_omp_for
../../gcc/omp-expand.c:8006
0x147537a expand_omp
../../gcc/omp-expand.c:9883
0x147725d execute_expand_omp
../../gcc/omp-expand.c:10115

[Bug c/97863] New: ICE in ix86_expand_split_stack_prologue, at config/i386/i386.c:9796

2020-11-16 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97863

Bug ID: 97863
   Summary: ICE in ix86_expand_split_stack_prologue, at
config/i386/i386.c:9796
   Product: gcc
   Version: 11.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.c
void bar (char *);

void
foo (void)
{
  char c[4294967296];
  bar (c);
}


$ gcc-11-20201115 -c z1.c -mcmodel=large -fsplit-stack
during RTL pass: pro_and_epilogue
z1.c: In function 'foo':
z1.c:8:1: internal compiler error: in ix86_expand_split_stack_prologue, at
config/i386/i386.c:9796
8 | }
  | ^
0xe2cff7 ix86_expand_split_stack_prologue()
../../gcc/config/i386/i386.c:9796
0x118e7ba gen_split_stack_prologue()
../../gcc/config/i386/i386.md:13939
0xe1a518 target_gen_split_stack_prologue
../../gcc/config/i386/i386.md:13694
0x89e3ad make_split_prologue_seq
../../gcc/function.c:5775
0x89e5da thread_prologue_and_epilogue_insns()
../../gcc/function.c:6008
0x89eba2 rest_of_handle_thread_prologue_and_epilogue
../../gcc/function.c:6500
0x89eba2 execute
../../gcc/function.c:6576

[Bug c++/97877] New: [11 Regression] ICE in cp_genericize_r, at cp/cp-gimplify.c:968

2020-11-17 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97877

Bug ID: 97877
   Summary: [11 Regression] ICE in cp_genericize_r, at
cp/cp-gimplify.c:968
   Product: gcc
   Version: 11.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 20201004 and 20201018 :


$ cat z1.cc
void f ()
{
  extern int a;
  extern int a;
  a = 2;
}


$ g++-11-20201004 -c z1.cc
$
$ g++-11-20201115 -c z1.cc
z1.cc: In function 'void f()':
z1.cc:6:1: internal compiler error: Segmentation fault
6 | }
  | ^
0xc727ef crash_signal
../../gcc/toplev.c:330
0x69951f cp_genericize_r
../../gcc/cp/cp-gimplify.c:968
0xeef755 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.c:12058
0xeefd2e 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.c:12394
0x69a37d cp_genericize_r
../../gcc/cp/cp-gimplify.c:1166
0xeef755 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.c:12058
0x698e58 cp_genericize_tree
../../gcc/cp/cp-gimplify.c:1579
0x698ff3 cp_genericize(tree_node*)
../../gcc/cp/cp-gimplify.c:1725
0x6c2127 finish_function(bool)
../../gcc/cp/decl.c:17229
0x74ccee cp_parser_function_definition_after_declarator
../../gcc/cp/parser.c:29495
0x74dbf3 cp_parser_function_definition_from_specifiers_and_declarator
../../gcc/cp/parser.c:29408
0x74dbf3 cp_parser_init_declarator
../../gcc/cp/parser.c:21124
0x72f42a cp_parser_simple_declaration
../../gcc/cp/parser.c:13943
0x75307a cp_parser_declaration
../../gcc/cp/parser.c:13640
0x75390a cp_parser_translation_unit
../../gcc/cp/parser.c:4806
0x75390a c_parse_file()
../../gcc/cp/parser.c:44595
0x81d252 c_common_parse_file()
../../gcc/c-family/c-opts.c:1196

[Bug c++/97878] New: [9/10/11 Regression] ICE in cxx_eval_outermost_constant_expr, at cp/constexpr.c:6825

2020-11-17 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97878

Bug ID: 97878
   Summary: [9/10/11 Regression] ICE in
cxx_eval_outermost_constant_expr, at
cp/constexpr.c:6825
   Product: gcc
   Version: 11.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 r7 :


$ cat z1.cc
extern int a[];
auto [b] {a};


$ g++-6 -c z1.cc
z1.cc:2:6: error: expected unqualified-id before '[' token
 auto [b] {a};
  ^

$ g++-11-20201115 -c z1.cc
z1.cc:2:12: internal compiler error: in cxx_eval_outermost_constant_expr, at
cp/constexpr.c:6825
2 | auto [b] {a};
  |^
0x67e549 cxx_eval_outermost_constant_expr
../../gcc/cp/constexpr.c:6824
0x680c0c maybe_constant_value(tree_node*, tree_node*, bool)
../../gcc/cp/constexpr.c:7093
0x7cec1c store_init_value(tree_node*, tree_node*, vec**, int)
../../gcc/cp/typeck2.c:747
0x6c410d check_initializer
../../gcc/cp/decl.c:6909
0x6c552e cp_finish_decl(tree_node*, tree_node*, bool, tree_node*, int)
../../gcc/cp/decl.c:7827
0x72fde4 cp_parser_decomposition_declaration
../../gcc/cp/parser.c:14225
0x72fde4 cp_parser_simple_declaration
../../gcc/cp/parser.c:13867
0x75307a cp_parser_declaration
../../gcc/cp/parser.c:13640
0x75390a cp_parser_translation_unit
../../gcc/cp/parser.c:4806
0x75390a c_parse_file()
../../gcc/cp/parser.c:44595
0x81d252 c_common_parse_file()
../../gcc/c-family/c-opts.c:1196

[Bug c/97879] New: [11 Regression] ICE in from_mode_char, at attribs.h:298

2020-11-17 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97879

Bug ID: 97879
   Summary: [11 Regression] ICE in from_mode_char, at
attribs.h:298
   Product: gcc
   Version: 11.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gs...@t-online.de
  Target Milestone: ---

This changed too between 20200823 and 20201004 :
(all with release builts)


$ cat z1.c
__attribute__ ((__access__(" ", 1))) void f (int *);
void f (int *);


$ cat z2.c
__attribute__ ((access ("none", 1))) void f (char *);
void f (char *);


$ gcc-11-20200823 -c z1.c
$
$ gcc-11-20201115 -c z1.c
z1.c:2:1: internal compiler error: in from_mode_char, at attribs.h:298
2 | void f (int *);
  | ^~~~
0x62a79a attr_access::from_mode_char(char)
../../gcc/attribs.h:298
0x62a79a init_attr_rdwr_indices(hash_map, attr_access> >*,
tree_node*)
../../gcc/attribs.c:2069
0x6feec2 warn_parm_array_mismatch(unsigned int, tree_node*, tree_node*)
../../gcc/c-family/c-warn.c:3345
0x68931f c_parser_declaration_or_fndef
../../gcc/c/c-parser.c:2346
0x690297 c_parser_external_declaration
../../gcc/c/c-parser.c:1777
0x690db9 c_parser_translation_unit
../../gcc/c/c-parser.c:1650
0x690db9 c_parse_file()
../../gcc/c/c-parser.c:21882
0x6dfb82 c_common_parse_file()
../../gcc/c-family/c-opts.c:1196

[Bug c/97879] [11 Regression] ICE in from_mode_char, at attribs.h:298

2020-11-17 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97879

G. Steinmetz  changed:

   What|Removed |Added

   Keywords||ice-on-invalid-code

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


These cases are related, but originate in r10 (20191124) :


$ cat z4.c
__attribute__ ((__access__(1))) void f ();


$ cat z5.c
__attribute__ ((access(1, 2))) void f ();


$ cat z6.c
__attribute__ ((access(2., 3.))) void f ();


$ gcc-11-20201115 -c z4.c
z4.c:1:1: internal compiler error: Segmentation fault
1 | __attribute__ ((__access__(1))) void f ();
  | ^
0xb3b52f crash_signal
../../gcc/toplev.c:330
0x6f7ade handle_access_attribute
../../gcc/c-family/c-attribs.c:4369
0x6299f1 decl_attributes(tree_node**, tree_node*, int, tree_node*)
../../gcc/attribs.c:724
0x641252 start_decl(c_declarator*, c_declspecs*, bool, tree_node*, unsigned
int*)
../../gcc/c/c-decl.c:5188
0x688366 c_parser_declaration_or_fndef
../../gcc/c/c-parser.c:2306
0x690297 c_parser_external_declaration
../../gcc/c/c-parser.c:1777
0x690db9 c_parser_translation_unit
../../gcc/c/c-parser.c:1650
0x690db9 c_parse_file()
../../gcc/c/c-parser.c:21882
0x6dfb82 c_common_parse_file()
../../gcc/c-family/c-opts.c:1196

[Bug c/97880] New: [9/10/11 Regression] ICE in emit_library_call_value_1, at calls.c:5298

2020-11-17 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97880

Bug ID: 97880
   Summary: [9/10/11 Regression] ICE in emit_library_call_value_1,
at calls.c:5298
   Product: gcc
   Version: 11.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gs...@t-online.de
  Target Milestone: ---

With option -ftrapv at -O0, down to version r7 :


$ cat z1.c
void f ()
{
  #pragma acc parallel loop tile(2, 3)
  for (int i = 0; i < 8; i++)
for (long j = 0; j < 8; j++);
}


$ gcc-6 -c z1.c -fopenacc -ftrapv -O0
$
$ gcc-11-20201115 -c z1.c -fopenacc
$ gcc-11-20201115 -c z1.c -fopenacc -ftrapv -O1
$
$ gcc-11-20201115 -c z1.c -fopenacc -ftrapv -O0
during RTL pass: expand
z1.c: In function 'f._omp_fn.0':
z1.c:3:11: internal compiler error: in emit_library_call_value_1, at
calls.c:5298
3 |   #pragma acc parallel loop tile(2, 3)
  |   ^~~
0x7304a0 emit_library_call_value_1(int, rtx_def*, rtx_def*, libcall_type,
machine_mode, int, std::pair*)
../../gcc/calls.c:5296
0xa3b4c8 emit_library_call_value(rtx_def*, rtx_def*, libcall_type,
machine_mode, rtx_def*, machine_mode, rtx_def*, machine_mode)
../../gcc/rtl.h:4258
0xa3b4c8 expand_binop(machine_mode, optab_tag, rtx_def*, rtx_def*, rtx_def*,
int, optab_methods)
../../gcc/optabs.c:1837
0x83bd01 expand_mult(machine_mode, rtx_def*, rtx_def*, rtx_def*, int, bool)
../../gcc/expmed.c:3571
0x858a04 expand_expr_real_2(separate_ops*, rtx_def*, machine_mode,
expand_modifier)
../../gcc/expr.c:9175
0x74af02 expand_gimple_stmt_1
../../gcc/cfgexpand.c:3816
0x74af02 expand_gimple_stmt
../../gcc/cfgexpand.c:3877
0x74fb37 expand_gimple_basic_block
../../gcc/cfgexpand.c:5918
0x75219e execute
../../gcc/cfgexpand.c:6602

[Bug c++/97895] New: [11 Regression] ICE in do_auto_deduction, at cp/pt.c:29255

2020-11-18 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97895

Bug ID: 97895
   Summary: [11 Regression] ICE in do_auto_deduction, at
cp/pt.c:29255
   Product: gcc
   Version: 11.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gs...@t-online.de
  Target Milestone: ---

Changed recently between 20201018 and 20201108 :


$ cat z1.cc
namespace std {
  template struct initializer_list {
const T *ptr;
decltype(sizeof 0) n;
  };
  auto a = {};
}


$ g++-11-20201115 -c z1.cc
z1.cc:6:13: internal compiler error: Segmentation fault
6 |   auto a = {};
  | ^
0xc727ef crash_signal
../../gcc/toplev.c:330
0x7642c1 vec::end()
../../gcc/vec.h:585
0x7642c1 do_auto_deduction(tree_node*, tree_node*, tree_node*, int,
auto_deduction_context, tree_node*, int)
../../gcc/cp/pt.c:29255
0x6c4cf2 cp_finish_decl(tree_node*, tree_node*, bool, tree_node*, int)
../../gcc/cp/decl.c:7570
0x74d7f7 cp_parser_init_declarator
../../gcc/cp/parser.c:21362
0x72f42a cp_parser_simple_declaration
../../gcc/cp/parser.c:13943
0x75307a cp_parser_declaration
../../gcc/cp/parser.c:13640
0x753d34 cp_parser_declaration_seq_opt
../../gcc/cp/parser.c:13485
0x753d34 cp_parser_namespace_body
../../gcc/cp/parser.c:19955
0x753d34 cp_parser_namespace_definition
../../gcc/cp/parser.c:19933
0x752eaf cp_parser_declaration
../../gcc/cp/parser.c:13620
0x75390a cp_parser_translation_unit
../../gcc/cp/parser.c:4806
0x75390a c_parse_file()
../../gcc/cp/parser.c:44595
0x81d252 c_common_parse_file()
../../gcc/c-family/c-opts.c:1196

[Bug fortran/97896] New: [11 Regression] ICE in gfc_trans_assignment_1, at fortran/trans-expr.c:11156

2020-11-18 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97896

Bug ID: 97896
   Summary: [11 Regression] ICE in gfc_trans_assignment_1, at
fortran/trans-expr.c:11156
   Product: gcc
   Version: 11.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gs...@t-online.de
  Target Milestone: ---

Follow-up of pr91651, changed between 20201004 and 20201018 :


$ cat z1.f90
program p
   logical :: a(2)
   integer :: b(2)
   b = index('xyxy', 'yx', a, 4)
   print *, b
end


$ gfortran-11-20201004 -c z1.f90
$
$ gfortran-11-20201115 -c z1.f90
z1.f90:4:32:

4 |b = index('xyxy', 'yx', a, 4)
  |1
internal compiler error: in gfc_trans_assignment_1, at
fortran/trans-expr.c:11156
0x764094 gfc_trans_assignment_1
../../gcc/fortran/trans-expr.c:11155
0x725aa7 trans_code
../../gcc/fortran/trans.c:1888
0x74bbe4 gfc_generate_function_code(gfc_namespace*)
../../gcc/fortran/trans-decl.c:6878
0x6d2e86 translate_all_program_units
../../gcc/fortran/parse.c:6347
0x6d2e86 gfc_parse_file()
../../gcc/fortran/parse.c:6616
0x71ee2f gfc_be_parse_file
../../gcc/fortran/f95-lang.c:212

[Bug c/97897] New: ICE tree check: expected ssa_name, have integer_cst in compute_optimized_partition_bases, at tree-ssa-coalesce.c:1638

2020-11-18 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97897

Bug ID: 97897
   Summary: ICE tree check: expected ssa_name, have integer_cst in
compute_optimized_partition_bases, at
tree-ssa-coalesce.c:1638
   Product: gcc
   Version: 11.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 :
(compiles with "(_Complex a)" instead)


$ cat z1.c
void h ();
void f () __attribute__ ((returns_twice));
void g (_Complex int a)
{
  f ();
  if (a != 0)
  {
a = 0;
h ();
  }
}


$ gcc-11-20201115 -c z1.c
during RTL pass: expand
z1.c: In function 'g':
z1.c:3:6: internal compiler error: tree check: expected ssa_name, have
integer_cst in compute_optimized_partition_bases, at tree-ssa-coalesce.c:1638
3 | void g (_Complex int a)
  |  ^
0x626df8 tree_check_failed(tree_node const*, char const*, int, char const*,
...)
../../gcc/tree.c:9779
0xe4bb1f tree_check(tree_node*, char const*, int, char const*, tree_code)
../../gcc/tree.h:3314
0xe4bb1f compute_optimized_partition_bases
../../gcc/tree-ssa-coalesce.c:1638
0xe4bb1f coalesce_ssa_name(_var_map*)
../../gcc/tree-ssa-coalesce.c:1718
0xdde89b remove_ssa_form
../../gcc/tree-outof-ssa.c:1065
0xdde89b rewrite_out_of_ssa(ssaexpand*)
../../gcc/tree-outof-ssa.c:1323
0x80fa70 execute
../../gcc/cfgexpand.c:6407

[Bug c/97898] New: ICE in outermost_invariant_loop, at tree-ssa-loop-im.c:431

2020-11-18 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97898

Bug ID: 97898
   Summary: ICE in outermost_invariant_loop, at
tree-ssa-loop-im.c:431
   Product: gcc
   Version: 11.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 version r5 :


$ cat z1.c
void f (int n)
{
  int *i;
#pragma omp for schedule(static, 2)
  for (i = 0; i < 8; i += n);
}


$ gcc-11-20201115 -c z1.c -fopenmp -O2
z1.c: In function 'f':
z1.c:5:17: warning: comparison between pointer and integer
5 |   for (i = 0; i < 8; i += n);
  | ^
during GIMPLE pass: lim
z1.c:1:6: internal compiler error: in outermost_invariant_loop, at
tree-ssa-loop-im.c:431
1 | void f (int n)
  |  ^
0xc43b12 outermost_invariant_loop
../../gcc/tree-ssa-loop-im.c:431
0xc48551 compute_invariantness
../../gcc/tree-ssa-loop-im.c:1063
0xc48551 loop_invariant_motion_in_fun(function*, bool)
../../gcc/tree-ssa-loop-im.c:3114
0xc49e2a execute
../../gcc/tree-ssa-loop-im.c:3180

---

$ gcc-11-20201115 -c z1.c -fopenmp   # configured with --enable-checking=yes
z1.c: In function 'f':
z1.c:5:17: warning: comparison between pointer and integer
5 |   for (i = 0; i < 8; i += n);
  | ^
z1.c:5:24: error: invalid operands in binary operation
5 |   for (i = 0; i < 8; i += n);
  |^~
i = i + (sizetype) D.2082;
during GIMPLE pass: ompexp
z1.c:5:24: internal compiler error: verify_gimple failed
0xd61194 verify_gimple_in_cfg(function*, bool)
../../gcc/tree-cfg.c:5461
0xc1742e execute_function_todo
../../gcc/passes.c:2039
0xc182d2 execute_todo
../../gcc/passes.c:2093

[Bug c/97954] New: [11 Regression] ICE in maybe_record_trace_start, at dwarf2cfi.c:2360

2020-11-23 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97954

Bug ID: 97954
   Summary: [11 Regression] ICE in maybe_record_trace_start, at
dwarf2cfi.c:2360
   Product: gcc
   Version: 11.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 20201108 and 20201115 :


$ cat z1.c
int
foo (void)
{
  int x;
 lab:
  asm goto ("": "=a" (x) : : : lab);
  return x;
}


$ gcc-11-20201122 -c z1.c -O2
during RTL pass: dwarf2
z1.c: In function 'foo':
z1.c:8:1: internal compiler error: in maybe_record_trace_start, at
dwarf2cfi.c:2360
8 | }
  | ^
0x7c9c43 maybe_record_trace_start
../../gcc/dwarf2cfi.c:2360
0x7ca18a create_trace_edges
../../gcc/dwarf2cfi.c:2501
0x7cc163 scan_trace
../../gcc/dwarf2cfi.c:2732
0x7cca31 create_cfi_notes
../../gcc/dwarf2cfi.c:2758
0x7cca31 execute_dwarf2_frame
../../gcc/dwarf2cfi.c:3122
0x7cca31 execute
../../gcc/dwarf2cfi.c:3610

---

z1.c: In function 'foo':
z1.c:8:1: error: too many outgoing branch edges from bb 4
8 | }
  | ^
during RTL pass: loop2_invariant
z1.c:8:1: internal compiler error: verify_flow_info failed
0x814164 verify_flow_info()
../../gcc/cfghooks.c:269
0xb3c87b checking_verify_flow_info
../../gcc/cfghooks.h:212
0xb3c87b move_loop_invariants()
../../gcc/loop-invariant.c:2304
0xb384f0 execute
../../gcc/loop-init.c:530

[Bug c/97955] New: [11 Regression] ICE in build_array_type_1, at tree.c:8264

2020-11-23 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97955

Bug ID: 97955
   Summary: [11 Regression] ICE in build_array_type_1, at
tree.c:8264
   Product: gcc
   Version: 11.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 20200823 and 20201004 :


$ cat z1.c
void f (int n, int a[n]);
void f (int *b) {}


$ gcc-11-20201122 -c z1.c
z1.c:2:1: internal compiler error: Segmentation fault
2 | void f (int *b) {}
  | ^~~~
0xb42eff crash_signal
../../gcc/toplev.c:330
0xdbbf5d build_array_type_1
../../gcc/tree.c:8264
0x62930b attr_access::array_as_string[abi:cxx11](tree_node*) const
../../gcc/attribs.c:2299
0x6ff9cd warn_parm_array_mismatch(unsigned int, tree_node*, tree_node*)
../../gcc/c-family/c-warn.c:3435
0x6421a4 start_function(c_declspecs*, c_declarator*, tree_node*)
../../gcc/c/c-decl.c:9591
0x689236 c_parser_declaration_or_fndef
../../gcc/c/c-parser.c:2444
0x690a47 c_parser_external_declaration
../../gcc/c/c-parser.c:1777
0x691569 c_parser_translation_unit
../../gcc/c/c-parser.c:1650
0x691569 c_parse_file()
../../gcc/c/c-parser.c:21882
0x6e0772 c_common_parse_file()
../../gcc/c-family/c-opts.c:1198

[Bug c/97956] New: [11 Regression] ICE in build2, at tree.c:4872

2020-11-23 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97956

Bug ID: 97956
   Summary: [11 Regression] ICE in build2, at tree.c:4872
   Product: gcc
   Version: 11.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 20200823 and 20201004, derived from memchr.c :


$ cat z1.c
typedef __INT8_TYPE__ int8_t;
typedef __INT32_TYPE__ int32_t;
extern void* memchr (const void*, int, long);
struct SX
{
  int32_t n;
  int8_t a[];
};
const struct SX sx = { 0x1221 };
const char sx_rep[] = { };
void test_find (void)
{
  int n = 0, nb = (const char*)&sx.a - (const char*)&sx;
  const char *p = (const char*)&sx, *q = sx_rep;
  n += p + 1 == memchr (p, q[1], nb);
}


$ gcc-11-20201122 -c z1.c
$
$ gcc-11-20201122 -c z1.c -O2
during GIMPLE pass: forwprop
z1.c: In function 'test_find':
z1.c:16:1: internal compiler error: in build2, at tree.c:4872
   16 | }
  | ^
0xdaae9e build2(tree_code, tree_node*, tree_node*, tree_node*)
../../gcc/tree.c:4871
0x880b9f build2_loc
../../gcc/tree.h:4371
0x880b9f fold_build2_loc(unsigned int, tree_code, tree_node*, tree_node*,
tree_node*)
../../gcc/fold-const.c:13318
0xc3ad53 forward_propagate_into_comparison_1
../../gcc/tree-ssa-forwprop.c:434
0xc41900 forward_propagate_into_comparison
../../gcc/tree-ssa-forwprop.c:491
0xc41900 execute
../../gcc/tree-ssa-forwprop.c:3145

[Bug c/97957] New: ICE in init_dynamic_diag_info, at c-family/c-format.c:5024

2020-11-23 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97957

Bug ID: 97957
   Summary: ICE in init_dynamic_diag_info, at
c-family/c-format.c:5024
   Product: gcc
   Version: 11.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gs...@t-online.de
  Target Milestone: ---

A doubled line affects versions down to at least r5 :


$ cat z1.c
typedef long __gcc_host_wide_int__;
typedef long __gcc_host_wide_int__;
__attribute__ ((__format__ (__gcc_diag__, 1, 2)))
void f () {}


$ gcc-11-20201122 -c z1.c
z1.c:4:1: internal compiler error: in init_dynamic_diag_info, at
c-family/c-format.c:5024
4 | void f () {}
  | ^~~~
0x6d1b97 init_dynamic_diag_info
../../gcc/c-family/c-format.c:5024
0x6d1b97 handle_format_attribute(tree_node**, tree_node*, tree_node*, int,
bool*)
../../gcc/c-family/c-format.c:5252
0x62a101 decl_attributes(tree_node**, tree_node*, int, tree_node*)
../../gcc/attribs.c:724
0x641eef start_function(c_declspecs*, c_declarator*, tree_node*)
../../gcc/c/c-decl.c:9410
0x689236 c_parser_declaration_or_fndef
../../gcc/c/c-parser.c:2444
0x690a47 c_parser_external_declaration
../../gcc/c/c-parser.c:1777
0x691569 c_parser_translation_unit
../../gcc/c/c-parser.c:1650
0x691569 c_parse_file()
../../gcc/c/c-parser.c:21882
0x6e0772 c_common_parse_file()
../../gcc/c-family/c-opts.c:1198

[Bug c/97957] ICE in init_dynamic_diag_info, at c-family/c-format.c:5024

2020-11-23 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97957

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

Another similar situation :


$ cat z2.c
typedef long __gcc_host_wide_int__;
typedef long __gcc_host_wide_int__;
__attribute__ ((__format__ (__asm_fprintf__, 1, 2)))
void f () {}


$ gcc-11-20201122 -c z2.c
z2.c:4:1: internal compiler error: in init_dynamic_asm_fprintf_info, at
c-family/c-format.c:4829
4 | void f () {}
  | ^~~~
0x6d1b33 init_dynamic_asm_fprintf_info
../../gcc/c-family/c-format.c:4829
0x6d1b33 handle_format_attribute(tree_node**, tree_node*, tree_node*, int,
bool*)
../../gcc/c-family/c-format.c:5240
0x62a101 decl_attributes(tree_node**, tree_node*, int, tree_node*)
../../gcc/attribs.c:724
0x641eef start_function(c_declspecs*, c_declarator*, tree_node*)
../../gcc/c/c-decl.c:9410
0x689236 c_parser_declaration_or_fndef
../../gcc/c/c-parser.c:2444
0x690a47 c_parser_external_declaration
../../gcc/c/c-parser.c:1777
0x691569 c_parser_translation_unit
../../gcc/c/c-parser.c:1650
0x691569 c_parse_file()
../../gcc/c/c-parser.c:21882
0x6e0772 c_common_parse_file()
../../gcc/c-family/c-opts.c:1198

[Bug c/97958] New: ICE in build2, at tree.c:4868

2020-11-23 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97958

Bug ID: 97958
   Summary: ICE in build2, at tree.c:4868
   Product: gcc
   Version: 11.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.c
int f ()
{
  #pragma omp atomic
  f = f + 1;
}


$ gcc-11-20201122 -c z1.c -fopenmp
z1.c: In function 'f':
z1.c:4:3: internal compiler error: in build2, at tree.c:4868
4 |   f = f + 1;
  |   ^
0xdaaf2d build2(tree_code, tree_node*, tree_node*, tree_node*)
../../gcc/tree.c:4867
0x674105 c_parser_binary_expression
../../gcc/c/c-parser.c:8010
0x674b15 c_parser_conditional_expression
../../gcc/c/c-parser.c:7607
0x675071 c_parser_expr_no_commas
../../gcc/c/c-parser.c:7522
0x67ffd0 c_parser_omp_atomic
../../gcc/c/c-parser.c:17677
0x69045c c_parser_omp_construct
../../gcc/c/c-parser.c:21546
0x66dd07 c_parser_pragma
../../gcc/c/c-parser.c:12517
0x688206 c_parser_compound_statement_nostart
../../gcc/c/c-parser.c:5764
0x6885d3 c_parser_compound_statement
../../gcc/c/c-parser.c:5606
0x689e61 c_parser_declaration_or_fndef
../../gcc/c/c-parser.c:2543
0x690a47 c_parser_external_declaration
../../gcc/c/c-parser.c:1777
0x691569 c_parser_translation_unit
../../gcc/c/c-parser.c:1650
0x691569 c_parse_file()
../../gcc/c/c-parser.c:21882
0x6e0772 c_common_parse_file()
../../gcc/c-family/c-opts.c:1198

[Bug c/97971] New: [9/10/11 Regression] ICE in process_alt_operands, at lra-constraints.c:3110

2020-11-24 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97971

Bug ID: 97971
   Summary: [9/10/11 Regression] ICE in process_alt_operands, at
lra-constraints.c:3110
   Product: gcc
   Version: 11.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 20181104 and 2018 :


$ cat z1.c
int f ()
{
  register _Complex a asm ("rax");
  register int b asm ("rdx");
  asm ("abc %0 %1" : "=&r" (a), "=r" (b));
  return a;
}


$ gcc-11-20201122 -c z1.c
z1.c: In function 'f':
z1.c:7:1: error: unable to generate reloads for impossible constraints:
7 | }
  | ^
(insn 5 2 6 2 (parallel [
(set (reg/v:DC 0 ax [ a ])
(asm_operands:DC ("abc %0 %1") ("=&r") 0 []
 []
 [] z1.c:5))
(set (reg/v:SI 1 dx [ b ])
(asm_operands:SI ("abc %0 %1") ("=r") 1 []
 []
 [] z1.c:5))
(clobber (reg:CC 17 flags))
]) "z1.c":5:3 -1
 (expr_list:REG_UNUSED (reg:CC 17 flags)
(expr_list:REG_UNUSED (reg/v:SI 1 dx [ b ])
(expr_list:REG_UNUSED (reg:DI 1 dx)
(nil)
during RTL pass: reload
z1.c:7:1: internal compiler error: in process_alt_operands, at
lra-constraints.c:3110
0x5f12f5 _fatal_insn(char const*, rtx_def const*, char const*, int, char
const*)
../../gcc/rtl-error.c:108
0x9de587 process_alt_operands
../../gcc/lra-constraints.c:3109
0x9e190b curr_insn_transform
../../gcc/lra-constraints.c:4073
0x9e4646 lra_constraints(bool)
../../gcc/lra-constraints.c:5138
0x9d28e2 lra(_IO_FILE*)
../../gcc/lra.c:2331
0x98dde9 do_reload
../../gcc/ira.c:5802
0x98dde9 execute
../../gcc/ira.c:5988

[Bug c/97972] New: [10/11 Regression] ICE in moving_insn_creates_bookkeeping_block_p, at sel-sched.c:2031

2020-11-24 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97972

Bug ID: 97972
   Summary: [10/11 Regression] ICE in
moving_insn_creates_bookkeeping_block_p, at
sel-sched.c:2031
   Product: gcc
   Version: 11.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 20191117 and 20191124.
Needs option -O2 and testfile gcc.c-torture/compile/20161124-1.c :


$ gcc-11-20201122 -c 20161124-1.c -O2 -fsanitize=undefined
-fselective-scheduling2 -fvar-tracking-assignments
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 | }
  | ^
0xb42eff crash_signal
../../gcc/toplev.c:330
0xb0d5c7 moving_insn_creates_bookkeeping_block_p
../../gcc/sel-sched.c:2031
0xb0d5c7 moveup_expr
../../gcc/sel-sched.c:2199
0xb0d5c7 moveup_expr_cached
../../gcc/sel-sched.c:2544
0xb0fe1e move_op_ascend
../../gcc/sel-sched.c:6149
0xb11a57 code_motion_path_driver
../../gcc/sel-sched.c:6648
0xb11d3e code_motion_process_successors
../../gcc/sel-sched.c:6342
0xb11d3e code_motion_path_driver
../../gcc/sel-sched.c:6608
0xb12193 move_op
../../gcc/sel-sched.c:6702
0xb12193 move_exprs_to_boundary
../../gcc/sel-sched.c:5223
0xb12193 schedule_expr_on_boundary
../../gcc/sel-sched.c:5436
0xb15864 fill_insns
../../gcc/sel-sched.c:5578
0xb17613 schedule_on_fences
../../gcc/sel-sched.c:7353
0xb17613 sel_sched_region_2
../../gcc/sel-sched.c:7491
0xb181ad sel_sched_region_1
../../gcc/sel-sched.c:7533
0xb18c7b sel_sched_region(int)
../../gcc/sel-sched.c:7634
0xb196b9 run_selective_scheduling()
../../gcc/sel-sched.c:7720
0xafaf75 rest_of_handle_sched2
../../gcc/sched-rgn.c:3738
0xafaf75 execute
../../gcc/sched-rgn.c:3882

[Bug c++/97973] New: [10/11 Regression] ICE in tsubst_copy_and_build, at cp/pt.c:19577

2020-11-24 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97973

Bug ID: 97973
   Summary: [10/11 Regression] ICE in tsubst_copy_and_build, at
cp/pt.c:19577
   Product: gcc
   Version: 11.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 20200119 and 20200126 :


$ cat z1.cc
void a (const int& b);
template  int d { a[1](1.); }


$ g++-11-20201122 -c z1.cc
z1.cc:2:35: internal compiler error: in tsubst_copy_and_build, at cp/pt.c:19577
2 | template  int d { a[1](1.); }
  |   ^
0x768e61 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool,
bool)
../../gcc/cp/pt.c:19577
0x7688d2 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool,
bool)
../../gcc/cp/pt.c:19477
0x6817cc fold_non_dependent_expr_template
../../gcc/cp/constexpr.c:7177
0x6df205 fold_for_warn(tree_node*)
../../gcc/cp/expr.c:409
0x800ebc check_function_restrict
../../gcc/c-family/c-common.c:5468
0x800ebc check_function_arguments(unsigned int, tree_node const*, tree_node
const*, int, tree_node**, vec*)
../../gcc/c-family/c-common.c:5840
0x7c9607 cp_build_function_call_vec(tree_node*, vec**, int, tree_node*)
../../gcc/cp/typeck.c:4024
0x79689f finish_call_expr(tree_node*, vec**, bool,
bool, int)
../../gcc/cp/semantics.c:2728
0x73f005 cp_parser_postfix_expression
../../gcc/cp/parser.c:7556
0x7471b5 cp_parser_unary_expression
../../gcc/cp/parser.c:8659
0x7211ff cp_parser_cast_expression
../../gcc/cp/parser.c:9562
0x721a32 cp_parser_binary_expression
../../gcc/cp/parser.c:9664
0x7231c0 cp_parser_assignment_expression
../../gcc/cp/parser.c:9968
0x7221ad cp_parser_constant_expression
../../gcc/cp/parser.c:10264
0x722711 cp_parser_initializer_clause
../../gcc/cp/parser.c:23723
0x7228b4 cp_parser_initializer_list
../../gcc/cp/parser.c:24002
0x7228b4 cp_parser_braced_list
../../gcc/cp/parser.c:23764
0x726082 cp_parser_initializer
../../gcc/cp/parser.c:23681
0x74e50e cp_parser_init_declarator
../../gcc/cp/parser.c:21323
0x751014 cp_parser_single_declaration
../../gcc/cp/parser.c:29997

[Bug c++/97974] New: [9/10/11 Regression] ICE tree check: expected overload, have function_decl in get_class_binding_direct, at cp/name-lookup.c:1332

2020-11-24 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97974

Bug ID: 97974
   Summary: [9/10/11 Regression] ICE tree check: expected
overload, have function_decl in
get_class_binding_direct, at cp/name-lookup.c:1332
   Product: gcc
   Version: 11.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 before 20180525 :


$ cat z1.cc
struct {
  struct {
operator int ();
int a;
  };
  operator int;
};


$ g++-11-20201122 -c z1.cc
z1.cc:6:12: internal compiler error: tree check: expected overload, have
function_decl in get_class_binding_direct, at cp/name-lookup.c:1332
6 |   operator int
  |^~~
0x6520ba tree_check_failed(tree_node const*, char const*, int, char const*,
...)
../../gcc/tree.c:9810
0x7fad5a tree_check(tree_node*, char const*, int, char const*, tree_code)
../../gcc/tree.h:3317
0x7fad5a get_class_binding_direct(tree_node*, tree_node*, bool)
../../gcc/cp/name-lookup.c:1332
0x8ea66b lookup_field_r
../../gcc/cp/search.c:978
0x8e904e dfs_walk_all(tree_node*, tree_node* (*)(tree_node*, void*), tree_node*
(*)(tree_node*, void*), void*)
../../gcc/cp/search.c:1408
0x8e91fc lookup_member(tree_node*, tree_node*, int, bool, int,
access_failure_info*)
../../gcc/cp/search.c:1121
0x8e95a0 lookup_fnfields(tree_node*, tree_node*, int, int)
../../gcc/cp/search.c:1327
0x80aada lookup_name_1
../../gcc/cp/name-lookup.c:6587
0x80aada lookup_name(tree_node*, LOOK_where, LOOK_want)
../../gcc/cp/name-lookup.c:6665
0x811255 lookup_name(tree_node*, LOOK_want)
../../gcc/cp/name-lookup.h:294
0x811255 cp_parser_lookup_name
../../gcc/cp/parser.c:28864
0x818615 cp_parser_diagnose_invalid_type_name
../../gcc/cp/parser.c:3365
0x84a063 cp_parser_parse_and_diagnose_invalid_type_name
../../gcc/cp/parser.c:3619
0x860367 cp_parser_member_declaration
../../gcc/cp/parser.c:25456
0x82f722 cp_parser_member_specification_opt
../../gcc/cp/parser.c:25306
0x82f722 cp_parser_class_specifier_1
../../gcc/cp/parser.c:24395
0x832159 cp_parser_class_specifier
../../gcc/cp/parser.c:24706
0x832159 cp_parser_type_specifier
../../gcc/cp/parser.c:17962
0x832d86 cp_parser_decl_specifier_seq
../../gcc/cp/parser.c:14584
0x8339f1 cp_parser_simple_declaration
../../gcc/cp/parser.c:13841

[Bug c++/97975] New: ICE unexpected expression '(int)A< >::b' of kind implicit_conv_expr

2020-11-24 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97975

Bug ID: 97975
   Summary: ICE unexpected expression '(int)A<
 >::b' of kind
implicit_conv_expr
   Product: gcc
   Version: 11.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gs...@t-online.de
  Target Milestone: ---

Seems to be an old issue :


$ cat z1.cc
template  class A
{
  static const float b;
  static inline const int c = b;
};


$ g++-11-20201122 -c z1.cc
z1.cc:4:31: internal compiler error: unexpected expression '(int)A<
 >::b' of kind implicit_conv_expr
4 |   static inline const int c = b;
  |   ^
0x6f5185 cxx_eval_constant_expression
../../gcc/cp/constexpr.c:6647
0x6f6b37 cxx_eval_outermost_constant_expr
../../gcc/cp/constexpr.c:6856
0x6fbf8f maybe_constant_init_1
../../gcc/cp/constexpr.c:7307
0x96811c store_init_value(tree_node*, tree_node*, vec**, int)
../../gcc/cp/typeck2.c:760
0x74fc6e check_initializer
../../gcc/cp/decl.c:6923
0x77f0ab cp_finish_decl(tree_node*, tree_node*, bool, tree_node*, int)
../../gcc/cp/decl.c:7713
0x793bd3 finish_static_data_member_decl(tree_node*, tree_node*, bool,
tree_node*, int)
../../gcc/cp/decl2.c:814
0x79477e grokfield(cp_declarator const*, cp_decl_specifier_seq*, tree_node*,
bool, tree_node*, tree_node*)
../../gcc/cp/decl2.c:1000
0x85f9f4 cp_parser_member_declaration
../../gcc/cp/parser.c:25861
0x82f722 cp_parser_member_specification_opt
../../gcc/cp/parser.c:25306
0x82f722 cp_parser_class_specifier_1
../../gcc/cp/parser.c:24395
0x832159 cp_parser_class_specifier
../../gcc/cp/parser.c:24706
0x832159 cp_parser_type_specifier
../../gcc/cp/parser.c:17962
0x832d86 cp_parser_decl_specifier_seq
../../gcc/cp/parser.c:14584
0x85e0f5 cp_parser_single_declaration
../../gcc/cp/parser.c:29906
0x85e4b5 cp_parser_template_declaration_after_parameters
../../gcc/cp/parser.c:29570
0x85f07f cp_parser_explicit_template_declaration
../../gcc/cp/parser.c:29835
0x85f07f cp_parser_template_declaration_after_export
../../gcc/cp/parser.c:29854
0x8613a9 cp_parser_declaration
../../gcc/cp/parser.c:13608
0x861cf8 cp_parser_translation_unit
../../gcc/cp/parser.c:4806

[Bug c/97991] New: ICE in c_parser_consume_token, at c/c-parser.c:850

2020-11-25 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97991

Bug ID: 97991
   Summary: ICE in c_parser_consume_token, at c/c-parser.c:850
   Product: gcc
   Version: 11.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.c
#define foo _Pragma ("pack(bar)")
#pragma redefine_extname foo


$ gcc-11-20201122 -c z1.c
z1.c:2:9: internal compiler error: in c_parser_consume_token, at
c/c-parser.c:850
2 | #pragma redefine_extname foo
  | ^~~~
0x666747 c_parser_consume_token(c_parser*)
../../gcc/c/c-parser.c:850
0x6687ea pragma_lex(tree_node**, unsigned int*)
../../gcc/c/c-parser.c:12555
0x6e4313 handle_pragma_redefine_extname
../../gcc/c-family/c-pragma.c:499
0x66e6bf c_parser_pragma
../../gcc/c/c-parser.c:12524
0x6909f3 c_parser_external_declaration
../../gcc/c/c-parser.c:1758
0x691569 c_parser_translation_unit
../../gcc/c/c-parser.c:1650
0x691569 c_parse_file()
../../gcc/c/c-parser.c:21882
0x6e0772 c_common_parse_file()
../../gcc/c-family/c-opts.c:1198

[Bug c/97991] ICE in c_parser_consume_token, at c/c-parser.c:850

2020-11-25 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97991

G. Steinmetz  changed:

   What|Removed |Added

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

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

A special case, loosely related :


$ cat z2.c
#define foo _Pragma (" ")
#pragma redefine_extname foo


$ gcc-11-20201122 -c z2.c -Wall
z2.c:2:2: internal compiler error: unspellable token PRAGMA_EOL
2 | #pragma redefine_extname foo
  |  ^
0x6c46ba c_cpp_diagnostic(cpp_reader*, cpp_diagnostic_level,
cpp_warning_reason, rich_location*, char const*, __va_list_tag (*) [1])
../../gcc/c-family/c-common.c:6414
0x1522c92 cpp_diagnostic
../../libcpp/errors.c:75
0x1522e16 cpp_error(cpp_reader*, cpp_diagnostic_level, char const*, ...)
../../libcpp/errors.c:89
0x152c22d cpp_spell_token(cpp_reader*, cpp_token const*, unsigned char*, bool)
../../libcpp/lex.c:3541
0x152dac7 cpp_token_as_text(cpp_reader*, cpp_token const*)
../../libcpp/lex.c:3557
0x6d6022 cb_def_pragma
../../gcc/c-family/c-lex.c:255
0x151f880 do_pragma
../../libcpp/directives.c:1539
0x15224fd destringize_and_run
../../libcpp/directives.c:1885
0x15226cc _cpp_do__Pragma
../../libcpp/directives.c:1963
0x1536eb6 builtin_macro
../../libcpp/macro.c:744
0x15344b2 enter_macro_context
../../libcpp/macro.c:1562
0x153624d cpp_get_token_1
../../libcpp/macro.c:2925
0x6d757d c_lex_with_flags(tree_node**, unsigned int*, unsigned char*, int)
../../gcc/c-family/c-lex.c:470
0x664e4f c_lex_one_token
../../gcc/c/c-parser.c:279
0x668809 c_parser_peek_token(c_parser*)
../../gcc/c/c-parser.c:483
0x668809 pragma_lex(tree_node**, unsigned int*)
../../gcc/c/c-parser.c:12540
0x6e4313 handle_pragma_redefine_extname
../../gcc/c-family/c-pragma.c:499
0x66e6bf c_parser_pragma
../../gcc/c/c-parser.c:12524
0x6909f3 c_parser_external_declaration
../../gcc/c/c-parser.c:1758
0x691569 c_parser_translation_unit
../../gcc/c/c-parser.c:1650

[Bug c/97992] New: ICE in subst_asm_stack_regs, at reg-stack.c:2264

2020-11-25 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97992

Bug ID: 97992
   Summary: ICE in subst_asm_stack_regs, at reg-stack.c:2264
   Product: gcc
   Version: 11.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.c
long double
f (long double x)
{
  double r;
  asm volatile ("fsqrt" : "=t"(r) : ""(x));
  return f (x * x);
}


$ gcc-11-20201122 -c z1.c -O2
during RTL pass: stack
z1.c: In function 'f':
z1.c:7:1: internal compiler error: in subst_asm_stack_regs, at reg-stack.c:2264
7 | }
  | ^
0xabde0e subst_asm_stack_regs
../../gcc/reg-stack.c:2264
0xabf8ad subst_stack_regs
../../gcc/reg-stack.c:2425
0xabfc27 convert_regs_1
../../gcc/reg-stack.c:3080
0xabfc27 convert_regs_2
../../gcc/reg-stack.c:3214
0xac0ddd convert_regs
../../gcc/reg-stack.c:3249
0xac0ddd reg_to_stack
../../gcc/reg-stack.c:3374
0xac0ddd rest_of_handle_stack_regs
../../gcc/reg-stack.c:3429
0xac0ddd execute
../../gcc/reg-stack.c:3460

[Bug c++/97993] New: [11 Regression] ICE tree check: expected tree_list, have error_mark in tsubst_copy_and_build, at cp/pt.c:19834

2020-11-25 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97993

Bug ID: 97993
   Summary: [11 Regression] ICE tree check: expected tree_list,
have error_mark in tsubst_copy_and_build, at
cp/pt.c:19834
   Product: gcc
   Version: 11.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 20200510 and 20200517 :


$ cat z1.cc
template  T a;
template  auto foo ();
struct S decltype (foo );


$ g++-11-20201122 -c z1.cc
z1.cc:2:44: internal compiler error: tree check: expected tree_list, have
error_mark in tsubst_copy_and_build, at cp/pt.c:19834
2 | template  auto foo ();
  |^
0x6520ba tree_check_failed(tree_node const*, char const*, int, char const*,
...)
../../gcc/tree.c:9810
0x8915f1 tree_check(tree_node*, char const*, int, char const*, tree_code)
../../gcc/tree.h:3317
0x8915f1 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool,
bool)
../../gcc/cp/pt.c:19834
0x893a4e tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool,
bool)
../../gcc/cp/pt.c:16017
0x893a4e tsubst(tree_node*, tree_node*, int, tree_node*)
../../gcc/cp/pt.c:16017
0x8a45e1 coerce_template_parms
../../gcc/cp/pt.c:8930
0x8ca363 resolve_nondeduced_context(tree_node*, int)
../../gcc/cp/pt.c:22410
0x905e8f finish_decltype_type(tree_node*, bool, int)
../../gcc/cp/semantics.c:10018
0x847461 cp_parser_decltype
../../gcc/cp/parser.c:15198
0x8441ab cp_parser_simple_type_specifier
../../gcc/cp/parser.c:18262
0x8320ed cp_parser_type_specifier
../../gcc/cp/parser.c:18038
0x832d86 cp_parser_decl_specifier_seq
../../gcc/cp/parser.c:14584
0x8339f1 cp_parser_simple_declaration
../../gcc/cp/parser.c:13841
0x861342 cp_parser_declaration
../../gcc/cp/parser.c:13659
0x861cf8 cp_parser_translation_unit
../../gcc/cp/parser.c:4806
0x861cf8 c_parse_file()
../../gcc/cp/parser.c:44613
0x9d63a2 c_common_parse_file()
../../gcc/c-family/c-opts.c:1198

[Bug c++/97994] New: [11 Regression] ICE in nothrow_spec_p, at cp/except.c:1183

2020-11-25 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97994

Bug ID: 97994
   Summary: [11 Regression] ICE in nothrow_spec_p, at
cp/except.c:1183
   Product: gcc
   Version: 11.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 20200621 and 20200628 :


$ cat z1.cc
struct S;
template  void foo () noexcept (T::v);
template 
void bar (void (A...) noexcept)
{ bar (foo); }


$ g++-11-20200621 -c z1.cc
$
$ g++-11-20201122 -c z1.cc
z1.cc: In substitution of 'template void bar(void (*)(A ...)
noexcept) [with A = ]':
z1.cc:5:14:   required from here
z1.cc:5:14: internal compiler error: in nothrow_spec_p, at cp/except.c:1183
5 | { bar (foo); }
  |  ^
0x6de2d7 nothrow_spec_p(tree_node const*)
../../gcc/cp/except.c:1183
0x770333 unify
../../gcc/cp/pt.c:23799
0x76f313 unify
../../gcc/cp/pt.c:23888
0x7707cc try_one_overload
../../gcc/cp/pt.c:22522
0x76e5f5 resolve_overloaded_unification
../../gcc/cp/pt.c:22286
0x76e5f5 unify_one_argument
../../gcc/cp/pt.c:21832
0x77b3b6 type_unification_real
../../gcc/cp/pt.c:21976
0x7840eb 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.c:21345
0x65315c add_template_candidate_real
../../gcc/cp/call.c:3431
0x6537ec add_template_candidate
../../gcc/cp/call.c:3519
0x6537ec add_candidates
../../gcc/cp/call.c:5929
0x657881 add_candidates
../../gcc/cp/call.c:4561
0x657881 perform_overload_resolution
../../gcc/cp/call.c:4561
0x65c372 build_new_function_call(tree_node*, vec**, int)
../../gcc/cp/call.c:4635
0x796810 finish_call_expr(tree_node*, vec**, bool,
bool, int)
../../gcc/cp/semantics.c:2703
0x73f005 cp_parser_postfix_expression
../../gcc/cp/parser.c:7556
0x7471b5 cp_parser_unary_expression
../../gcc/cp/parser.c:8659
0x7211ff cp_parser_cast_expression
../../gcc/cp/parser.c:9562
0x721a32 cp_parser_binary_expression
../../gcc/cp/parser.c:9664
0x7231c0 cp_parser_assignment_expression
../../gcc/cp/parser.c:9968

[Bug c++/97995] New: [11 Regression] ICE tree check: expected tree that contains 'typed' structure, have 'deferred_noexcept' in unify, at cp/pt.c:23473

2020-11-25 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97995

Bug ID: 97995
   Summary: [11 Regression] ICE tree check: expected tree that
contains 'typed' structure, have 'deferred_noexcept'
in unify, at cp/pt.c:23473
   Product: gcc
   Version: 11.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 20200621 and 20200628 :


$ cat z1.cc
struct S;
template  void foo () noexcept (T::v);
template 
void bar (void (A...) noexcept (b));
static_assert (bar (foo);


$ g++-11-20201122 -c z1.cc
z1.cc: In substitution of 'template void bar(void (*)(A
...) noexcept (b)) [with A = ; int b = ]':
z1.cc:5:27:   required from here
z1.cc:5:27: internal compiler error: tree check: expected tree that contains
'typed' structure, have 'deferred_noexcept' in unify, at cp/pt.c:23473
5 | static_assert (bar (foo);
  |   ^
0x6527ab tree_contains_struct_check_failed(tree_node const*,
tree_node_structure_enum, char const*, int, char const*)
../../gcc/tree.c:9984
0x8a0193 contains_struct_check(tree_node*, tree_node_structure_enum, char
const*, int, char const*)
../../gcc/tree.h:3431
0x8a0193 unify
../../gcc/cp/pt.c:23473
0x89eb1c unify
../../gcc/cp/pt.c:23796
0x89dcbe unify
../../gcc/cp/pt.c:23563
0x8a03cf try_one_overload
../../gcc/cp/pt.c:22522
0x89b45a resolve_overloaded_unification
../../gcc/cp/pt.c:22286
0x89b45a unify_one_argument
../../gcc/cp/pt.c:21832
0x8bb1b4 type_unification_real
../../gcc/cp/pt.c:21976
0x8d1300 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.c:21345
0x6a1332 add_template_candidate_real
../../gcc/cp/call.c:3431
0x6a2014 add_template_candidate
../../gcc/cp/call.c:3519
0x6a2014 add_candidates
../../gcc/cp/call.c:5929
0x6a7e0b add_candidates
../../gcc/cp/call.c:4553
0x6a7e0b perform_overload_resolution
../../gcc/cp/call.c:4561
0x6afef2 build_new_function_call(tree_node*, vec**, int)
../../gcc/cp/call.c:4635
0x8fbdec finish_call_expr(tree_node*, vec**, bool,
bool, int)
../../gcc/cp/semantics.c:2703
0x846165 cp_parser_postfix_expression
../../gcc/cp/parser.c:7556
0x850915 cp_parser_unary_expression
../../gcc/cp/parser.c:8659
0x820faf cp_parser_cast_expression
../../gcc/cp/parser.c:9562

[Bug c/97992] ICE in subst_asm_stack_regs, at reg-stack.c:2264

2020-12-01 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97992

--- Comment #2 from G. Steinmetz  ---

Presumably related :


$ cat z2.c
long double
f (long double x)
{
  asm ("fsqrt" :: ""(x));
  return 1.0 - x;
}


$ cat z5.c
double
foo (double a)
{
  for (int i=0; i<4; i++)
  {
asm ("mov %1" : "=&t"(a) : ""(a));
  }
  return a;
}


$ gcc-11-20201129 -c z2.c -O2
during RTL pass: stack
z2.c: In function 'f':
z2.c:6:1: internal compiler error: in change_stack, at reg-stack.c:2646
6 | }
  | ^
0xac4218 change_stack
../../gcc/reg-stack.c:2646
0xac44ec subst_asm_stack_regs
../../gcc/reg-stack.c:2254
0xac655d subst_stack_regs
../../gcc/reg-stack.c:2425
0xac68d7 convert_regs_1
../../gcc/reg-stack.c:3080
0xac68d7 convert_regs_2
../../gcc/reg-stack.c:3214
0xac7a8d convert_regs
../../gcc/reg-stack.c:3249
0xac7a8d reg_to_stack
../../gcc/reg-stack.c:3374
0xac7a8d rest_of_handle_stack_regs
../../gcc/reg-stack.c:3429
0xac7a8d execute
../../gcc/reg-stack.c:3460

[Bug c/98086] New: [9/10/11 Regression] ICE in extract_insn, at recog.c:2315

2020-12-01 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98086

Bug ID: 98086
   Summary: [9/10/11 Regression] ICE in extract_insn, at
recog.c:2315
   Product: gcc
   Version: 11.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 :


$ cat z1.c
struct S {
  int a, b, c, d;
} x;
void f ()
{
  asm ("" : "=@ccc"(x));
}


$ gcc-5 -c z1.c
z1.c: In function 'f':
z1.c:6:3: error: inconsistent operand constraints in an 'asm'
   asm ("" : "=@ccc"(x));
   ^
$
$ gcc-11-20201129 -c z1.c
z1.c: In function 'f':
z1.c:7:1: error: unrecognizable insn:
7 | }
  | ^
(insn 7 6 5 2 (set (reg:TI 82)
(zero_extend:TI (reg:QI 83))) "z1.c":6:3 -1
 (nil))
during RTL pass: vregs
z1.c:7:1: internal compiler error: in extract_insn, at recog.c:2315
0x5f2645 _fatal_insn(char const*, rtx_def const*, char const*, int, char
const*)
../../gcc/rtl-error.c:108
0x5f2664 _fatal_insn_not_found(rtx_def const*, char const*, int, char const*)
../../gcc/rtl-error.c:116
0xabf2b7 extract_insn(rtx_insn*)
../../gcc/recog.c:2315
0x89cc63 instantiate_virtual_regs_in_insn
../../gcc/function.c:1609
0x89cc63 instantiate_virtual_regs
../../gcc/function.c:1979
0x89cc63 execute
../../gcc/function.c:2028

[Bug c/98087] New: [11 Regression] ICE: Floating point exception

2020-12-01 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98087

Bug ID: 98087
   Summary: [11 Regression] ICE: Floating point exception
   Product: gcc
   Version: 11.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 20201115 and 20201122 :


$ cat z1.c
struct S {};
void foo (int n)
{
  struct S a[n][0];
  __builtin_clear_padding (a);
}


$ gcc-11-20201129 -c z1.c
during GIMPLE pass: lower
z1.c: In function 'foo':
z1.c:2:6: internal compiler error: Floating point exception
2 | void foo (int n)
  |  ^~~
0xb49eaf crash_signal
../../gcc/toplev.c:330
0x8b9ff1 clear_padding_type
../../gcc/gimple-fold.c:4555
0x8ba973 gimple_fold_builtin_clear_padding
../../gcc/gimple-fold.c:4723
0x8c4c5f gimple_fold_builtin
../../gcc/gimple-fold.c:4897
0x8c6f6b gimple_fold_call
../../gcc/gimple-fold.c:5328
0x8c6f6b fold_stmt_1
../../gcc/gimple-fold.c:6029
0x13bfee9 lower_stmt
../../gcc/gimple-low.c:388
0x13bfee9 lower_sequence
../../gcc/gimple-low.c:217
0x13bffcc lower_stmt
../../gcc/gimple-low.c:286
0x13bffcc lower_sequence
../../gcc/gimple-low.c:217
0x13bfd58 lower_gimple_bind
../../gcc/gimple-low.c:473
0x13c0a91 lower_function_body
../../gcc/gimple-low.c:110
0x13c0a91 execute
../../gcc/gimple-low.c:195

[Bug c/98088] New: [9/10/11 Regression] ICE in expand_oacc_collapse_init, at omp-expand.c:1533

2020-12-01 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98088

Bug ID: 98088
   Summary: [9/10/11 Regression] ICE in expand_oacc_collapse_init,
at omp-expand.c:1533
   Product: gcc
   Version: 11.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.c
void f ()
{
  #pragma acc parallel loop tile(2, 3)
  for (int i = 0; i > 8; i++)
for (int j = 0; j > 8; j++);
}


$ cat z2.c
void f ()
{
  #pragma acc parallel loop tile(2, 3)
  for (int i = 0; i > 8; i++)
for (long j = 0; j > 8; j++);
}


$ gcc-6 -c z1.c -fopenmp -fopenacc
$
$ gcc-11-20201129 -c z1.c -fopenmp -fopenacc
during GIMPLE pass: ompexp
z1.c: In function 'f':
z1.c:3:11: internal compiler error: in expand_oacc_collapse_init, at
omp-expand.c:1533
3 |   #pragma acc parallel loop tile(2, 3)
  |   ^~~
0x1479f31 expand_oacc_collapse_init
../../gcc/omp-expand.c:1533
0x1479f31 expand_oacc_for
../../gcc/omp-expand.c:7537
0x148f361 expand_omp_for
../../gcc/omp-expand.c:8011
0x148fd5a expand_omp
../../gcc/omp-expand.c:9901
0x149008e expand_omp
../../gcc/omp-expand.c:9887
0x1491bed execute_expand_omp
../../gcc/omp-expand.c:10133

[Bug c/98089] New: ICE in build_outer_var_ref, at omp-low.c:725

2020-12-01 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98089

Bug ID: 98089
   Summary: ICE in build_outer_var_ref, at omp-low.c:725
   Product: gcc
   Version: 11.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 :


$ cat z1.c
void f (int n)
{
#pragma omp for linear(n:1)
  for (int i = 0; i < 8; i++)
n++;
}


$ gcc-11-20201129 -c z1.c -fopenmp
during GIMPLE pass: omplower
z1.c: In function 'f':
z1.c:3:9: internal compiler error: in build_outer_var_ref, at omp-low.c:725
3 | #pragma omp for linear(n:1)
  | ^~~
0xa257de build_outer_var_ref
../../gcc/omp-low.c:725
0xa33b37 lower_rec_input_clauses
../../gcc/omp-low.c:5777
0xa3cf6d lower_omp_for
../../gcc/omp-low.c:10917
0xa2bf3e lower_omp_1
../../gcc/omp-low.c:13231
0xa2bf3e lower_omp
../../gcc/omp-low.c:13418
0xa2acad lower_omp_1
../../gcc/omp-low.c:13215
0xa2acad lower_omp
../../gcc/omp-low.c:13418
0xa2acad lower_omp_1
../../gcc/omp-low.c:13215
0xa2acad lower_omp
../../gcc/omp-low.c:13418
0xa327d3 execute_lower_omp
../../gcc/omp-low.c:13457
0xa327d3 execute
../../gcc/omp-low.c:13505

[Bug c/98090] New: ICE in simd_clone_adjust_argument_types, at omp-simd-clone.c:591

2020-12-01 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98090

Bug ID: 98090
   Summary: ICE in simd_clone_adjust_argument_types, at
omp-simd-clone.c:591
   Product: gcc
   Version: 11.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.c
void f ();
#pragma omp declare simd
void f ()
{
  void f (int a);
}


$ gcc-11-20201129 -c z1.c -fopenmp
during IPA pass: simdclone
z1.c: In function 'f.simdclone.0':
z1.c:6:1: internal compiler error: Segmentation fault
6 | }
  | ^
0xb49eaf crash_signal
../../gcc/toplev.c:330
0x1495435 simd_clone_adjust_argument_types
../../gcc/omp-simd-clone.c:591
0x14959b7 simd_clone_adjust
../../gcc/omp-simd-clone.c:1200
0x149960e expand_simd_clones(cgraph_node*)
../../gcc/omp-simd-clone.c:1777
0x1499b07 ipa_omp_simd_clone
../../gcc/omp-simd-clone.c:1798
0x1499b07 execute
../../gcc/omp-simd-clone.c:1826

[Bug inline-asm/69899] gcc ICE on invalid code on x86_64-linux-gnu in "replace_reg"

2020-12-02 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69899

G. Steinmetz  changed:

   What|Removed |Added

 CC||gs...@t-online.de

--- Comment #4 from G. Steinmetz  ---

None of the above test cases gives an ICE on x86_64-pc-linux-gnu,
even when gcc-11 is configured with --enable-checking=yes.

[Bug c/98099] New: ICE in gen_lowpart_common, at emit-rtl.c:1554

2020-12-02 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98099

Bug ID: 98099
   Summary: ICE in gen_lowpart_common, at emit-rtl.c:1554
   Product: gcc
   Version: 11.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 r6 :


$ cat z1.c
struct S { _Decimal128 a; };

_Decimal128 f (struct S x)
{
  return x.a;
}


$ gcc-11-20201129 -c z1.c -m32 -fsso-struct=big-endian
during RTL pass: expand
z1.c: In function 'f':
z1.c:5:11: internal compiler error: Segmentation fault
5 |   return x.a;
  |  ~^~
0xb49eaf crash_signal
../../gcc/toplev.c:330
0x825a2f gen_lowpart_common(machine_mode, rtx_def*)
../../gcc/emit-rtl.c:1554
0xafa9ec gen_lowpart_general(machine_mode, rtx_def*)
../../gcc/rtlhooks.c:48
0x83ef31 extract_bit_field_1
../../gcc/expmed.c:1826
0x83f7ff extract_bit_field(rtx_def*, poly_int<1u, unsigned long>, poly_int<1u,
unsigned long>, int, rtx_def*, machine_mode, machine_mode, bool, rtx_def**)
../../gcc/expmed.c:2119
0x84e8ca expand_expr_real_1(tree_node*, rtx_def*, machine_mode,
expand_modifier, rtx_def**, bool)
../../gcc/expr.c:3
0x859e43 store_expr(tree_node*, rtx_def*, int, bool, bool)
../../gcc/expr.c:5859
0x85b206 expand_assignment(tree_node*, tree_node*, bool)
../../gcc/expr.c:5595
0x750c10 expand_gimple_stmt_1
../../gcc/cfgexpand.c:3901
0x750c10 expand_gimple_stmt
../../gcc/cfgexpand.c:3999
0x755e07 expand_gimple_basic_block
../../gcc/cfgexpand.c:6040
0x758476 execute
../../gcc/cfgexpand.c:6724

[Bug c/98100] New: ICE in expand_debug_locations, at cfgexpand.c:5610

2020-12-02 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98100

Bug ID: 98100
   Summary: ICE in expand_debug_locations, at cfgexpand.c:5610
   Product: gcc
   Version: 11.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 r7 :


$ cat z1.c
__attribute__((target_clones("default","sse2")))
void f ()
{
  __attribute__((__vector_size__(4 * sizeof(float int b = {};
}


$ gcc-11-20201129 -c z1.c -O2 -mgeneral-regs-only -fvar-tracking-assignments
during RTL pass: expand
z1.c: In function 'f.sse2.0':
z1.c:2:6: internal compiler error: in expand_debug_locations, at
cfgexpand.c:5610
2 | void f ()
  |  ^
0x759573 expand_debug_locations
../../gcc/cfgexpand.c:5606
0x759573 execute
../../gcc/cfgexpand.c:6727

[Bug c++/98101] New: ICE in mark_reachable_handlers, at tree-eh.c:4033

2020-12-02 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98101

Bug ID: 98101
   Summary: ICE in mark_reachable_handlers, at tree-eh.c:4033
   Product: gcc
   Version: 11.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, only at -O0 :
(used options affect also several testsuite files)
(under the hood maybe related to pr59507/pr88640)


$ cat z1.cc
struct A { virtual ~A(); };
struct B { A a[1]; } b;


$ g++-11-20201129 -c z1.cc -fnon-call-exceptions -fvtable-verify=std -O2
$
$ g++-11-20201129 -c z1.cc -fnon-call-exceptions -fvtable-verify=std
during GIMPLE pass: ehcleanup
z1.cc: In destructor 'B::~B()':
z1.cc:2:8: internal compiler error: in mark_reachable_handlers, at
tree-eh.c:4033
2 | struct B { A a[1]; } b;
  |^
0xcd644d mark_reachable_handlers
../../gcc/tree-eh.c:4033
0xcd6482 remove_unreachable_handlers
../../gcc/tree-eh.c:4080
0xcda601 execute_cleanup_eh_1
../../gcc/tree-eh.c:4783
0xcda601 execute
../../gcc/tree-eh.c:4850

---

z1.cc: In destructor 'B::~B()':
z1.cc:2:8: error: statement marked for throw in middle of block
2 | struct B { A a[1]; } b;
  |^
# VUSE <.MEM_7>
_13 = _12->_vptr.A;
during GIMPLE pass: vtable-verify
z1.cc:2:8: internal compiler error: verify_gimple failed
0xfcaaf4 verify_gimple_in_cfg(function*, bool)
../../gcc/tree-cfg.c:5467
0xe867ee execute_function_todo
../../gcc/passes.c:2039
0xe87692 execute_todo
../../gcc/passes.c:2093

[Bug c++/98102] New: [9/10/11 Regression] ICE tree check: expected block, have function_decl in change_scope, at final.c:1480

2020-12-02 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98102

Bug ID: 98102
   Summary: [9/10/11 Regression] ICE tree check: expected block,
have function_decl in change_scope, at final.c:1480
   Product: gcc
   Version: 11.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gs...@t-online.de
  Target Milestone: ---

This combination of options affects several files
from gcc/testsuite at -O2+, and goes back to r7 :


$ g++-6 -c pr61654.C -g -O2 -fvtable-verify=std -fopenacc
$ g++-11-20201129 -c pr61654.C -g -O1 -fvtable-verify=std -fopenacc
$
$ g++-11-20201129 -c pr61654.C -g -O2 -fvtable-verify=std -fopenacc
during RTL pass: final
pr61654.C: In function '(static initializers for pr61654.C)':
pr61654.C:17:12: internal compiler error: tree check: expected block, have
function_decl in change_scope, at final.c:1480
   17 |   return a ('\0');
  |  ~~^~
0x64cac4 tree_check_failed(tree_node const*, char const*, int, char const*,
...)
../../gcc/tree.c:9810
0xbc4b19 tree_check(tree_node*, char const*, int, char const*, tree_code)
../../gcc/tree.h:3331
0xbc4b19 change_scope
../../gcc/final.c:1480
0xbce0c0 reemit_insn_block_notes
../../gcc/final.c:1581
0xbce0c0 final_start_function_1
../../gcc/final.c:1784
0xbce609 rest_of_handle_final
../../gcc/final.c:4675
0xbce609 execute
../../gcc/final.c:4754

[Bug c++/98103] New: [10/11 Regression] ICE tree check: expected tree that contains 'decl minimal' structure, have 'integer_cst' in cxx_eval_dynamic_cast_fn, at cp/constexpr.c:2003

2020-12-02 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98103

Bug ID: 98103
   Summary: [10/11 Regression] ICE tree check: expected tree that
contains 'decl minimal' structure, have 'integer_cst'
in cxx_eval_dynamic_cast_fn, at cp/constexpr.c:2003
   Product: gcc
   Version: 11.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gs...@t-online.de
  Target Milestone: ---

Using testfile gcc/testsuite/g++.dg/cpp2a/constexpr-dynamic17.C
This changed between 20191215 and 20200105 :


$ g++-11-20201129 -c constexpr-dynamic17.C -std=gnu++2a -fsanitize=vptr
constexpr-dynamic17.C:20:13:   in 'constexpr' expansion of '((D*)(&
d))->D::D()'
constexpr-dynamic17.C:12:35:   in 'constexpr' expansion of
'((D*)this)->D::.B::B((&(&((D*)this)->D::)->A::),
(&((D*)this)->D::))'
constexpr-dynamic17.C:20:13: internal compiler error: tree check: expected tree
that contains 'decl minimal' structure, have 'integer_cst' in
cxx_eval_dynamic_cast_fn, at cp/constexpr.c:2003
   20 | constexpr D d;
  | ^
0x64d1b5 tree_contains_struct_check_failed(tree_node const*,
tree_node_structure_enum, char const*, int, char const*)
../../gcc/tree.c:9984
0x6ebbe3 contains_struct_check(tree_node*, tree_node_structure_enum, char
const*, int, char const*)
../../gcc/tree.h:3445
0x6ebbe3 cxx_eval_dynamic_cast_fn
../../gcc/cp/constexpr.c:2003
0x6ebbe3 cxx_eval_call_expression
../../gcc/cp/constexpr.c:2421
0x6eec61 cxx_eval_constant_expression
../../gcc/cp/constexpr.c:5866
0x6ed3de cxx_eval_constant_expression
../../gcc/cp/constexpr.c:6358
0x6ed3de cxx_eval_constant_expression
../../gcc/cp/constexpr.c:6358
0x6eeb2a cxx_eval_constant_expression
../../gcc/cp/constexpr.c:6305
0x6ed39a cxx_eval_constant_expression
../../gcc/cp/constexpr.c:6176
0x6eebda cxx_eval_constant_expression
../../gcc/cp/constexpr.c:6044
0x6ee1ee cxx_eval_statement_list
../../gcc/cp/constexpr.c:5436
0x6ee1ee cxx_eval_constant_expression
../../gcc/cp/constexpr.c:6502
0x6eea4e cxx_eval_constant_expression
../../gcc/cp/constexpr.c:6537
0x6ee1ee cxx_eval_statement_list
../../gcc/cp/constexpr.c:5436
0x6ee1ee cxx_eval_constant_expression
../../gcc/cp/constexpr.c:6502
0x6eb576 cxx_eval_call_expression
../../gcc/cp/constexpr.c:2687
0x6eec61 cxx_eval_constant_expression
../../gcc/cp/constexpr.c:5866
0x6ed39a cxx_eval_constant_expression
../../gcc/cp/constexpr.c:6176
0x6eebda cxx_eval_constant_expression
../../gcc/cp/constexpr.c:6044
0x6ee1ee cxx_eval_statement_list
../../gcc/cp/constexpr.c:5436

[Bug c/98183] New: [9/10/11 Regression] ICE in expand_gimple_stmt_1, at cfgexpand.c:3972

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

Bug ID: 98183
   Summary: [9/10/11 Regression] ICE in expand_gimple_stmt_1, at
cfgexpand.c:3972
   Product: gcc
   Version: 11.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gs...@t-online.de
  Target Milestone: ---

Using testfile gcc/testsuite/c-c++-common/goacc/host_data-1.c
at -O0 affects versions down to gcc-6 (accepted by gcc-5) :


$ gcc-5   -c host_data-1.c -fopenacc -fexceptions -O0
$ gcc-11-20201206 -c host_data-1.c -fopenacc -fexceptions -O1
$
$ gcc-11-20201206 -c host_data-1.c -fopenacc -fexceptions -O0
during RTL pass: expand
host_data-1.c: In function 'foo':
host_data-1.c:25:1: internal compiler error: in expand_gimple_stmt_1, at
cfgexpand.c:3972
   25 | foo (float *x, float *y, float *yy)
  | ^~~
0x75312c expand_gimple_stmt_1
../../gcc/cfgexpand.c:3972
0x75312c expand_gimple_stmt
../../gcc/cfgexpand.c:3999
0x758257 expand_gimple_basic_block
../../gcc/cfgexpand.c:6043
0x75a8ee execute
../../gcc/cfgexpand.c:6727

[Bug c/98184] New: ICE in purge_dead_edges, at cfgrtl.c:3297

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

Bug ID: 98184
   Summary: ICE in purge_dead_edges, at cfgrtl.c:3297
   Product: gcc
   Version: 11.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 r8 :


$ cat z1.c
__attribute__((naked)) void f ();
__attribute__((naked)) void g (int x)
{
  __builtin_unwind_init ();
  __builtin_eh_return (x, f);
}


$ gcc-11-20201206 -c z1.c
$
$ gcc-11-20201206 -c z1.c -fsplit-stack
during RTL pass: pro_and_epilogue
z1.c: In function 'g':
z1.c:6:1: internal compiler error: in purge_dead_edges, at cfgrtl.c:3297
6 | }
  | ^
0x771f55 purge_dead_edges(basic_block_def*)
../../gcc/cfgrtl.c:3297
0x13780e7 find_bb_boundaries
../../gcc/cfgbuild.c:589
0x13780e7 find_many_sub_basic_blocks(simple_bitmap_def*)
../../gcc/cfgbuild.c:672
0x8a8a12 thread_prologue_and_epilogue_insns()
../../gcc/function.c:6150
0x8a8c02 rest_of_handle_thread_prologue_and_epilogue
../../gcc/function.c:6506
0x8a8c02 execute
../../gcc/function.c:6582

---

No extra option needed when configured with --enable-checking=yes :

$ gcc-11-20201206 -c z1.c
z1.c: In function 'g':
z1.c:6:1: error: too many outgoing branch edges from bb 2
6 | }
  | ^
during RTL pass: pro_and_epilogue
z1.c:6:1: internal compiler error: verify_flow_info failed
0x820884 verify_flow_info()
../../gcc/cfghooks.c:269
0x83f453 checking_verify_flow_info
../../gcc/cfghooks.h:212
0x83f453 commit_edge_insertions()
../../gcc/cfgrtl.c:2115
0x9cd289 thread_prologue_and_epilogue_insns()
../../gcc/function.c:6132
0x9cd342 rest_of_handle_thread_prologue_and_epilogue
../../gcc/function.c:6506
0x9cd342 execute
../../gcc/function.c:6582

[Bug c++/98185] New: [9/10/11 Regression] ICE in cp_genericize_r, at cp/cp-gimplify.c:1240

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

Bug ID: 98185
   Summary: [9/10/11 Regression] ICE in cp_genericize_r, at
cp/cp-gimplify.c:1240
   Product: gcc
   Version: 11.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gs...@t-online.de
  Target Milestone: ---

Using testfile gcc/testsuite/c-c++-common/gomp/master-combined-1.c
Affects g++ versions down to r9 (gcc-11 accepts it) :


$ g++-8   -c master-combined-1.c -fopenmp-simd
$ g++-11-20201206 -c master-combined-1.c -fopenmp
$
$ g++-11-20201206 -c master-combined-1.c -fopenmp-simd
master-combined-1.c: In function 'void foo(int*)':
master-combined-1.c:31:1: internal compiler error: tree check: expected
omp_clause, have  in cp_genericize_r, at
cp/cp-gimplify.c:1240
   31 | }
  | ^
0x64d58a tree_check_failed(tree_node const*, char const*, int, char const*,
...)
../../gcc/tree.c:9810
0x726b75 tree_check(tree_node*, char const*, int, char const*, tree_code)
../../gcc/tree.h:3335
0x726b75 cp_genericize_r
../../gcc/cp/cp-gimplify.c:1240
0x12ccfb3 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.c:12095
0x724b6d cp_genericize_r
../../gcc/cp/cp-gimplify.c:1474
0x12ccfb3 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.c:12095
0x726115 cp_genericize_r
../../gcc/cp/cp-gimplify.c:1166
0x12ccfb3 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.c:12095
0x723468 cp_genericize_tree
../../gcc/cp/cp-gimplify.c:1592
0x7236e6 cp_genericize(tree_node*)
../../gcc/cp/cp-gimplify.c:1738
0x779627 finish_function(bool)
../../gcc/cp/decl.c:17268
0x856e5e cp_parser_function_definition_after_declarator
../../gcc/cp/parser.c:29546
0x858015 cp_parser_function_definition_from_specifiers_and_declarator
../../gcc/cp/parser.c:29459
0x858015 cp_parser_init_declarator
../../gcc/cp/parser.c:21175
0x832f4a cp_parser_simple_declaration
../../gcc/cp/parser.c:13995
0x8609e2 cp_parser_declaration
../../gcc/cp/parser.c:13692
0x8613c8 cp_parser_translation_unit
../../gcc/cp/parser.c:4806
0x8613c8 c_parse_file()
../../gcc/cp/parser.c:44681
0x9d7862 c_common_parse_file()
../../gcc/c-family/c-opts.c:1211

[Bug c++/98186] New: [9/10/11 Regression] ICE tree check: expected omp_clause, have bit_cast_expr in tsubst_omp_clauses, at cp/pt.c:17246

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

Bug ID: 98186
   Summary: [9/10/11 Regression] ICE tree check: expected
omp_clause, have bit_cast_expr in tsubst_omp_clauses,
at cp/pt.c:17246
   Product: gcc
   Version: 11.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gs...@t-online.de
  Target Milestone: ---

Using testfiles pr94477.C or pr94512.C with option -O0
affects versions down to r9 :


$ g++-8   -c pr94477.C -fopenmp-simd -O0
$ g++-11-20201206 -c pr94477.C -fopenmp-simd -O2
$
$ g++-11-20201206 -c pr94477.C -fopenmp-simd -O0
during GIMPLE pass: ompexp
pr94477.C: In function 'void bar() [with int  = 0]':
pr94477.C:6:30: internal compiler error: Segmentation fault
6 |   #pragma omp parallel master
  |  ^
0xc8881f crash_signal
../../gcc/toplev.c:327
0xefa77e build_call_expr_loc_array(unsigned int, tree_node*, int, tree_node**)
../../gcc/tree.c:11554
0x15d8f9e expand_parallel_call
../../gcc/omp-expand.c:732
0x15d8f9e expand_omp_taskreg
../../gcc/omp-expand.c:1485
0x15defbf expand_omp_synch
../../gcc/omp-expand.c:8453
0x15defbf expand_omp
../../gcc/omp-expand.c:9937
0x15e10ed execute_expand_omp
../../gcc/omp-expand.c:10133

---

pr94477.C: In instantiation of 'void bar() [with int  = 0]':
pr94477.C:12:11:   required from here
pr94477.C:6:30: internal compiler error: tree check: expected omp_clause, have
bit_cast_expr in tsubst_omp_clauses, at cp/pt.c:17246
6 |   #pragma omp parallel master
  |  ^
0x64d58a tree_check_failed(tree_node const*, char const*, int, char const*,
...)
../../gcc/tree.c:9810
0x8c05e7 tree_check(tree_node*, char const*, int, char const*, tree_code)
../../gcc/tree.h:3335
0x8c05e7 tsubst_omp_clauses
../../gcc/cp/pt.c:17246
0x8b19b6 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
../../gcc/cp/pt.c:18536
0x8b1957 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
../../gcc/cp/pt.c:18022
0x8b32ff tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
../../gcc/cp/pt.c:18346
0x897ea5 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
../../gcc/cp/pt.c:18007
0x897ea5 instantiate_body
../../gcc/cp/pt.c:25665
0x89976f instantiate_decl(tree_node*, bool, bool)
../../gcc/cp/pt.c:25954
0x8da3fb instantiate_pending_templates(int)
../../gcc/cp/pt.c:26033
0x79441c c_parse_final_cleanups()
../../gcc/cp/decl2.c:4904

[Bug c++/98187] New: ICE in build_call_expr_loc_array, at tree.c:11554

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

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

Using testfile c-c++-common/gomp/lastprivate-conditional-1.c
with option -fopenmp-simd and versions r10/r11 :


$ g++-11-20201206 -c lastprivate-conditional-1.c -fopenmp-simd
during GIMPLE pass: ompexp
lastprivate-conditional-1.c: In function 'void foo(int*)':
lastprivate-conditional-1.c:41:11: internal compiler error: Segmentation fault
   41 |   #pragma omp parallel master taskloop simd lastprivate (conditional:
h)
  |   ^~~
0xf7ce3f crash_signal
../../gcc/toplev.c:327
0x12ae048 contains_struct_check(tree_node*, tree_node_structure_enum, char
const*, int, char const*)
../../gcc/tree.h:3448
0x12ae048 build_call_expr_loc_array(unsigned int, tree_node*, int, tree_node**)
../../gcc/tree.c:11554
0x1ad57e8 expand_parallel_call
../../gcc/omp-expand.c:732
0x1ad65e6 expand_omp_taskreg
../../gcc/omp-expand.c:1485
0x1adefcf expand_omp_synch
../../gcc/omp-expand.c:8453
0x1adefcf expand_omp
../../gcc/omp-expand.c:9937
0x1ae128d execute_expand_omp
../../gcc/omp-expand.c:10133

[Bug c++/98185] [9/10/11 Regression] ICE in cp_genericize_r, at cp/cp-gimplify.c:1240

2020-12-08 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98185

--- Comment #2 from G. Steinmetz  ---

Hmm, trying to provide some reductions along different paths :
(iff there is no g++/gcc ICE, this PR can be closed then)
(will eventually retry with some future snapshots)


$ cat z1.C
void
foo (int *a)
{
  #pragma omp parallel master default(none) private (k)
}


$ cat z2.C
void
foo (int *a)
{
  int i, j, k, u = 0, v = 0, w = 0, x = 0, y = 0, z = 0;
 z += a[i];
  #pragma omp parallel master taskloop reduction (+:u) default(none)
firstprivate(a)
}


$ cat z3.C
void bar (int *);
void
foo (int *a)
{
  int i, j, k, u = 0, v = 0, w = 0, x = 0, y = 0, z = 0;
  {
 z += a[i];
  }
  #pragma omp parallel master taskloop reduction (+:u) default(none)
firstprivate(a)
}


$ cat z4.C
void
foo (int *a)
{
  int i, j, k, u = 0, v = 0, w = 0, x = 0, y = 0, z = 0;
  {
for (i = 0; i < 64; i++)
  for (i = 0; i < 64; ++i)
 z += a[i];
  }
  #pragma omp parallel master taskloop reduction (+:u) default(none)
firstprivate(a)
}


Yields :

z1.C:5:1: internal compiler error: Segmentation fault, in cp_genericize_r at
cp/cp-gimplify.c:1240
z1.C:5:1: internal compiler error: tree check: expected omp_clause, have
 in cp_genericize_r, at cp/cp-gimplify.c:1240
z2.C:7:1: internal compiler error: Segmentation fault, in cp_fold at
cp/cp-gimplify.c:2223
z3.C:9:85: internal compiler error: in gimplify_scan_omp_clauses, at
gimplify.c:9983
z3.C:10:1: internal compiler error: tree check: expected omp_clause, have
 in cp_genericize_r, at cp/cp-gimplify.c:1240
z4.C:11:1: internal compiler error: in tsi_link_after, at tree-iterator.c:193

[Bug c++/98193] New: [11 Regression] ICE in native_encode_initializer, at fold-const.c:8454/8424

2020-12-08 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98193

Bug ID: 98193
   Summary: [11 Regression] ICE in native_encode_initializer, at
fold-const.c:8454/8424
   Product: gcc
   Version: 11.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gs...@t-online.de
  Target Milestone: ---

Following two variants are derived from testfile bit-cast3.C (new).
Not really a regression, but with the latest snapshot (20201206) :


$ cat z1.C
template 
constexpr To
bit_cast (const From &from)
{
  return __builtin_bit_cast (To, from);
}
struct J
{
  long int a, b : 11, h;
};
struct K
{
  long int a, b, c;
  constexpr bool operator == (K x)
  {
return x.a;
  }
};
static_assert (bit_cast  (J{}) == K{}, "");


$ g++-11-20201206 -c z1.C
z1.C:19:33:   in 'constexpr' expansion of 'bit_cast(J{})'
z1.C:19:46: internal compiler error: in native_encode_initializer, at
fold-const.c:8454
   19 | static_assert (bit_cast  (J{}) == K{}, "");
  |  ^
0x9b3baa native_encode_initializer(tree_node*, unsigned char*, int, int,
unsigned char*)
../../gcc/fold-const.c:8454
0x6819e8 cxx_eval_bit_cast
../../gcc/cp/constexpr.c:4105
0x6819e8 cxx_eval_constant_expression
../../gcc/cp/constexpr.c:6894
0x686678 cxx_eval_store_expression
../../gcc/cp/constexpr.c:5397
0x67f47a cxx_eval_constant_expression
../../gcc/cp/constexpr.c:6217
0x67e8dd cxx_eval_constant_expression
../../gcc/cp/constexpr.c:6229
0x67ef8e cxx_eval_constant_expression
../../gcc/cp/constexpr.c:6286
0x67db44 cxx_eval_call_expression
../../gcc/cp/constexpr.c:2692
0x67f20a cxx_eval_constant_expression
../../gcc/cp/constexpr.c:6108
0x68167d cxx_eval_constant_expression
../../gcc/cp/constexpr.c:6196
0x67edb5 cxx_eval_constant_expression
../../gcc/cp/constexpr.c:6335
0x67c4f7 cxx_bind_parameters_in_call
../../gcc/cp/constexpr.c:1594
0x67c4f7 cxx_eval_call_expression
../../gcc/cp/constexpr.c:2524
0x67f20a cxx_eval_constant_expression
../../gcc/cp/constexpr.c:6108
0x68215b cxx_eval_outermost_constant_expr
../../gcc/cp/constexpr.c:7117
0x684ddc maybe_constant_value(tree_node*, tree_node*, bool)
../../gcc/cp/constexpr.c:7372
0x7a06cd finish_static_assert(tree_node*, tree_node*, unsigned int, bool, bool)
../../gcc/cp/semantics.c:9918
0x726de4 cp_parser_static_assert
../../gcc/cp/parser.c:14992
0x75846a cp_parser_declaration
../../gcc/cp/parser.c:13692
0x758d5a cp_parser_translation_unit
../../gcc/cp/parser.c:4806

[Bug c++/98193] [11 Regression] ICE in native_encode_initializer, at fold-const.c:8454/8424

2020-12-08 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98193

G. Steinmetz  changed:

   What|Removed |Added

 Target||x86_64-pc-linux-gnu

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

$ cat z2.C
template 
constexpr To
bit_cast (const From &from)
{
  return __builtin_bit_cast (To, from);
}
struct J
{
  long long int a, b : 11, h;
};
struct K
{
  long int a, b, c;
  constexpr bool operator == (K x)
  {
return x.a;
  }
};
static_assert (bit_cast  (J{0x0feedbacdeadbeefLL}) ==
K{0x0feedbacdeadbeefLL}, "");


$ g++-11-20201206 -c z2.C
z2.C:19:53:   in 'constexpr' expansion of 'bit_cast(J{1148096490542841583})'
z2.C:19:86: internal compiler error: in native_encode_initializer, at
fold-const.c:8424
   19 | static_assert (bit_cast  (J{0x0feedbacdeadbeefLL}) ==
K{0x0feedbacdeadbeefLL}, "");
  |
 ^
0x9b388c native_encode_initializer(tree_node*, unsigned char*, int, int,
unsigned char*)
../../gcc/fold-const.c:8424
0x6819e8 cxx_eval_bit_cast
../../gcc/cp/constexpr.c:4105
0x6819e8 cxx_eval_constant_expression
../../gcc/cp/constexpr.c:6894
0x686678 cxx_eval_store_expression
../../gcc/cp/constexpr.c:5397
0x67f47a cxx_eval_constant_expression
../../gcc/cp/constexpr.c:6217
0x67e8dd cxx_eval_constant_expression
../../gcc/cp/constexpr.c:6229
0x67ef8e cxx_eval_constant_expression
../../gcc/cp/constexpr.c:6286
0x67db44 cxx_eval_call_expression
../../gcc/cp/constexpr.c:2692
0x67f20a cxx_eval_constant_expression
../../gcc/cp/constexpr.c:6108
0x68167d cxx_eval_constant_expression
../../gcc/cp/constexpr.c:6196
0x67edb5 cxx_eval_constant_expression
../../gcc/cp/constexpr.c:6335
0x67c4f7 cxx_bind_parameters_in_call
../../gcc/cp/constexpr.c:1594
0x67c4f7 cxx_eval_call_expression
../../gcc/cp/constexpr.c:2524
0x67f20a cxx_eval_constant_expression
../../gcc/cp/constexpr.c:6108
0x68215b cxx_eval_outermost_constant_expr
../../gcc/cp/constexpr.c:7117
0x684ddc maybe_constant_value(tree_node*, tree_node*, bool)
../../gcc/cp/constexpr.c:7372
0x7a06cd finish_static_assert(tree_node*, tree_node*, unsigned int, bool, bool)
../../gcc/cp/semantics.c:9918
0x726de4 cp_parser_static_assert
../../gcc/cp/parser.c:14992
0x75846a cp_parser_declaration
../../gcc/cp/parser.c:13692
0x758d5a cp_parser_translation_unit
../../gcc/cp/parser.c:4806

[Bug fortran/98203] New: [11 Regression] ICE in gfc_trans_omp_do, at fortran/trans-openmp.c:4665

2020-12-08 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98203

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

Changed between 20200510 and 20200517 :


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


$ gfortran-11-20200510 -c z1.f90 -fopenmp
$
$ gfortran-11-20201206 -c z1.f90 -fopenmp
z1.f90:3:25:

3 |!$omp simd collapse(2)
  | 1
internal compiler error: in gfc_trans_omp_do, at fortran/trans-openmp.c:4665
0x7918c3 gfc_trans_omp_do
../../gcc/fortran/trans-openmp.c:4665
0x793b0f gfc_trans_omp_directive(gfc_code*)
../../gcc/fortran/trans-openmp.c:6104
0x729857 trans_code
../../gcc/fortran/trans.c:2163
0x74f8b4 gfc_generate_function_code(gfc_namespace*)
../../gcc/fortran/trans-decl.c:6880
0x6d6c66 translate_all_program_units
../../gcc/fortran/parse.c:6347
0x6d6c66 gfc_parse_file()
../../gcc/fortran/parse.c:6616
0x722aef gfc_be_parse_file
../../gcc/fortran/f95-lang.c:212

[Bug c/98204] New: ICE in pointer_diff, at c/c-typeck.c:3954

2020-12-08 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98204

Bug ID: 98204
   Summary: ICE in pointer_diff, at c/c-typeck.c:3954
   Product: gcc
   Version: 11.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gs...@t-online.de
  Target Milestone: ---

Following options produce an ICE for a bunch of testsuite files,
e.g. with file 920928-1.c (down to version r8) :


$ cat 920928-1.c
struct{int c;}v;
static long i=((char*)&(v.c)-(char*)&v);


$ gcc-11-20201206 -c 920928-1.c -fsanitize=address -fsanitize=pointer-subtract
920928-1.c:2:1: internal compiler error: in pointer_diff, at c/c-typeck.c:3954
2 | static long i=((char*)&(v.c)-(char*)&v);
  | ^~
0x65f8d2 pointer_diff
../../gcc/c/c-typeck.c:3954
0x65f8d2 build_binary_op(unsigned int, tree_code, tree_node*, tree_node*, bool)
../../gcc/c/c-typeck.c:11750
0x660364 parser_build_binary_op(unsigned int, tree_code, c_expr, c_expr)
../../gcc/c/c-typeck.c:3759
0x677460 c_parser_binary_expression
../../gcc/c/c-parser.c:8005
0x6780b5 c_parser_conditional_expression
../../gcc/c/c-parser.c:7598
0x678611 c_parser_expr_no_commas
../../gcc/c/c-parser.c:7513
0x678882 c_parser_expression
../../gcc/c/c-parser.c:10606
0x66c1cc c_parser_postfix_expression
../../gcc/c/c-parser.c:9092
0x675dc2 c_parser_unary_expression
../../gcc/c/c-parser.c:8230
0x676def c_parser_cast_expression
../../gcc/c/c-parser.c:8072
0x6770a9 c_parser_binary_expression
../../gcc/c/c-parser.c:7875
0x6780b5 c_parser_conditional_expression
../../gcc/c/c-parser.c:7598
0x678611 c_parser_expr_no_commas
../../gcc/c/c-parser.c:7513
0x67ea29 c_parser_initializer
../../gcc/c/c-parser.c:5206
0x68c98a c_parser_declaration_or_fndef
../../gcc/c/c-parser.c:2276
0x693fd7 c_parser_external_declaration
../../gcc/c/c-parser.c:1777
0x694af9 c_parser_translation_unit
../../gcc/c/c-parser.c:1650
0x694af9 c_parse_file()
../../gcc/c/c-parser.c:21877
0x6e4782 c_common_parse_file()
../../gcc/c-family/c-opts.c:1211

[Bug c/98205] New: ICE in expand_omp_for_generic, at omp-expand.c:4307

2020-12-08 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98205

Bug ID: 98205
   Summary: ICE in expand_omp_for_generic, at omp-expand.c:4307
   Product: gcc
   Version: 11.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 r6 :


$ cat z1.c
void f (int n)
{
  int i;
  #pragma omp for ordered(1)
  for (i = 0; i < 8; i += n)
for (;;);
}


$ gcc-11-20201206 -c z1.c -fopenmp
during GIMPLE pass: ompexp
z1.c: In function 'f':
z1.c:4:11: internal compiler error: Segmentation fault
4 |   #pragma omp for ordered(1)
  |   ^~~
0xd2670f crash_signal
../../gcc/toplev.c:327
0x1880c99 bb_seq_addr
../../gcc/gimple.h:1764
0x1880c99 gsi_last_bb
../../gcc/gimple-iterator.h:164
0x1880c99 expand_omp_for_generic
../../gcc/omp-expand.c:4307
0x18852c9 expand_omp_for
../../gcc/omp-expand.c:8107
0x188616a expand_omp
../../gcc/omp-expand.c:9901
0x188802d execute_expand_omp
../../gcc/omp-expand.c:10133

[Bug analyzer/98293] New: [11 Regression] ICE in get_subregion_within_ctor, at analyzer/store.cc:494

2020-12-15 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98293

Bug ID: 98293
   Summary: [11 Regression] ICE in get_subregion_within_ctor, at
analyzer/store.cc:494
   Product: gcc
   Version: 11.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: analyzer
  Assignee: dmalcolm at gcc dot gnu.org
  Reporter: gs...@t-online.de
  Target Milestone: ---

Following options produce an ICE for several testsuite files,
e.g. file pr93399.c (changed between 20201004 and 20201018) :


$ gcc-10  -c pr93399.c -fanalyzer -fsanitize=undefined
$
$ gcc-11-20201213 -c pr93399.c -fanalyzer -fsanitize=undefined
during IPA pass: analyzer
pr93399.c: In function 'main':
pr93399.c:14:18: internal compiler error: Segmentation fault
   14 |   char *substr = strstr (argv[0], "\n");
  |  ^~
0xb5028f crash_signal
../../gcc/toplev.c:327
0xe936f5 get_subregion_within_ctor
../../gcc/analyzer/store.cc:494
0xe98ef7 ana::binding_map::apply_ctor_pair_to_child_region(ana::region const*,
ana::region_model_manager*, tree_node*, tree_node*)
../../gcc/analyzer/store.cc:615
0xe99219 ana::binding_map::apply_ctor_to_region(ana::region const*, tree_node*,
ana::region_model_manager*)
../../gcc/analyzer/store.cc:549
0xe990f0 ana::binding_map::apply_ctor_pair_to_child_region(ana::region const*,
ana::region_model_manager*, tree_node*, tree_node*)
../../gcc/analyzer/store.cc:617
0xe99219 ana::binding_map::apply_ctor_to_region(ana::region const*, tree_node*,
ana::region_model_manager*)
../../gcc/analyzer/store.cc:549
0xe7361c ana::decl_region::get_svalue_for_constructor(tree_node*,
ana::region_model_manager*) const
../../gcc/analyzer/region.cc:931
0xe7372a
ana::decl_region::get_svalue_for_initializer(ana::region_model_manager*) const
../../gcc/analyzer/region.cc:973
0xe75812 ana::region_model::get_initial_value_for_global(ana::region const*)
const
../../gcc/analyzer/region-model.cc:1451
0xe8a4bc ana::reachable_regions::add(ana::region const*, bool)
../../gcc/analyzer/region-model-reachability.cc:137
0xe780c0 ana::region_model::handle_unrecognized_call(gcall const*,
ana::region_model_context*)
../../gcc/analyzer/region-model.cc:967
0xe78382 ana::region_model::on_call_post(gcall const*, bool,
ana::region_model_context*)
../../gcc/analyzer/region-model.cc:923
0xe5e3a4 ana::exploded_node::on_stmt(ana::exploded_graph&, ana::supernode
const*, gimple const*, ana::program_state*) const
../../gcc/analyzer/engine.cc:1210
0xe603ae ana::exploded_graph::process_node(ana::exploded_node*)
../../gcc/analyzer/engine.cc:2948
0xe60a52 ana::exploded_graph::process_worklist()
../../gcc/analyzer/engine.cc:2573
0xe629e2 ana::impl_run_checkers(ana::logger*)
../../gcc/analyzer/engine.cc:4738
0xe6427d ana::run_checkers()
../../gcc/analyzer/engine.cc:4809
0xe57828 execute
../../gcc/analyzer/analyzer-pass.cc:87

[Bug c/98294] New: [9/10/11 Regression] ICE in calculate_line_spans, at diagnostic-show-locus.c:1296

2020-12-15 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98294

Bug ID: 98294
   Summary: [9/10/11 Regression] ICE in calculate_line_spans, at
diagnostic-show-locus.c:1296
   Product: gcc
   Version: 11.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gs...@t-online.de
  Target Milestone: ---

Old stuff, affects versions down to r6 :


$ cat z1.c
void f ()
{
  #line 9223372036854775807
  g ()
  + 1;
}


$ gcc-11-20201213 -c z1.c -Wall
z1.c: In function 'f':
z1.c:3:9: warning: line number out of range
3 |   #line 9223372036854775807
  | ^~~
z1.c:-1:3: warning: implicit declaration of function 'g'
[-Wimplicit-function-declaration]
z1.c: warning: value computed is not used [-Wunused-value]

z1.c: internal compiler error: in calculate_line_spans, at
diagnostic-show-locus.c:1296
0x1532394 calculate_line_spans
../../gcc/diagnostic-show-locus.c:1296
0x1532394 layout
../../gcc/diagnostic-show-locus.c:1003
0x1532572 diagnostic_show_locus(diagnostic_context*, rich_location*,
diagnostic_t)
../../gcc/diagnostic-show-locus.c:2601
0x6e2435 c_diagnostic_finalizer
../../gcc/c-family/c-opts.c:174
0x152d744 diagnostic_report_diagnostic(diagnostic_context*, diagnostic_info*)
../../gcc/diagnostic.c:1223
0x152de6e diagnostic_impl
../../gcc/diagnostic.c:1366
0x152e392 warning_at(unsigned int, int, char const*, ...)
../../gcc/diagnostic.c:1503
0x64ea89 c_process_expr_stmt(unsigned int, tree_node*)
../../gcc/c/c-typeck.c:11213
0x64eb8d c_finish_expr_stmt(unsigned int, tree_node*)
../../gcc/c/c-typeck.c:11243
0x689d18 c_parser_statement_after_labels
../../gcc/c/c-parser.c:6249
0x68bd0a c_parser_compound_statement_nostart
../../gcc/c/c-parser.c:5788
0x68c583 c_parser_compound_statement
../../gcc/c/c-parser.c:5597
0x68de38 c_parser_declaration_or_fndef
../../gcc/c/c-parser.c:2539
0x694ca7 c_parser_external_declaration
../../gcc/c/c-parser.c:1777
0x6957c9 c_parser_translation_unit
../../gcc/c/c-parser.c:1650
0x6957c9 c_parse_file()
../../gcc/c/c-parser.c:21929
0x6e5532 c_common_parse_file()
../../gcc/c-family/c-opts.c:1211

[Bug c++/98295] New: [9/10/11 Regression] ICE in verify_ctor_sanity, at cp/constexpr.c:4312

2020-12-15 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98295

Bug ID: 98295
   Summary: [9/10/11 Regression] ICE in verify_ctor_sanity, at
cp/constexpr.c:4312
   Product: gcc
   Version: 11.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 r7 :


$ cat z1.cc
struct A { constexpr A(); };
void f ()
{
  A b[2][3];
  [b] {};
}


$ g++-11-20201213 -c z1.cc
z1.cc: In function 'void f()':
z1.cc:5:3: internal compiler error: in verify_ctor_sanity, at
cp/constexpr.c:4312
5 |   [b] {};
  |   ^~
0x67c29d verify_ctor_sanity
../../gcc/cp/constexpr.c:4306
0x689c3c cxx_eval_bare_aggregate
../../gcc/cp/constexpr.c:4342
0x681259 cxx_eval_constant_expression
../../gcc/cp/constexpr.c:6574
0x682adc cxx_eval_array_reference
../../gcc/cp/constexpr.c:3763
0x682adc cxx_eval_constant_expression
../../gcc/cp/constexpr.c:6498
0x681041 cxx_eval_array_reference
../../gcc/cp/constexpr.c:3659
0x681041 cxx_eval_constant_expression
../../gcc/cp/constexpr.c:6498
0x6833cd cxx_eval_constant_expression
../../gcc/cp/constexpr.c:6205
0x68a33a cxx_eval_vec_init_1
../../gcc/cp/constexpr.c:4548
0x68a417 cxx_eval_vec_init_1
../../gcc/cp/constexpr.c:4524
0x681d76 cxx_eval_vec_init
../../gcc/cp/constexpr.c:4599
0x681d76 cxx_eval_constant_expression
../../gcc/cp/constexpr.c:6584
0x683eab cxx_eval_outermost_constant_expr
../../gcc/cp/constexpr.c:7126
0x686e7f maybe_constant_init_1
../../gcc/cp/constexpr.c:7578
0x7db5ce massage_init_elt
../../gcc/cp/typeck2.c:1309
0x7da80f process_init_constructor_record
../../gcc/cp/typeck2.c:1528
0x7da80f process_init_constructor
../../gcc/cp/typeck2.c:1806
0x7da80f digest_init_r
../../gcc/cp/typeck2.c:1195
0x7a0e36 finish_compound_literal(tree_node*, tree_node*, int, fcl_t)
../../gcc/cp/semantics.c:3001
0x6f1074 build_lambda_object(tree_node*)
../../gcc/cp/lambda.c:118

[Bug c++/98296] New: ICE: Segmentation fault signal terminated program cc1plus

2020-12-15 Thread gscfq--- via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98296

Bug ID: 98296
   Summary: ICE: Segmentation fault signal terminated program
cc1plus
   Product: gcc
   Version: 11.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: gs...@t-online.de
  Target Milestone: ---

Very old, affects versions down to at least r5 :
(use of appropriate ulimits recommended)


$ cat z1.cc
template  struct T
{ template  T T ::a; };


$ g++-11-20201213 -c z1.cc
g++: internal compiler error: Segmentation fault signal terminated program
cc1plus
Please submit a full bug report,
with preprocessed source if appropriate.
See  for instructions.

  1   2   3   4   5   6   7   8   >