Bug 15382 - frontend too lenient when checking variable declarations
Summary: frontend too lenient when checking variable declarations
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: fortran (show other bugs)
Version: tree-ssa
: P2 normal
Target Milestone: 4.0.0
Assignee: Tobias Schlüter
URL:
Keywords: FIXME, ice-on-invalid-code
Depends on:
Blocks: 19292 20405
  Show dependency treegraph
 
Reported: 2004-05-11 17:44 UTC by Tobias Schlüter
Modified: 2005-11-13 06:29 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2005-06-28 01:18:29


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tobias Schlüter 2004-05-11 17:44:04 UTC
The following should issue an error in the frontend:
SUBROUTINE BARY()
COMMON /A/ X
EQUIVALENCE (X,Y)
REAL :: Y = 1.
DATA X /1./
PRINT *, X, Y
END
currently it fails with a fatal error in the backend:
[tobi@marktplatz tests]$ gfortran com.f90
com.f90: In function `bary':
com.f90:16: fatal error: gfc_todo: Not Implemented: initial values for COMMON or
EQUIVALENCE
compilation terminated.
[tobi@marktplatz tests]$
Comment 1 Andrew Pinski 2004-05-11 17:48:45 UTC
Confirmed.
Comment 2 Andrew Pinski 2004-09-15 03:18:56 UTC
Different error now:
pr15382.f90: In function `bary':
pr15382.f90:1: fatal error: gfc_todo: Not Implemented: Initialization of overlapping variables
compilation terminated.
Comment 3 Tobias Schlüter 2005-09-12 11:06:56 UTC
schluter@pcl247d:~/src/tests> ../gcc/build/gcc/f951 pr15083.f90                
 In file pr15083.f90:4

REAL :: Y = 1.
             1
Error: Initializer not allowed for COMMON variable 'y' at (1)

Execution times (seconds)
 TOTAL                 :   0.01             0.00             0.02              
 533 kB
Extra diagnostic checks enabled; compiler may run slowly.
Configure with --disable-checking to disable checks.
schluter@pcl247d:~/src/tests> 

This was fixed by Paul Thomas' recent patches for commons and equivalences.