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
8df06118
Commit
8df06118
authored
31 years ago
by
Richard Kenner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(layout_record): If the place where we were going to put a field
changed, lay it out again. From-SVN: r6793
parent
6e5bea54
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
6 deletions
+13
-6
gcc/stor-layout.c
+13
-6
No files found.
gcc/stor-layout.c
View file @
8df06118
...
...
@@ -309,6 +309,7 @@ layout_record (rec)
for
(
field
=
TYPE_FIELDS
(
rec
);
field
;
field
=
TREE_CHAIN
(
field
))
{
register
int
known_align
=
var_size
?
var_align
:
const_size
;
register
int
desired_align
;
/* If FIELD is static, then treat it like a separate variable,
...
...
@@ -328,14 +329,11 @@ layout_record (rec)
continue
;
/* Lay out the field so we know what alignment it needs.
For KNOWN_ALIGN, pass the number of bits from start of record
or some divisor of it. */
/* For a packed field, use the alignment as specified,
For a packed field, use the alignment as specified,
disregarding what the type would want. */
if
(
DECL_PACKED
(
field
))
desired_align
=
DECL_ALIGN
(
field
);
layout_decl
(
field
,
var_size
?
var_align
:
const_size
);
layout_decl
(
field
,
known_align
);
if
(
!
DECL_PACKED
(
field
))
desired_align
=
DECL_ALIGN
(
field
);
/* Some targets (i.e. VMS) limit struct field alignment
...
...
@@ -463,7 +461,16 @@ layout_record (rec)
else
if
(
var_size
)
DECL_FIELD_BITPOS
(
field
)
=
var_size
;
else
DECL_FIELD_BITPOS
(
field
)
=
size_int
(
const_size
);
{
DECL_FIELD_BITPOS
(
field
)
=
size_int
(
const_size
);
/* If this field ended up more aligned than we thought it
would be (we approximate this by seeing if its position
changed), lay out the field again; perhaps we can use an
integral mode for it now. */
if
(
known_align
!=
const_size
)
layout_decl
(
field
,
const_size
);
}
/* Now add size of this field to the size of the record. */
...
...
This diff is collapsed.
Click to expand it.
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