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
03dc44a6
Commit
03dc44a6
authored
Sep 13, 1993
by
Richard Stallman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(store_constructor): Handle TREE_PURPOSE of array constructor.
(expand_expr, ARRAY_REF case): Likewise. From-SVN: r5315
parent
3181cbfd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
9 deletions
+32
-9
gcc/expr.c
+32
-9
No files found.
gcc/expr.c
View file @
03dc44a6
...
...
@@ -2720,19 +2720,41 @@ store_constructor (exp, target)
int
bitsize
;
int
bitpos
;
int
unsignedp
;
tree
index
=
TREE_PURPOSE
(
elt
);
rtx
xtarget
=
target
;
mode
=
TYPE_MODE
(
elttype
);
bitsize
=
GET_MODE_BITSIZE
(
mode
);
unsignedp
=
TREE_UNSIGNED
(
elttype
);
bitpos
=
(
i
*
TREE_INT_CST_LOW
(
TYPE_SIZE
(
elttype
)));
store_field
(
target
,
bitsize
,
bitpos
,
mode
,
TREE_VALUE
(
elt
),
/* The alignment of TARGET is
at least what its type requires. */
VOIDmode
,
0
,
TYPE_ALIGN
(
type
)
/
BITS_PER_UNIT
,
int_size_in_bytes
(
type
));
if
(
index
!=
0
&&
TREE_CODE
(
index
)
!=
INTEGER_CST
)
{
/* We don't currently allow variable indices in a
C initializer, but let's try here to support them. */
rtx
pos_rtx
,
addr
,
xtarget
;
tree
position
;
position
=
size_binop
(
MULT_EXPR
,
index
,
TYPE_SIZE
(
elttype
));
pos_rtx
=
expand_expr
(
position
,
0
,
VOIDmode
,
0
);
addr
=
gen_rtx
(
PLUS
,
Pmode
,
XEXP
(
target
,
0
),
pos_rtx
);
xtarget
=
change_address
(
target
,
mode
,
addr
);
store_expr
(
TREE_VALUE
(
elt
),
xtarget
,
0
);
}
else
{
if
(
index
!=
0
)
bitpos
=
(
TREE_INT_CST_LOW
(
index
)
*
TREE_INT_CST_LOW
(
TYPE_SIZE
(
elttype
)));
else
bitpos
=
(
i
*
TREE_INT_CST_LOW
(
TYPE_SIZE
(
elttype
)));
store_field
(
xtarget
,
bitsize
,
bitpos
,
mode
,
TREE_VALUE
(
elt
),
/* The alignment of TARGET is
at least what its type requires. */
VOIDmode
,
0
,
TYPE_ALIGN
(
type
)
/
BITS_PER_UNIT
,
int_size_in_bytes
(
type
));
}
}
}
...
...
@@ -4013,7 +4035,8 @@ expand_expr (exp, target, tmode, modifier)
{
tree
elem
=
CONSTRUCTOR_ELTS
(
init
);
while
(
elem
&&
i
--
)
while
(
elem
&&
!
tree_int_cst_equal
(
TREE_PURPOSE
(
elem
),
index
))
elem
=
TREE_CHAIN
(
elem
);
if
(
elem
)
return
expand_expr
(
fold
(
TREE_VALUE
(
elem
)),
target
,
...
...
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