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
06038f12
Commit
06038f12
authored
Apr 18, 1993
by
Richard Stallman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(finish_struct): Promote unsigned bitfield to signed int
if the field isn't as wide as an int. From-SVN: r4178
parent
1815bfc2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
13 deletions
+17
-13
gcc/c-decl.c
+17
-13
No files found.
gcc/c-decl.c
View file @
06038f12
...
@@ -5260,19 +5260,23 @@ finish_struct (t, fieldlist)
...
@@ -5260,19 +5260,23 @@ finish_struct (t, fieldlist)
/* Promote each bit-field's type to int if it is narrower than that. */
/* Promote each bit-field's type to int if it is narrower than that. */
for
(
x
=
fieldlist
;
x
;
x
=
TREE_CHAIN
(
x
))
for
(
x
=
fieldlist
;
x
;
x
=
TREE_CHAIN
(
x
))
if
(
DECL_BIT_FIELD
(
x
)
if
(
DECL_BIT_FIELD
(
x
)
&&
C_PROMOTING_INTEGER_TYPE_P
(
TREE_TYPE
(
x
)))
&&
(
C_PROMOTING_INTEGER_TYPE_P
(
TREE_TYPE
(
x
))
{
||
DECL_FIELD_SIZE
(
x
)
<
TYPE_PRECISION
(
integer_type_node
)))
tree
type
=
TREE_TYPE
(
x
);
{
tree
type
=
TREE_TYPE
(
x
);
/* Preserve unsignedness if traditional or if not really any wider. */
if
(
TREE_UNSIGNED
(
type
)
/* Preserve unsignedness if traditional
&&
(
flag_traditional
or if not really getting any wider. */
||
(
TYPE_PRECISION
(
type
)
if
(
TREE_UNSIGNED
(
type
)
==
TYPE_PRECISION
(
integer_type_node
))))
&&
(
flag_traditional
TREE_TYPE
(
x
)
=
unsigned_type_node
;
||
else
(
TYPE_PRECISION
(
type
)
==
TYPE_PRECISION
(
integer_type_node
)
TREE_TYPE
(
x
)
=
integer_type_node
;
&&
}
DECL_FIELD_SIZE
(
x
)
==
TYPE_PRECISION
(
integer_type_node
))))
TREE_TYPE
(
x
)
=
unsigned_type_node
;
else
TREE_TYPE
(
x
)
=
integer_type_node
;
}
/* If this structure or union completes the type of any previous
/* If this structure or union completes the type of any previous
variable declaration, lay it out and output its rtl. */
variable declaration, lay it out and output its rtl. */
...
...
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