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
e2301a83
Commit
e2301a83
authored
Aug 01, 1992
by
Richard Stallman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(layout_record): Take account of
maximum_field_alignment when using the field's alignment. From-SVN: r1739
parent
88dd95c1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
1 deletions
+17
-1
gcc/stor-layout.c
+17
-1
No files found.
gcc/stor-layout.c
View file @
e2301a83
...
@@ -327,7 +327,13 @@ layout_record (rec)
...
@@ -327,7 +327,13 @@ layout_record (rec)
/* A named bit field of declared type `int'
/* A named bit field of declared type `int'
forces the entire structure to have `int' alignment. */
forces the entire structure to have `int' alignment. */
if
(
DECL_NAME
(
field
)
!=
0
)
if
(
DECL_NAME
(
field
)
!=
0
)
record_align
=
MAX
(
record_align
,
TYPE_ALIGN
(
TREE_TYPE
(
field
)));
{
int
type_align
=
TYPE_ALIGN
(
TREE_TYPE
(
field
));
if
(
maximum_field_alignment
!=
0
)
type_align
=
MIN
(
type_align
,
maximum_field_alignment
);
record_align
=
MAX
(
record_align
,
type_align
);
}
}
}
else
else
record_align
=
MAX
(
record_align
,
desired_align
);
record_align
=
MAX
(
record_align
,
desired_align
);
...
@@ -371,8 +377,15 @@ layout_record (rec)
...
@@ -371,8 +377,15 @@ layout_record (rec)
register
tree
dsize
=
DECL_SIZE
(
field
);
register
tree
dsize
=
DECL_SIZE
(
field
);
int
field_size
=
TREE_INT_CST_LOW
(
dsize
);
int
field_size
=
TREE_INT_CST_LOW
(
dsize
);
if
(
maximum_field_alignment
!=
0
)
type_align
=
MIN
(
type_align
,
maximum_field_alignment
);
/* A bit field may not span the unit of alignment of its type.
/* A bit field may not span the unit of alignment of its type.
Advance to next boundary if necessary. */
Advance to next boundary if necessary. */
/* ??? There is some uncertainty here as to what
should be done if type_align is less than the width of the type.
That can happen because the width exceeds BIGGEST_ALIGNMENT
or because it exceeds maximum_field_alignment. */
if
(
const_size
/
type_align
if
(
const_size
/
type_align
!=
(
const_size
+
field_size
-
1
)
/
type_align
)
!=
(
const_size
+
field_size
-
1
)
/
type_align
)
const_size
=
CEIL
(
const_size
,
type_align
)
*
type_align
;
const_size
=
CEIL
(
const_size
,
type_align
)
*
type_align
;
...
@@ -393,6 +406,9 @@ layout_record (rec)
...
@@ -393,6 +406,9 @@ layout_record (rec)
register
tree
dsize
=
DECL_SIZE
(
field
);
register
tree
dsize
=
DECL_SIZE
(
field
);
int
field_size
=
TREE_INT_CST_LOW
(
dsize
);
int
field_size
=
TREE_INT_CST_LOW
(
dsize
);
if
(
maximum_field_alignment
!=
0
)
type_align
=
MIN
(
type_align
,
maximum_field_alignment
);
/* A bit field may not span the unit of alignment of its type.
/* A bit field may not span the unit of alignment of its type.
Advance to next boundary if necessary. */
Advance to next boundary if necessary. */
if
(
const_size
/
type_align
if
(
const_size
/
type_align
...
...
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