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
2f4d1994
Commit
2f4d1994
authored
Jun 17, 2009
by
Ian Lance Taylor
Committed by
Ian Lance Taylor
Jun 17, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* decl.c (build_struct): Rewrite loop over constructor elements.
From-SVN: r148608
parent
4bc30529
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
16 deletions
+18
-16
gcc/fortran/ChangeLog
+4
-0
gcc/fortran/decl.c
+14
-16
No files found.
gcc/fortran/ChangeLog
View file @
2f4d1994
2009-06-16 Ian Lance Taylor <iant@google.com>
* decl.c (build_struct): Rewrite loop over constructor elements.
2009-06-16 Janus Weil <janus@gcc.gnu.org>
PR fortran/36947
...
...
gcc/fortran/decl.c
View file @
2f4d1994
...
...
@@ -1435,28 +1435,26 @@ build_struct (const char *name, gfc_charlen *cl, gfc_expr **init,
bool
has_ts
;
gfc_constructor
*
ctor
=
c
->
initializer
->
value
.
constructor
;
bool
first
=
true
;
int
first_len
;
has_ts
=
(
c
->
initializer
->
ts
.
cl
&&
c
->
initializer
->
ts
.
cl
->
length_from_typespec
);
for
(;
ctor
;
ctor
=
ctor
->
next
)
if
(
ctor
)
{
/* Remember the length of the first element for checking that
all elements *in the constructor* have the same length. This
need not be the length of the LHS! */
if
(
first
)
int
first_len
;
/* Remember the length of the first element for checking
that all elements *in the constructor* have the same
length. This need not be the length of the LHS! */
gcc_assert
(
ctor
->
expr
->
expr_type
==
EXPR_CONSTANT
);
gcc_assert
(
ctor
->
expr
->
ts
.
type
==
BT_CHARACTER
);
first_len
=
ctor
->
expr
->
value
.
character
.
length
;
for
(;
ctor
;
ctor
=
ctor
->
next
)
{
gcc_assert
(
ctor
->
expr
->
expr_type
==
EXPR_CONSTANT
);
gcc_assert
(
ctor
->
expr
->
ts
.
type
==
BT_CHARACTER
);
first_len
=
ctor
->
expr
->
value
.
character
.
length
;
first
=
false
;
if
(
ctor
->
expr
->
expr_type
==
EXPR_CONSTANT
)
gfc_set_constant_character_len
(
len
,
ctor
->
expr
,
has_ts
?
-
1
:
first_len
);
}
if
(
ctor
->
expr
->
expr_type
==
EXPR_CONSTANT
)
gfc_set_constant_character_len
(
len
,
ctor
->
expr
,
has_ts
?
-
1
:
first_len
);
}
}
}
...
...
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