Summary: | internal compiler error: Segmentation Fault - For common blocks | ||
---|---|---|---|
Product: | gcc | Reporter: | Dale Ranta <dir> |
Component: | fortran | Assignee: | Not yet assigned to anyone <unassigned> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | gbosilca, gcc-bugs, sje, tobi |
Priority: | P2 | Keywords: | ice-on-valid-code |
Version: | 4.0.0 | ||
Target Milestone: | 4.0.1 | ||
Host: | powerpc-apple-darwin7.8.0 | Target: | |
Build: | Known to work: | ||
Known to fail: | Last reconfirmed: | 2005-02-18 18:44:20 | |
Bug Depends on: | 19387 | ||
Bug Blocks: | 19292, 20405 |
Description
Dale Ranta
2005-02-18 16:26:56 UTC
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. *** |