diff options
author | Tobias Schlüter <tobias.schlueter@physik.uni-muenchen.de> | 2005-04-24 15:51:39 +0200 |
---|---|---|
committer | Tobias Schlüter <tobi@gcc.gnu.org> | 2005-04-24 15:51:39 +0200 |
commit | eb83e81102d1770daba45b95ea0f9e5a00c938ae (patch) | |
tree | 0b35e9cf19e3ed9313832e9e741598c68a75a98f | |
parent | 93cfbc5c7c33bf887a973aa6781e9836dc3f2ad6 (diff) | |
download | gcc-eb83e81102d1770daba45b95ea0f9e5a00c938ae.zip gcc-eb83e81102d1770daba45b95ea0f9e5a00c938ae.tar.gz gcc-eb83e81102d1770daba45b95ea0f9e5a00c938ae.tar.bz2 |
re PR fortran/20059 (internal compiler error: Segmentation Fault - For common blocks)
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.
From-SVN: r98660
-rw-r--r-- | gcc/fortran/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/fortran/trans-common.c | 4 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/common_5.f | 10 |
4 files changed, 23 insertions, 2 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 123fb9a..512e813 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,9 @@ +2005-04-24 Tobias Schl"uter <tobias.schlueter@physik.uni-muenchen.de> + + PR fortran/20059 + * trans-common.c (translate_common): Cast offset and + common_segment->offset to type int for warning message. + 2005-04-23 DJ Delorie <dj@redhat.com> * trans-decl.c: Adjust warning() callers. diff --git a/gcc/fortran/trans-common.c b/gcc/fortran/trans-common.c index 42e6712..d164fe3 100644 --- a/gcc/fortran/trans-common.c +++ b/gcc/fortran/trans-common.c @@ -848,7 +848,7 @@ translate_common (gfc_common_head *common, gfc_symbol *var_list) 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 @@ -874,7 +874,7 @@ translate_common (gfc_common_head *common, gfc_symbol *var_list) 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, saw_equiv); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 48e1d30..f6631e2 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2005-04-24 Tobias Schl"uter <tobias.schlueter@physik.uni-muenchen.de> + + PR fortran/20059 + * gfortran.dg/common_5.f: New test. + 2005-04-23 Richard Guenther <rguenth@gcc.gnu.org> PR middle-end/21082 diff --git a/gcc/testsuite/gfortran.dg/common_5.f b/gcc/testsuite/gfortran.dg/common_5.f new file mode 100644 index 0000000..d4b9614 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/common_5.f @@ -0,0 +1,10 @@ +C { dg-do compile } +C PR 20059 +C Check that the warning for padding works correctly. + SUBROUTINE PLOTZ + IMPLICIT DOUBLE PRECISION (A-H,O-Z) + COMMON /CCPOOL/ RMIN,RMAX,ZMIN,ZMAX,IMIN,JMIN,IMAX,JMAX,NFLOP, ! { dg-warning "Padding" } + $ HTP +C + RETURN + END |