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
7a803dd8
Commit
7a803dd8
authored
Jul 02, 2008
by
Eric Botcazou
Committed by
Eric Botcazou
Jul 02, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* decl.c (make_type_from_size) <INTEGER_TYPE>: Fix typo and tidy up.
From-SVN: r137350
parent
a167a676
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
18 deletions
+23
-18
gcc/ada/ChangeLog
+4
-0
gcc/ada/decl.c
+19
-18
No files found.
gcc/ada/ChangeLog
View file @
7a803dd8
2008
-
07
-
02
Eric
Botcazou
<
ebotcazou
@
adacore
.
com
>
*
decl
.
c
(
make_type_from_size
)
<
INTEGER_TYPE
>:
Fix
typo
and
tidy
up
.
2008
-
06
-
27
Kaveh
R
.
Ghazi
<
ghazi
@
caip
.
rutgers
.
edu
>
*
ada
-
tree
.
h
(
SET_TYPE_LANG_SPECIFIC
,
SET_DECL_LANG_SPECIFIC
):
Fix
gcc/ada/decl.c
View file @
7a803dd8
...
...
@@ -7105,41 +7105,43 @@ set_rm_size (Uint uint_size, tree gnu_type, Entity_Id gnat_entity)
/* Given a type TYPE, return a new type whose size is appropriate for SIZE.
If TYPE is the best type, return it. Otherwise, make a new type. We
only support new integral and pointer types.
BIASED_P
is nonzero if
only support new integral and pointer types.
FOR_BIASED
is nonzero if
we are making a biased type. */
static
tree
make_type_from_size
(
tree
type
,
tree
size_tree
,
bool
biased_p
)
make_type_from_size
(
tree
type
,
tree
size_tree
,
bool
for_biased
)
{
tree
new_type
;
unsigned
HOST_WIDE_INT
size
;
bool
unsigned_p
;
bool
biased_p
;
tree
new_type
;
/* If size indicates an error, just return TYPE to avoid propagating
the
error. Likewise if it's too large to represent. */
/* If size indicates an error, just return TYPE to avoid propagating
the
error. Likewise if it's too large to represent. */
if
(
!
size_tree
||
!
host_integerp
(
size_tree
,
1
))
return
type
;
size
=
tree_low_cst
(
size_tree
,
1
);
switch
(
TREE_CODE
(
type
))
{
case
INTEGER_TYPE
:
case
ENUMERAL_TYPE
:
/* Only do something if the type is not already the proper size and is
not a packed array type. */
biased_p
=
(
TREE_CODE
(
type
)
==
INTEGER_TYPE
&&
TYPE_BIASED_REPRESENTATION_P
(
type
));
/* Only do something if the type is not a packed array type and
doesn't already have the proper size. */
if
(
TYPE_PACKED_ARRAY_TYPE_P
(
type
)
||
(
TYPE_PRECISION
(
type
)
==
size
&&
biased_p
==
(
TREE_CODE
(
type
)
==
INTEGER_CST
&&
TYPE_BIASED_REPRESENTATION_P
(
type
))))
||
(
TYPE_PRECISION
(
type
)
==
size
&&
biased_p
==
for_biased
))
break
;
biased_p
|=
(
TREE_CODE
(
type
)
==
INTEGER_TYPE
&&
TYPE_BIASED_REPRESENTATION_P
(
type
));
unsigned_p
=
TYPE_UNSIGNED
(
type
)
||
biased_p
;
biased_p
|=
for_biased
;
size
=
MIN
(
size
,
LONG_LONG_TYPE_SIZE
);
new_type
=
unsigned_p
?
make_unsigned_type
(
size
)
:
make_signed_type
(
size
);
if
(
TYPE_UNSIGNED
(
type
)
||
biased_p
)
new_type
=
make_unsigned_type
(
size
);
else
new_type
=
make_signed_type
(
size
);
TREE_TYPE
(
new_type
)
=
TREE_TYPE
(
type
)
?
TREE_TYPE
(
type
)
:
type
;
TYPE_MIN_VALUE
(
new_type
)
=
convert
(
TREE_TYPE
(
new_type
),
TYPE_MIN_VALUE
(
type
));
...
...
@@ -7164,7 +7166,6 @@ make_type_from_size (tree type, tree size_tree, bool biased_p)
if
(
TYPE_THIN_POINTER_P
(
type
)
&&
size
>=
POINTER_SIZE
*
2
)
return
build_pointer_type
(
TYPE_UNCONSTRAINED_ARRAY
(
TREE_TYPE
(
type
)));
break
;
default
:
...
...
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