diff options
author | Bernhard Fischer <aldot@gcc.gnu.org> | 2006-11-01 00:38:58 +0100 |
---|---|---|
committer | Bernhard Reutner-Fischer <aldot@gcc.gnu.org> | 2006-11-01 00:38:58 +0100 |
commit | 4143349751326d2804faad1a7d2cc55e647bd4ad (patch) | |
tree | c625ef375d766085812e0b32d7cc941024b9531e /gcc/fortran/match.c | |
parent | af9d09936281796e6341ad77b210f5a9b257aad3 (diff) | |
download | gcc-4143349751326d2804faad1a7d2cc55e647bd4ad.zip gcc-4143349751326d2804faad1a7d2cc55e647bd4ad.tar.gz gcc-4143349751326d2804faad1a7d2cc55e647bd4ad.tar.bz2 |
re PR fortran/29537 (ICE in gfc_match_common for blank common in BLOCK DATA unit)
fortran/ChangeLog:
2006-11-01 Bernhard Fischer <aldot@gcc.gnu.org>
PR fortran/29537
* trans-common.c (gfc_trans_common): If the blank common is
in a procedure or program without a name then proc_name is null, so use
the locus of the common.
(gfc_sym_mangled_common_id): Fix whitespace.
* match.c (gfc_match_common): Emit warning about blank common in
block data.
testsuite/ChangeLog:
2006-11-01 Bernhard Fischer <aldot@gcc.gnu.org>
PR fortran/29537
* gfortran.dg/blockdata_1.f90: Add warning about blank common in block
data.
* gfortran.dg/blockdata_2.f90: New testcase.
From-SVN: r118347
Diffstat (limited to 'gcc/fortran/match.c')
-rw-r--r-- | gcc/fortran/match.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/gcc/fortran/match.c b/gcc/fortran/match.c index 3f393856..5012c35 100644 --- a/gcc/fortran/match.c +++ b/gcc/fortran/match.c @@ -2327,16 +2327,19 @@ gfc_match_common (void) if (name[0] == '\0') { + if (gfc_current_ns->is_block_data) + { + gfc_warning ("BLOCK DATA unit cannot contain blank COMMON at %C"); + } t = &gfc_current_ns->blank_common; if (t->head == NULL) t->where = gfc_current_locus; - head = &t->head; } else { t = gfc_get_common (name, 0); - head = &t->head; } + head = &t->head; if (*head == NULL) tail = NULL; |