[Bug fortran/45530] New: gfortran internal compiler error

2010-09-03 Thread david dot sagan at gmail dot com
The example program is:

program test
implicit none

type c_struct
  type (g_struct), pointer :: g
end type

type g_struct
  type (p_struct), pointer :: p
end type

type p_struct
  type (region_struct), pointer :: r
end type

type region_struct
  type (p_struct) plot
end type

type (c_struct) curve(10)
namelist / params / curve
end program


compiling with gfortran test2.f90 hangs the compiler. I don't have a simple
example but with other test programs I get the message:


[gfortran] Compiling:  test.f90 -- test_DBL.o
gfortran: Internal error: Segmentation fault (program f951)
Please submit a full bug report.
See http://gcc.gnu.org/bugs.html for instructions.


In any case, commenting out the namelist statement fixes the problem. Notice
that this code is non-conforming since the curve variable has a pointer
component but is also used in the namelist

-- David

PS: I am working on linux:
lnx4103:~/bmad/bmad_dist/test uname -a
Linux lnx4103.lns.cornell.edu 2.6.18-194.11.1.el5 #1 SMP Tue Aug 10 16:39:28
EDT  2010 x86_64 x86_64 x86_64 GNU/Linux


-- 
   Summary: gfortran internal compiler error
   Product: gcc
   Version: 4.5.1
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: david dot sagan at gmail dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45530



[Bug fortran/45532] New: gfortran namelist read error

2010-09-03 Thread david dot sagan at gmail dot com
The test program is:


program test

implicit none

type line_struct
  integer :: width = 10
end type

type symbol_struct
  integer :: typee = 10
end type

type curve_struct
  type (line_struct) line
  type (symbol_struct) symbol
end type

type (curve_struct) curve(10)

namelist / params / curve

!

open (1, file = 'test.nml')
read (1, nml = params)
print *, curve(1)%symbol%typee

end program

The test.nml file is:

params
curve(1)%symbol%typee = 1
/



Compiling with gfortran test.f90 and running gives:

lnx4103:~/bmad/bmad_dist/test gfortran test.f90;./a.out
At line 25 of file test.f90 (unit = 1, file = 'test.nml')
Fortran runtime error: End of file


Now if you reverse the line and symbol components of the curve_struct:

type curve_struct
  type (symbol_struct) symbol
  type (line_struct) line
end type

Now the program runs fine:

lnx4103:~/bmad/bmad_dist/test gfortran test.f90;./a.out
   1

I am running on Linux:

lnx4103:~/bmad/bmad_dist/test uname -a
Linux lnx4103.lns.cornell.edu 2.6.18-194.11.1.el5 #1 SMP Tue Aug 10 16:39:28
EDT  2010 x86_64 x86_64 x86_64 GNU/Linux


-- David


-- 
   Summary: gfortran namelist read error
   Product: gcc
   Version: 4.5.1
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: david dot sagan at gmail dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45532



[Bug fortran/45463] New: gfortran internal write bug

2010-08-31 Thread david dot sagan at gmail dot com
Consider the following code: 

program test 
implicit none 
character(40) line 
line = 'Hello World!' 
write (line, '(i3, 2x, a)') 7, trim(line) 
print *, line 
end program 

With the gfortran compiler (v4.5.1) the output is: 
   77lo World! 
I would expect the output to be
   7  Hello World! 

-- David


-- 
   Summary: gfortran internal write bug
   Product: gcc
   Version: 4.5.1
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: david dot sagan at gmail dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45463



[Bug fortran/45463] gfortran internal write bug

2010-08-31 Thread david dot sagan at gmail dot com


--- Comment #2 from david dot sagan at gmail dot com  2010-08-31 14:20 
---
(In reply to comment #1)
 Did you see the responses to your post in c.l.f?
 It seems that your program is non-conforming.  I
 leave the PR open until either I or someone else
 has time to verify the conformity of the program.
 

Sorry. When I looked after I had posted the question there was only one
response and that response said it was a bug so I submitted this bug report.
Now other people have posted saying that the program is non-conforming.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45463



[Bug fortran/45463] gfortran internal write bug

2010-08-31 Thread david dot sagan at gmail dot com


--- Comment #3 from david dot sagan at gmail dot com  2010-08-31 14:32 
---
(In reply to comment #2)
 Sorry. When I looked after I had posted the question there was only one
 response and that response said it was a bug so I submitted this bug report.
 Now other people have posted saying that the program is non-conforming.

Update: More responses in comp.lang.fortran bring up the point that if
trim(line)
is supposed to return a temporary, the code might be conforming. Seems that the
situation is not clear...


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45463



[Bug bootstrap/40833] gcc configure problem with mpfr.h

2009-10-13 Thread david dot sagan at gmail dot com


--- Comment #6 from david dot sagan at gmail dot com  2009-10-14 04:40 
---
(In reply to comment #5)
   checking for correct version of mpfr.h... no
 
 That is correct error since mpfr cannot be used as you configured gcc so it is
 not the correct version :).
 

No. This is not correct. See comment #3. It has nothing to do with the version
of MPFR. The problem was that MPFR was built against a different version of GMP
than the GMP version specified on the configure line. 

So the error message is wrong.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40833



[Bug fortran/40853] Namelist read error

2009-07-24 Thread david dot sagan at gmail dot com


--- Comment #1 from david dot sagan at gmail dot com  2009-07-24 21:05 
---
Created an attachment (id=18250)
 -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=18250action=view)
test.s file generated by the compile


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40853



[Bug fortran/40853] New: Namelist read error

2009-07-24 Thread david dot sagan at gmail dot com
In brief: A namelist read of a structure component that is a vector when that
structure has another component that is a structure results in a runtime error. 

Test file:

  program test

  implicit none

  type tao_title_struct
character(2) justify   
  end type

  type tao_plot_page_struct
real shape_height_max 
type (tao_title_struct) title ! Comment this line out and the bug goes
away.
real size(2)
  end type

  type (tao_plot_page_struct) plot_page

  namelist / params / plot_page

  open (1, file = 'test.in')
  read (1, nml = params)
  close (1)

  end program

The file test.in is:

  params
plot_page%size = 1, 2
  /


Compiling and running gives:

[atf2c...@lnx209 test]$ gfortran -v -save-temps test.f90
Driving: gfortran -v -save-temps test.f90 -lgfortranbegin -lgfortran -lm
-shared-libgcc
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: ../gcc-4.4.1/configure --prefix=/home/atf2code/atf2/usr_local
--with-gmp=/home/atf2code/atf2/usr_local
--with-mpfr=/home/atf2code/atf2/usr_local
Thread model: posix
gcc version 4.4.1 (GCC) 
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-shared-libgcc' '-mtune=generic'

/a/lnx113/nfs/acc/temp/atf2/usr_local/bin/../libexec/gcc/i686-pc-linux-gnu/4.4.1/f951
test.f90 -quiet -dumpbase test.f90 -mtune=generic -auxbase test -version
-fintrinsic-modules-path
/a/lnx113/nfs/acc/temp/atf2/usr_local/bin/../lib/gcc/i686-pc-linux-gnu/4.4.1/finclude
-o test.s
GNU Fortran (GCC) version 4.4.1 (i686-pc-linux-gnu)
compiled by GNU C version 4.4.1, GMP version 4.3.1, MPFR version 2.4.1.
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-shared-libgcc' '-mtune=generic'
 as -V -Qy -o test.o test.s
GNU assembler version 2.15.92.0.2 (i386-redhat-linux) using BFD version
2.15.92.0.2 20040927
COMPILER_PATH=/a/lnx113/nfs/acc/temp/atf2/usr_local/bin/../libexec/gcc/i686-pc-linux-gnu/4.4.1/:/a/lnx113/nfs/acc/temp/atf2/usr_local/bin/../libexec/gcc/
LIBRARY_PATH=/a/lnx113/nfs/acc/temp/atf2/usr_local/bin/../lib/gcc/i686-pc-linux-gnu/4.4.1/:/a/lnx113/nfs/acc/temp/atf2/usr_local/bin/../lib/gcc/:/a/lnx113/nfs/acc/temp/atf2/usr_local/bin/../lib/gcc/i686-pc-linux-gnu/4.4.1/../../../:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-shared-libgcc' '-mtune=generic'

/a/lnx113/nfs/acc/temp/atf2/usr_local/bin/../libexec/gcc/i686-pc-linux-gnu/4.4.1/collect2
--eh-frame-hdr -m elf_i386 -dynamic-linker /lib/ld-linux.so.2 /usr/lib/crt1.o
/usr/lib/crti.o
/a/lnx113/nfs/acc/temp/atf2/usr_local/bin/../lib/gcc/i686-pc-linux-gnu/4.4.1/crtbegin.o
-L/a/lnx113/nfs/acc/temp/atf2/usr_local/bin/../lib/gcc/i686-pc-linux-gnu/4.4.1
-L/a/lnx113/nfs/acc/temp/atf2/usr_local/bin/../lib/gcc
-L/a/lnx113/nfs/acc/temp/atf2/usr_local/bin/../lib/gcc/i686-pc-linux-gnu/4.4.1/../../..
test.o -lgfortranbegin -lgfortran -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc
/a/lnx113/nfs/acc/temp/atf2/usr_local/bin/../lib/gcc/i686-pc-linux-gnu/4.4.1/crtend.o
/usr/lib/crtn.o

[atf2c...@lnx209 test]$ ./a.out 
At line 20 of file test.f90 (unit = 1, file = 'test.in')
Fortran runtime error: Cannot match namelist object name 1


Note: If the title component of tao_plot_page_struct is commented out or
moved below the size component then the program runs without fail.


-- 
   Summary: Namelist read error
   Product: gcc
   Version: 4.4.1
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: david dot sagan at gmail dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40853



[Bug bootstrap/40833] gcc configure problem with mpfr.h

2009-07-23 Thread david dot sagan at gmail dot com


--- Comment #2 from david dot sagan at gmail dot com  2009-07-23 10:59 
---
The commands show:

lnx498:/nfs/acc/temp/dcs/gcc/gcc_tmp find /usr -name gmp.h
/usr/include/gmp.h
find: /usr/share/ssl/CA: Permission denied
[1]  + Done  emacs -g 100x80 ~/.chsrc
lnx498:/nfs/acc/temp/dcs/gcc/gcc_tmp find /usr -name libgmp\*
/usr/lib/libgmpxx.a
/usr/lib/libgmp.so.3
/usr/lib/libgmpxx.so.3.0.5
/usr/lib/libgmp.so
/usr/lib/libgmp.so.3.3.3
/usr/lib/sse2/libgmp.so.3
/usr/lib/sse2/libgmpxx.so.3.0.5
/usr/lib/sse2/libgmp.so.3.3.3
/usr/lib/sse2/libgmpxx.so.3
/usr/lib/libgmpxx.so
/usr/lib/libgmp.a
/usr/lib/libgmpxx.so.3
find: /usr/share/ssl/CA: Permission denied


Yes mpfr was built against a different version of gmp. 
I did not realize this would make a difference.
But how does this relate to the message that the version number in mpfr.h is
not correct when it is?


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40833



[Bug bootstrap/40833] gcc configure problem with mpfr.h

2009-07-23 Thread david dot sagan at gmail dot com


--- Comment #4 from david dot sagan at gmail dot com  2009-07-23 15:32 
---
 It has nothing to do with the version number.  Read the log file you
 included in your original post.  You'll find

Thanks for the information. As I see it, the problem here is that the error
message from configure: 
  checking for correct version of mpfr.h... no
  configure: error: Building GCC requires GMP 4.1+ and MPFR 2.3.2+.
is wrong in this case. I would suggest that either 1) The error message be
changed to reflect the fact that other things could be wrong or, preferably, 2)
separate the mpfr test into pieces so accurate diagnostic messages can be
generated. 

-- Again Thanks, David


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40833



[Bug bootstrap/40833] New: gcc configure problem with mpfr.h

2009-07-22 Thread david dot sagan at gmail dot com
=''
GCC_SHLIB_SUBDIR=''
GCJ_FOR_BUILD='$(GCJ)'
GCJ_FOR_TARGET=''
GDB_TK=''
GFORTRAN_FOR_BUILD='$(GFORTRAN)'
GFORTRAN_FOR_TARGET=''
GNATBIND='no'
GNATMAKE='no'
INSTALL_DATA='${INSTALL} -m 644'
INSTALL_GDB_TK=''
INSTALL_PROGRAM='${INSTALL}'
INSTALL_SCRIPT='${INSTALL}'
LD=''
LDFLAGS=''
LDFLAGS_FOR_BUILD=''
LD_FOR_BUILD='$(LD)'
LD_FOR_TARGET=''
LEX=''
LIBOBJS=''
LIBS=''
LIPO=''
LIPO_FOR_TARGET=''
LN='ln'
LN_S='ln -s'
LTLIBOBJS=''
M4=''
MAINT=''
MAINTAINER_MODE_FALSE=''
MAINTAINER_MODE_TRUE=''
MAKEINFO=''
NM=''
NM_FOR_BUILD='$(NM)'
NM_FOR_TARGET=''
OBJCOPY=''
OBJDUMP=''
OBJDUMP_FOR_TARGET=''
OBJEXT='o'
PACKAGE_BUGREPORT=''
PACKAGE_NAME=''
PACKAGE_STRING=''
PACKAGE_TARNAME=''
PACKAGE_VERSION=''
PATH_SEPARATOR=':'
RANLIB=''
RANLIB_FOR_BUILD='$(RANLIB)'
RANLIB_FOR_TARGET=''
RAW_CXX_FOR_TARGET=''
RPATH_ENVVAR=''
RUNTEST=''
SHELL='/bin/sh'
STRIP=''
STRIP_FOR_TARGET=''
SYSROOT_CFLAGS_FOR_TARGET=''
TOPLEVEL_CONFIGURE_ARGUMENTS='../gcc-4.4.1/configure
--prefix=/home/dcs/dcs/usr_local --with-gmp=/home/dcs/dcs/usr_local
--with-mpfr=/home/dcs/dcs/usr_local'
WINDMC=''
WINDMC_FOR_BUILD='$(WINDMC)'
WINDMC_FOR_TARGET=''
WINDRES=''
WINDRES_FOR_BUILD='$(WINDRES)'
WINDRES_FOR_TARGET=''
YACC=''
ac_ct_CC='gcc'
ac_ct_CXX='g++'
ac_ct_GNATBIND='no'
ac_ct_GNATMAKE='no'
bindir='${exec_prefix}/bin'
build='i686-pc-linux-gnu'
build_alias=''
build_configargs=''
build_configdirs='build-libiberty build-texinfo build-byacc build-flex
build-bison build-m4 build-fixincludes'
build_cpu='i686'
build_libsubdir='build-i686-pc-linux-gnu'
build_noncanonical='i686-pc-linux-gnu'
build_os='linux-gnu'
build_subdir='build-i686-pc-linux-gnu'
build_tooldir=''
build_vendor='pc'
clooginc=''
clooglibs=''
config_shell='/bin/sh'
configdirs='intl mmalloc libiberty opcodes bfd readline tcl tk itcl libgui zlib
libcpp libdecnumber gmp mpfr ppl cloog libiconv texinfo byacc flex bison
binutils gas ld fixincludes gcc sid sim gdb make patch prms send-pr gprof etc
expect dejagnu ash bash bzip2 m4 autoconf automake libtool diff rcs fileutils
shellutils time textutils wdiff find uudecode hello tar gzip indent recode
release sed utils guile perl gawk findutils gettext zip fastjar gnattools'
datadir='${prefix}/share'
datarootdir=''
do_compare='cmp --ignore-initial=16 $$f1 $$f2'
docdir=''
exec_prefix='NONE'
extra_mpfr_configure_flags=''
gmpinc='-I/home/dcs/dcs/usr_local/include -I/home/dcs/dcs/usr_local/include'
gmplibs='-L/home/dcs/dcs/usr_local/lib -L/home/dcs/dcs/usr_local/lib -lmpfr
-lgmp'
host='i686-pc-linux-gnu'
host_alias=''
host_configargs=''
host_cpu='i686'
host_noncanonical='i686-pc-linux-gnu'
host_os='linux-gnu'
host_subdir='.'
host_vendor='pc'
htmldir=''
includedir='${prefix}/include'
infodir='${prefix}/info'
libdir='${exec_prefix}/lib'
libexecdir='${exec_prefix}/libexec'
localstatedir='${prefix}/var'
mandir='${prefix}/man'
oldincludedir='/usr/include'
pdfdir=''
pplinc=''
ppllibs=''
prefix='/home/dcs/dcs/usr_local'
program_transform_name='s,y,y,'
sbindir='${exec_prefix}/sbin'
sharedstatedir='${prefix}/com'
stage1_cflags=''
stage1_checking=''
stage1_languages=''
stage2_werror_flag=''
sysconfdir='${prefix}/etc'
target='i686-pc-linux-gnu'
target_alias=''
target_configargs=''
target_cpu='i686'
target_noncanonical='i686-pc-linux-gnu'
target_os='linux-gnu'
target_subdir='i686-pc-linux-gnu'
target_vendor='pc'
tooldir=''

## - ##
## Output files. ##
## - ##

alphaieee_frag=''
host_makefile_frag='config/mh-x86omitfp'
ospace_frag=''
serialization_dependencies=''
target_makefile_frag=''

## --- ##
## confdefs.h. ##
## --- ##

#define PACKAGE_BUGREPORT 
#define PACKAGE_NAME 
#define PACKAGE_STRING 
#define PACKAGE_TARNAME 
#define PACKAGE_VERSION 
#endif
#ifdef __cplusplus
extern C void std::exit (int) throw (); using std::exit;

configure: exit 1
l


-- 
   Summary: gcc configure problem with mpfr.h
   Product: gcc
   Version: 4.4.1
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: bootstrap
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: david dot sagan at gmail dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40833



[Bug fortran/39879] New: double free or corruption abort with gfortran

2009-04-24 Thread david dot sagan at gmail dot com
The program (see attachment) was run on Linux. Platform details:

uname -a:
Linux lnx180c.lns.cornell.edu 2.6.9-67.0.1.ELsmp #1 SMP Wed Dec 19 15:44:14
CST 2007 i686 i686 i386 GNU/Linux

cat /etc/redhat-release:
Scientific Linux SL release 4.5 (Beryllium)

Compiler:
GNU Fortran (GCC) 4.4.0 


Compile and run results:
 gfortran tao_program.f90
 ./a.out
 Setting bunch_params 113 113
 Have set
 After 1st set
 Setting bunch_params 113 113
 Have set
*** glibc detected *** double free or corruption (top): 0x09f873a0 ***
Abort


-- 
   Summary: double free or corruption abort with gfortran
   Product: gcc
   Version: 4.4.0
Status: UNCONFIRMED
  Severity: major
  Priority: P3
 Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: david dot sagan at gmail dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39879



[Bug fortran/39879] double free or corruption abort with gfortran

2009-04-24 Thread david dot sagan at gmail dot com


--- Comment #1 from david dot sagan at gmail dot com  2009-04-24 06:36 
---
Created an attachment (id=17686)
 -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=17686action=view)
Example program which shows the bug


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39879



[Bug fortran/39879] double free or corruption abort with gfortran

2009-04-24 Thread david dot sagan at gmail dot com


--- Comment #3 from david dot sagan at gmail dot com  2009-04-24 13:06 
---
Corrected severity.


-- 

david dot sagan at gmail dot com changed:

   What|Removed |Added

   Severity|major   |critical


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39879



[Bug fortran/39879] double free or corruption abort with gfortran

2009-04-24 Thread david dot sagan at gmail dot com


--- Comment #5 from david dot sagan at gmail dot com  2009-04-24 14:27 
---
Sorry. I was going by the documentation on the link (crashes, loss of data,
severe memory leak). Thanks for the information.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39879



[Bug fortran/39791] New: Bad Dwarf debug information from gfortran for a character string.

2009-04-16 Thread david dot sagan at gmail dot com
A simple example shows the problem:

program test
  implicit none
  integer i
  character(16) abc
  abc = abc
  i = 7
end program

Compile with:
  gfortran -g -O0 test.f90

Run with gdb and whatis abc produces:
  type = character(kind=1) (16)

That is, gdb thinks that the variable abc is an array of length 16 with each
component in the array being a singe character. I verified with the totalview
debugger that the problem was with the compiler and not gdb. Interestingly
enough, version 4.1.1 does *not* have this problem. This bug definitely makes
debugging a program more painful.


-- 
   Summary: Bad Dwarf debug information from gfortran for a
character string.
   Product: gcc
   Version: 4.3.3
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: david dot sagan at gmail dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39791