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
3181cbfd
Commit
3181cbfd
authored
Sep 13, 1993
by
Richard Stallman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(output_constructor): Handle index value in
the TREE_PURPOSE, for array constructors. From-SVN: r5314
parent
d4c89139
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
4 deletions
+16
-4
gcc/varasm.c
+16
-4
No files found.
gcc/varasm.c
View file @
3181cbfd
...
@@ -3040,25 +3040,37 @@ output_constructor (exp, size)
...
@@ -3040,25 +3040,37 @@ output_constructor (exp, size)
field
=
field
?
TREE_CHAIN
(
field
)
:
0
)
field
=
field
?
TREE_CHAIN
(
field
)
:
0
)
{
{
tree
val
=
TREE_VALUE
(
link
);
tree
val
=
TREE_VALUE
(
link
);
tree
index
=
0
;
/* the element in a union constructor specifies the proper field. */
/* the element in a union constructor specifies the proper field. */
if
(
TREE_PURPOSE
(
link
)
!=
0
)
if
(
TREE_CODE
(
TREE_TYPE
(
exp
))
==
RECORD_TYPE
||
TREE_CODE
(
TREE_TYPE
(
exp
))
==
UNION_TYPE
)
field
=
TREE_PURPOSE
(
link
);
field
=
TREE_PURPOSE
(
link
);
if
(
TREE_CODE
(
TREE_TYPE
(
exp
))
==
ARRAY_TYPE
)
index
=
TREE_PURPOSE
(
link
);
/* Eliminate the marker that makes a cast not be an lvalue. */
/* Eliminate the marker that makes a cast not be an lvalue. */
if
(
val
!=
0
)
if
(
val
!=
0
)
STRIP_NOPS
(
val
);
STRIP_NOPS
(
val
);
if
(
field
==
0
||
!
DECL_BIT_FIELD
(
field
))
if
(
field
==
0
||
!
DECL_BIT_FIELD
(
field
))
{
{
/* An element that is not a bit-field. */
register
int
fieldsize
;
register
int
fieldsize
;
/* Since this structure is static,
/* Since this structure is static,
we know the positions are constant. */
we know the positions are constant. */
int
bitpos
=
(
field
?
(
TREE_INT_CST_LOW
(
DECL_FIELD_BITPOS
(
field
))
int
bitpos
=
(
field
?
(
TREE_INT_CST_LOW
(
DECL_FIELD_BITPOS
(
field
))
/
BITS_PER_UNIT
)
/
BITS_PER_UNIT
)
:
0
);
:
0
);
if
(
index
!=
0
)
bitpos
=
(
TREE_INT_CST_LOW
(
TYPE_SIZE
(
TREE_TYPE
(
val
)))
/
BITS_PER_UNIT
*
TREE_INT_CST_LOW
(
index
));
/* An element that is not a bit-field.
/* Output any buffered-up bit-fields preceding this element. */
Output any buffered-up bit-fields preceding it. */
if
(
byte_buffer_in_use
)
if
(
byte_buffer_in_use
)
{
{
ASM_OUTPUT_BYTE
(
asm_out_file
,
byte
);
ASM_OUTPUT_BYTE
(
asm_out_file
,
byte
);
...
@@ -3069,7 +3081,7 @@ output_constructor (exp, size)
...
@@ -3069,7 +3081,7 @@ output_constructor (exp, size)
/* Advance to offset of this element.
/* Advance to offset of this element.
Note no alignment needed in an array, since that is guaranteed
Note no alignment needed in an array, since that is guaranteed
if each element has the proper size. */
if each element has the proper size. */
if
(
field
!=
0
&&
bitpos
!=
total_bytes
)
if
(
(
field
!=
0
||
index
!=
0
)
&&
bitpos
!=
total_bytes
)
{
{
assemble_zeros
(
bitpos
-
total_bytes
);
assemble_zeros
(
bitpos
-
total_bytes
);
total_bytes
=
bitpos
;
total_bytes
=
bitpos
;
...
...
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