[Bug fortran/89069] ICE in select type with function returning class array pointer

2022-01-14 Thread antony at cosmologist dot info via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89069

--- Comment #3 from Antony Lewis  ---
This bug is still valid as of  gcc 11.2.1 20220114


  15 | end module test
  |   1
internal compiler error: Segmentation fault
0x160a5b7 internal_error(char const*, ...)
???:0
0x764849 gfc_class_data_get(tree_node*)
???:0
0x7b0111 gfc_trans_block_construct(gfc_code*)
???:0
0x762224 gfc_generate_function_code(gfc_namespace*)
???:0
0x73c1d1 gfc_generate_module_code(gfc_namespace*)
???:0
0x6dd185 gfc_parse_file()
???:0

[Bug fortran/103942] [10 Regression] invalid memory reference with allocatable string and class(*)

2022-01-07 Thread antony at cosmologist dot info via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103942

--- Comment #1 from Antony Lewis  ---
Also broken in 9.4.1 20220107.

[Bug fortran/103942] New: [10 Regression] invalid memory reference with allocatable string and class(*)

2022-01-07 Thread antony at cosmologist dot info via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103942

Bug ID: 103942
   Summary: [10 Regression] invalid memory reference with
allocatable string and class(*)
   Product: gcc
   Version: 10.3.1
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
  Assignee: unassigned at gcc dot gnu.org
  Reporter: antony at cosmologist dot info
  Target Milestone: ---

The code works as expected in 9.3.1 20200614. In 10.3.1 20220107 and trunk it
gives

Program received signal SIGSEGV: Segmentation fault - invalid memory reference.



program tester

character(LEN=:), allocatable :: S

S = 'CMB'
call TT(trim(S))

contains

subroutine TT(S)
class(*), intent(in) :: S
class(*), allocatable :: S2

allocate(S2, source=S)

end subroutine TT


end program tester

[Bug fortran/103390] [12 Regression] ICE: gimplification failed since r12-4591-g1af78e731feb9327

2022-01-03 Thread antony at cosmologist dot info via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103390

--- Comment #10 from Antony Lewis  ---
I think you are right, it does not seem to fix it.

I made
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103898

(may also be duplicate of https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103391)

[Bug fortran/103898] New: [12 Regression] ICE: gimplification failed

2022-01-03 Thread antony at cosmologist dot info via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103898

Bug ID: 103898
   Summary: [12 Regression] ICE: gimplification failed
   Product: gcc
   Version: 12.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
  Assignee: unassigned at gcc dot gnu.org
  Reporter: antony at cosmologist dot info
  Target Milestone: ---

For full log see
https://app.travis-ci.com/github/cmbant/CosmoMC/jobs/552809686.
The relevant stack trace is

[ 94/125] Processing src/bflike/long_intrinsic_smw.f90
gimplification failed:
MAX_EXPR <_21, 0> 
unit-size 
align:64 warn_if_not_align:0 symtab:0 alias-set -1 canonical-type
0x7f1b60196738 precision:64 min  max 
pointer_to_this >

arg:0 

def_stmt _21 = _20 + 1;
version:21>
arg:1  constant 0>
/cosmomc/code/plc_3.0/plc-3.01/src/bflike/long_intrinsic_smw.f90:155:36
start: /cosmomc/code/plc_3.0/plc-3.01/src/bflike/long_intrinsic_smw.f90:155:36
finish:
/cosmomc/code/plc_3.0/plc-3.01/src/bflike/long_intrinsic_smw.f90:155:36>
/cosmomc/code/plc_3.0/plc-3.01/src/bflike/long_intrinsic_smw.f90:155:36:
  155 |mysize = size(array, dim=dim)
  |^
internal compiler error: gimplification failed
0x1daeb37 internal_error(char const*, ...)
???:0
0xc4a9b6 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
???:0
0xc4713f gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
???:0
0xc4aa16 gimplify_stmt(tree_node**, gimple**)
???:0
0xc474e2 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
???:0
0xc4aa16 gimplify_stmt(tree_node**, gimple**)
???:0
0xc4848b gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
???:0
0xc4aa16 gimplify_stmt(tree_node**, gimple**)
???:0
0xc479e2 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
???:0
0xc4aa16 gimplify_stmt(tree_node**, gimple**)
???:0
0xc474e2 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
???:0
0xc4aa16 gimplify_stmt(tree_node**, gimple**)
???:0
0xc4848b gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
???:0
0xc4aa16 gimplify_stmt(tree_node**, gimple**)
???:0
0xc479e2 gimplify_expr(tree_node**, gimple**, gimple**, bool (*)(tree_node*),
int)
???:0
0xc58d19 gimplify_body(tree_node*, bool)
???:0
0xc5915d gimplify_function_tree(tree_node*)
???:0
0xa94487 cgraph_node::analyze()
???:0
0xa97c6d symbol_table::finalize_compilation_unit()
???:0
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See  for instructions.

The relevant source code is in
https://pla.esac.esa.int/pla/aio/product-action?COSMOLOGY.FILE_ID=COM_Likelihood_Code-v3.0_R3.01.tar.gz

This broke in trunk relatively recently, though at least a month ago.

I don't have a reduced test case (this is not my code).

[Bug fortran/103390] [12 Regression] ICE: gimplification failed since r12-4591-g1af78e731feb9327

2022-01-03 Thread antony at cosmologist dot info via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103390

--- Comment #7 from Antony Lewis  ---
I see similar error in another fortran code, full trace in
https://app.travis-ci.com/github/cmbant/CosmoMC/jobs/552809686

[Bug sanitizer/100987] New: make distclean error "hwasan: No such file or directory"

2021-06-09 Thread antony at cosmologist dot info via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100987

Bug ID: 100987
   Summary: make distclean error "hwasan: No such file or
directory"
   Product: gcc
   Version: 12.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: sanitizer
  Assignee: unassigned at gcc dot gnu.org
  Reporter: antony at cosmologist dot info
CC: dodji at gcc dot gnu.org, dvyukov at gcc dot gnu.org,
jakub at gcc dot gnu.org, kcc at gcc dot gnu.org, marxin at 
gcc dot gnu.org
  Target Milestone: ---

Last known working trunk build was 22 Nov 2020. Since then a "make distclean"
fails with this error after building C,C++, fortran (failed from weekly
auto-build after that).

See full dockerfile to reproduce at

https://github.com/cmbant/docker-gcc-build/blob/d5eefe8bdbe0b683a7bd4ca09caf4c9bba8fc429/Dockerfile

[Bug fortran/89067] Inaccurate error message: 'i' at (1) is not a member of the 'x' structure

2020-10-13 Thread antony at cosmologist dot info via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89067

--- Comment #4 from Antony Lewis  ---
I agree it may be technically correct, but it is not helpful (esp. if your base
class is an empty hierarchy root class, so all derived classes in the program
would give this same error).