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
9edc6e4c
Commit
9edc6e4c
authored
Oct 14, 2014
by
DJ Delorie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More missed bits from the big __intN patch
From-SVN: r216222
parent
e1217ac7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
18 deletions
+21
-18
gcc/c/c-decl.c
+1
-4
gcc/cp/typeck.c
+20
-14
No files found.
gcc/c/c-decl.c
View file @
9edc6e4c
...
...
@@ -9711,10 +9711,7 @@ declspecs_add_type (location_t loc, struct c_declspecs *specs,
case
RID_INT_N_2
:
case
RID_INT_N_3
:
specs
->
int_n_idx
=
i
-
RID_INT_N_0
;
if
(
!
in_system_header_at
(
input_location
)
/* As a special exception, allow a type that's used
for __SIZE_TYPE__. */
&&
int_n_data
[
specs
->
int_n_idx
].
bitsize
!=
POINTER_SIZE
)
if
(
!
in_system_header_at
(
input_location
))
pedwarn
(
loc
,
OPT_Wpedantic
,
"ISO C does not support %<__int%d%> types"
,
int_n_data
[
specs
->
int_n_idx
].
bitsize
);
...
...
gcc/cp/typeck.c
View file @
9edc6e4c
...
...
@@ -365,20 +365,6 @@ cp_common_type (tree t1, tree t2)
:
long_long_integer_type_node
);
return
build_type_attribute_variant
(
t
,
attributes
);
}
for
(
i
=
0
;
i
<
NUM_INT_N_ENTS
;
i
++
)
{
if
(
int_n_enabled_p
[
i
]
&&
(
same_type_p
(
TYPE_MAIN_VARIANT
(
t1
),
int_n_trees
[
i
].
signed_type
)
||
same_type_p
(
TYPE_MAIN_VARIANT
(
t2
),
int_n_trees
[
i
].
signed_type
)))
{
tree
t
=
((
TYPE_UNSIGNED
(
t1
)
||
TYPE_UNSIGNED
(
t2
))
?
int_n_trees
[
i
].
unsigned_type
:
int_n_trees
[
i
].
signed_type
);
return
build_type_attribute_variant
(
t
,
attributes
);
}
}
/* Go through the same procedure, but for longs. */
if
(
same_type_p
(
TYPE_MAIN_VARIANT
(
t1
),
long_unsigned_type_node
)
...
...
@@ -392,6 +378,26 @@ cp_common_type (tree t1, tree t2)
?
long_unsigned_type_node
:
long_integer_type_node
);
return
build_type_attribute_variant
(
t
,
attributes
);
}
/* For __intN types, either the type is __int128 (and is lower
priority than the types checked above, but higher than other
128-bit types) or it's known to not be the same size as other
types (enforced in toplev.c). Prefer the unsigned type. */
for
(
i
=
0
;
i
<
NUM_INT_N_ENTS
;
i
++
)
{
if
(
int_n_enabled_p
[
i
]
&&
(
same_type_p
(
TYPE_MAIN_VARIANT
(
t1
),
int_n_trees
[
i
].
signed_type
)
||
same_type_p
(
TYPE_MAIN_VARIANT
(
t2
),
int_n_trees
[
i
].
signed_type
)
||
same_type_p
(
TYPE_MAIN_VARIANT
(
t1
),
int_n_trees
[
i
].
unsigned_type
)
||
same_type_p
(
TYPE_MAIN_VARIANT
(
t2
),
int_n_trees
[
i
].
unsigned_type
)))
{
tree
t
=
((
TYPE_UNSIGNED
(
t1
)
||
TYPE_UNSIGNED
(
t2
))
?
int_n_trees
[
i
].
unsigned_type
:
int_n_trees
[
i
].
signed_type
);
return
build_type_attribute_variant
(
t
,
attributes
);
}
}
/* Otherwise prefer the unsigned one. */
if
(
TYPE_UNSIGNED
(
t1
))
return
build_type_attribute_variant
(
t1
,
attributes
);
...
...
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