Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
riscv-gcc-1
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
riscv-gcc-1
Commits
1de8a836
Commit
1de8a836
authored
May 15, 2004
by
Victor Leikehman
Committed by
Paul Brook
May 15, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* decl.c (add_init_expr_to_sym): Check for variable size arrays.
From-SVN: r81894
parent
e2bb53e5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
1 deletions
+19
-1
gcc/fortran/ChangeLog
+4
-0
gcc/fortran/decl.c
+15
-1
No files found.
gcc/fortran/ChangeLog
View file @
1de8a836
2004-05-15 Victor Leikehman <lei@haifasphere.co.il>
* decl.c (add_init_expr_to_sym): Check for variable size arrays.
2004-05-15 Tobias Schlueter <tobias.schlueter@physik.uni-muenchen.de>
* primary.c (match_boz_constant): Use gfc_notify_std() for
...
...
gcc/fortran/decl.c
View file @
1de8a836
...
...
@@ -254,6 +254,7 @@ static try
add_init_expr_to_sym
(
const
char
*
name
,
gfc_expr
**
initp
,
locus
*
var_locus
)
{
int
i
;
symbol_attribute
attr
;
gfc_symbol
*
sym
;
gfc_expr
*
init
;
...
...
@@ -287,7 +288,7 @@ add_init_expr_to_sym (const char *name, gfc_expr ** initp,
else
{
/* If a variable appears in a DATA block, it cannot have an
initializer. */
initializer. */
if
(
sym
->
attr
.
data
)
{
gfc_error
...
...
@@ -301,6 +302,19 @@ add_init_expr_to_sym (const char *name, gfc_expr ** initp,
&&
gfc_check_assign_symbol
(
sym
,
init
)
==
FAILURE
)
return
FAILURE
;
for
(
i
=
0
;
i
<
sym
->
attr
.
dimension
;
i
++
)
{
if
(
sym
->
as
->
lower
[
i
]
==
NULL
||
sym
->
as
->
lower
[
i
]
->
expr_type
!=
EXPR_CONSTANT
||
sym
->
as
->
upper
[
i
]
==
NULL
||
sym
->
as
->
upper
[
i
]
->
expr_type
!=
EXPR_CONSTANT
)
{
gfc_error
(
"Array '%s' at %C cannot have initializer"
,
sym
->
name
);
return
FAILURE
;
}
}
/* Add initializer. Make sure we keep the ranks sane. */
if
(
sym
->
attr
.
dimension
&&
init
->
rank
==
0
)
init
->
rank
=
sym
->
as
->
rank
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment