[Bug fortran/82055] segfault compiling F2003 functionality

2019-04-06 Thread dominiq at lps dot ens.fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82055

Dominique d'Humieres  changed:

   What|Removed |Added

Summary|segfault compiling F2003|segfault compiling F2003
   |functionality:  4.9.3,  |functionality
   |5.3.0 and 6.3.0 |

--- Comment #5 from Dominique d'Humieres  ---
Compiling the test with my recent instrumented compiler (9.0) gives

../../work/gcc/tree.h:3289:28: runtime error: member access within null pointer
of type 'union tree_node'

thus I have removed the references to unsupported versions.

[Bug fortran/82055] segfault compiling F2003 functionality: 4.9.3, 5.3.0 and 6.3.0

2017-09-20 Thread dominiq at lps dot ens.fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82055

Dominique d'Humieres  changed:

   What|Removed |Added

 Status|WAITING |NEW

--- Comment #4 from Dominique d'Humieres  ---
Confirmed also on trunk (8.0).

With the following change

--- mo_gas_optics_specification.orig.F902017-08-31 16:51:24.0
+0200
+++ mo_gas_optics_specification.F90 2017-08-31 18:56:56.0 +0200
@@ -408,7 +408,7 @@ contains

 ! Number of molecules per cm^2
 real(wp), dimension(size(play,dim=1), size(play,dim=2)), target  ::
col_dry_arr
-real(wp), dimension(:,:),pointer ::
col_dry_wk => NULL()
+real(wp), dimension(:,:),pointer ::
col_dry_wk !=> NULL()
 ! --
 ! Code starts
 !
@@ -525,13 +525,11 @@ contains
 !

 ! Compute column amounts (number of molecule per cm^2) if user hasn't
provided them
-if (present(col_dry)) then
-  col_dry_wk => col_dry
-else
+if (.not.present(col_dry)) then
   idx_h2o = string_loc_in_array('h2o', terse_gas_names)
   col_dry_arr = get_col_dry(vmr(:,:,idx_h2o), plev, tlay) ! column dry
amounts computation
-  col_dry_wk => col_dry_arr
 end if
+col_dry_wk => col_dry_arr

 ! Make list of minor gases that are defined in specification and have
available concentrations
 ! Includes key species that are also considered minor at some g-points 

the ICE is

mo_gas_optics_specification.F90:532:0:

 col_dry_wk => col_dry_arr

internal compiler error: Segmentation fault: 11

I have tried to reduce the code, but it is pretty touchy.

My instrumented compiler gives

../../work/gcc/tree.h:3211:28: runtime error: member access within null pointer
of type 'tree_node *[2]'
ASAN:DEADLYSIGNAL
=
==3334==ERROR: AddressSanitizer: SEGV on unknown address 0x (pc
0x000102a5e033 bp 0x7fff5fbfc190 sp 0x7fff5fbfc140 T0)
==3334==The signal is caused by a READ memory access.
==3334==Hint: address points to the zero page.
#0 0x102a5e032 in size_binop_loc(unsigned int, tree_code, tree_node*,
tree_node*)
(/opt/gcc/gcc8g/libexec/gcc/x86_64-apple-darwin16.7.0/8.0.0/f951+0x102a5e032)
#1 0x102872296 in get_inner_reference(tree_node*, long long*, long long*,
tree_node**, machine_mode*, int*, int*, int*)
(/opt/gcc/gcc8g/libexec/gcc/x86_64-apple-darwin16.7.0/8.0.0/f951+0x102872296)
#2 0x102a66495 in fold_unary_loc(unsigned int, tree_code, tree_node*,
tree_node*)
(/opt/gcc/gcc8g/libexec/gcc/x86_64-apple-darwin16.7.0/8.0.0/f951+0x102a66495)
#3 0x102a6c03f in fold_build1_loc(unsigned int, tree_code, tree_node*,
tree_node*)
(/opt/gcc/gcc8g/libexec/gcc/x86_64-apple-darwin16.7.0/8.0.0/f951+0x102a6c03f)
#4 0x102a6d813 in fold_convert_loc(unsigned int, tree_node*, tree_node*)
(/opt/gcc/gcc8g/libexec/gcc/x86_64-apple-darwin16.7.0/8.0.0/f951+0x102a6d813)
#5 0x100586c86 in gfc_trans_string_copy(stmtblock_t*, tree_node*,
tree_node*, int, tree_node*, tree_node*, int)
(/opt/gcc/gcc8g/libexec/gcc/x86_64-apple-darwin16.7.0/8.0.0/f951+0x100586c86)
#6 0x10058836f in gfc_trans_scalar_assign(gfc_se*, gfc_se*, gfc_typespec,
bool, bool, bool)
(/opt/gcc/gcc8g/libexec/gcc/x86_64-apple-darwin16.7.0/8.0.0/f951+0x10058836f)
#7 0x100611dfd in gfc_trans_assignment_1(gfc_expr*, gfc_expr*, bool, bool,
bool, bool)
(/opt/gcc/gcc8g/libexec/gcc/x86_64-apple-darwin16.7.0/8.0.0/f951+0x100611dfd)
#8 0x1006125bb in gfc_trans_assignment(gfc_expr*, gfc_expr*, bool, bool,
bool, bool)
(/opt/gcc/gcc8g/libexec/gcc/x86_64-apple-darwin16.7.0/8.0.0/f951+0x1006125bb)
#9 0x1006127e2 in gfc_trans_assign(gfc_code*)
(/opt/gcc/gcc8g/libexec/gcc/x86_64-apple-darwin16.7.0/8.0.0/f951+0x1006127e2)
#10 0x10041c403 in trans_code(gfc_code*, tree_node*)
(/opt/gcc/gcc8g/libexec/gcc/x86_64-apple-darwin16.7.0/8.0.0/f951+0x10041c403)
#11 0x10041d8e2 in gfc_trans_code(gfc_code*)
(/opt/gcc/gcc8g/libexec/gcc/x86_64-apple-darwin16.7.0/8.0.0/f951+0x10041d8e2)
#12 0x100550a0a in gfc_generate_function_code(gfc_namespace*)
(/opt/gcc/gcc8g/libexec/gcc/x86_64-apple-darwin16.7.0/8.0.0/f951+0x100550a0a)
#13 0x100429dca in gfc_generate_module_code(gfc_namespace*)
(/opt/gcc/gcc8g/libexec/gcc/x86_64-apple-darwin16.7.0/8.0.0/f951+0x100429dca)
#14 0x10027ff87 in translate_all_program_units(gfc_namespace*)
(/opt/gcc/gcc8g/libexec/gcc/x86_64-apple-darwin16.7.0/8.0.0/f951+0x10027ff87)
#15 0x10029aca0 in gfc_parse_file()
(/opt/gcc/gcc8g/libexec/gcc/x86_64-apple-darwin16.7.0/8.0.0/f951+0x10029aca0)
#16 0x1003f14f2 in gfc_be_parse_file()
(/opt/gcc/gcc8g/libexec/gcc/x86_64-apple-darwin16.7.0/8.0.0/f951+0x1003f14f2)
#17 0x1045a4bac in compile_file()
(/opt/gcc/gcc8g/libexec/gcc/x86_64-apple-darwin16.7.0/8.0.0/f951+0x1045a4bac)
#18 

[Bug fortran/82055] segfault compiling F2003 functionality: 4.9.3, 5.3.0 and 6.3.0

2017-09-19 Thread kargl at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82055

kargl at gcc dot gnu.org changed:

   What|Removed |Added

 CC||kargl at gcc dot gnu.org

--- Comment #3 from kargl at gcc dot gnu.org ---
(In reply to Will Sawyer from comment #2)
> Created attachment 42096 [details]
> src and build directories with code to isolate bug

This is not helpful, because you assume that we know
what the files in build/ mean.  With the simplest of
changes in build/Makefile.conf.gfortran-cscs of
ftn->gfcx, I get 

% gmake 
gfcx -cpp -ffree-line-length-none -g -fbounds-check -fimplicit-none
-ffpe-trap=zero -O -march=native -ffast-math -std=f2003 -pedantic -g
-fbounds-check -Wall -fcheck=all -Wextra -fbacktrace -finit-real=nan
-save-temps '-DP(EX)=print *,"-->EX:",EX'  -c
../src/host-model-interface/mo_rrtmgp_kind.F90
gfortran: error: *,"-->EX:",EX: No such file or directory
gmake: *** [Makefile.rules:8: mo_rrtmgp_kind.o] Error 1

[Bug fortran/82055] segfault compiling F2003 functionality: 4.9.3, 5.3.0 and 6.3.0

2017-08-31 Thread wsawyer at cscs dot ch
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82055

--- Comment #2 from Will Sawyer  ---
Created attachment 42096
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=42096=edit
src and build directories with code to isolate bug

[Bug fortran/82055] segfault compiling F2003 functionality: 4.9.3, 5.3.0 and 6.3.0

2017-08-31 Thread dominiq at lps dot ens.fr
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82055

Dominique d'Humieres  changed:

   What|Removed |Added

 Status|UNCONFIRMED |WAITING
   Last reconfirmed||2017-08-31
 Ever confirmed|0   |1

--- Comment #1 from Dominique d'Humieres  ---
Please provide a test that can be compiled, i.e., with the needed modules. It
would be nice if you can reduce the test.