I get an Segmentation Fault with the Macintosh gfortran from the 20050213 package for this program. [dranta:~/tests/gfortran] dir% gfortran -c plotz.f [address=6f6c0004 pc=000140d0] plotz.f: In function 'plotz': plotz.f:1: internal compiler error: Segmentation Fault Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://gcc.gnu.org/bugs.html> for instructions. [dranta:~/tests/gfortran] dir% cat plotz.f SUBROUTINE PLOTZ IMPLICIT DOUBLE PRECISION (A-H,O-Z) COMMON /HEAD/ HED,P(3) CHARACTER HED*80,P*1 COMMON /ULAB/ LAB(5) CHARACTER*80 LAB COMMON /IODATA/ DATA(64) COMMON /TAPES/ NOUT,NTAPE2,NTAPE3,NTAPE4,NTAPE5,NTAPE6,NTAPE7, $ NTAPE8,NTAPE9 COMMON /CCPOOL/ RMIN,RMAX,ZMIN,ZMAX,IMIN,JMIN,IMAX,JMAX,NFLOP, $ HTP,SCALEP,ANGP,CCXMAX,WIDTH C RETURN END
Confirmed, but note I think this is the same as PR 19387 even though there is no ICE in that bug.
Does this still segfault on powerpc? On i686 I get: In file pr20059.f90:10 COMMON /CCPOOL/ RMIN,RMAX,ZMIN,ZMAX,IMIN,JMIN,IMAX,JMAX,NFLOP, & 1 Warning: Padding of 4 bytes required before 'htp' in COMMON 'ccpool' at (1)
(In reply to comment #2) > Does this still segfault on powerpc? On i686 I get: > In file pr20059.f90:10 > > COMMON /CCPOOL/ RMIN,RMAX,ZMIN,ZMAX,IMIN,JMIN,IMAX,JMAX,NFLOP, & > 1 > Warning: Padding of 4 bytes required before 'htp' in COMMON 'ccpool' at (1) This is most likely because building a compiler for i686, HWI is 32bits but for PPC, it is 64bit and because of PR 19387, we don't deal with HWI in the fortran front-end error/warning functions don't understand HWI. (HWI == Host_Wide_int).
Can you try this patch, Andrew? The required padding should never overflow 2^32. 2005-03-13 Tobias Schl"uter <tobias.schlueter@physik.uni-muenchen.de> PR fortran/20059 * trans-common.c (translate_common): Cast offset/common_segment->offset to type int for warning message. Index: trans-common.c =================================================================== RCS file: /cvs/gcc/gcc/gcc/fortran/trans-common.c,v retrieving revision 1.24 diff -u -p -r1.24 trans-common.c --- trans-common.c 12 Mar 2005 21:44:32 -0000 1.24 +++ trans-common.c 13 Mar 2005 00:15:08 -0000 @@ -815,7 +815,7 @@ translate_common (gfc_common_head *commo requirements. Insert padding immediately before this segment. */ gfc_warning ("Padding of %d bytes required before '%s' in " - "COMMON '%s' at %L", offset, s->sym->name, + "COMMON '%s' at %L", (int)offset, s->sym->name, common->name, &common->where); } else @@ -841,7 +841,7 @@ translate_common (gfc_common_head *commo if (common_segment->offset != 0) { gfc_warning ("COMMON '%s' at %L requires %d bytes of padding at start", - common->name, &common->where, common_segment->offset); + common->name, &common->where, (int)common_segment->offset); } create_common (common, common_segment);
(In reply to comment #4) > Can you try this patch, Andrew? The required padding should never overflow 2^32. Sorry for not replying sooner, exams got in the way. But yes this fixes the problem.
*** Bug 19387 has been marked as a duplicate of this bug. ***
*** Bug 21125 has been marked as a duplicate of this bug. ***
Subject: Bug 20059 CVSROOT: /cvs/gcc Module name: gcc Changes by: tobi@gcc.gnu.org 2005-04-24 13:51:39 Modified files: gcc/fortran : ChangeLog trans-common.c gcc/testsuite : ChangeLog Added files: gcc/testsuite/gfortran.dg: common_5.f Log message: fortran/ PR fortran/20059 * trans-common.c (translate_common): Cast offset and common_segment->offset to type int for warning message. testsuite/ PR fortran/20059 * gfortran.dg/common_5.f: New test. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/ChangeLog.diff?cvsroot=gcc&r1=1.404&r2=1.405 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/trans-common.c.diff?cvsroot=gcc&r1=1.26&r2=1.27 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.5389&r2=1.5390 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gfortran.dg/common_5.f.diff?cvsroot=gcc&r1=NONE&r2=1.1
Subject: Bug 20059 CVSROOT: /cvs/gcc Module name: gcc Branch: gcc-4_0-branch Changes by: tobi@gcc.gnu.org 2005-04-24 13:59:58 Modified files: gcc/fortran : ChangeLog trans-common.c gcc/testsuite : ChangeLog Added files: gcc/testsuite/gfortran.dg: common_5.f Log message: fortran/ PR fortran/20059 * trans-common.c (translate_common): Cast offset and common_segment->offset to type int for warning message. testsuite/ PR fortran/20059 * gfortran.dg/common_5.f: New test. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.335.2.37&r2=1.335.2.38 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/fortran/trans-common.c.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.23.2.3&r2=1.23.2.4 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.5084.2.134&r2=1.5084.2.135 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gfortran.dg/common_5.f.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=NONE&r2=1.1.2.1
Fixed, sorry for the delay.
*** Bug 21384 has been marked as a duplicate of this bug. ***