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
ab29fdfc
Commit
ab29fdfc
authored
Mar 14, 1994
by
Richard Kenner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(convert_to_integer): Convert integer_one_node to proper type before
tree_int_cst_lt call. From-SVN: r6777
parent
ff3225e7
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
5 deletions
+7
-5
gcc/convert.c
+7
-5
No files found.
gcc/convert.c
View file @
ab29fdfc
...
@@ -170,9 +170,9 @@ convert_to_integer (type, expr)
...
@@ -170,9 +170,9 @@ convert_to_integer (type, expr)
else
if
(
outprec
>=
inprec
)
else
if
(
outprec
>=
inprec
)
return
build1
(
NOP_EXPR
,
type
,
expr
);
return
build1
(
NOP_EXPR
,
type
,
expr
);
/* Here detect when we can distribute the truncation down past some arithmetic.
/* Here detect when we can distribute the truncation down past some
For example, if adding two longs and converting to an int,
arithmetic. For example, if adding two longs and converting to an
we can equally well convert both to ints and then add.
int,
we can equally well convert both to ints and then add.
For the operations handled here, such truncation distribution
For the operations handled here, such truncation distribution
is always safe.
is always safe.
It is desirable in these cases:
It is desirable in these cases:
...
@@ -196,7 +196,9 @@ convert_to_integer (type, expr)
...
@@ -196,7 +196,9 @@ convert_to_integer (type, expr)
/* We can pass truncation down through right shifting
/* We can pass truncation down through right shifting
when the shift count is a nonpositive constant. */
when the shift count is a nonpositive constant. */
if
(
TREE_CODE
(
TREE_OPERAND
(
expr
,
1
))
==
INTEGER_CST
if
(
TREE_CODE
(
TREE_OPERAND
(
expr
,
1
))
==
INTEGER_CST
&&
tree_int_cst_lt
(
TREE_OPERAND
(
expr
,
1
),
integer_one_node
))
&&
tree_int_cst_lt
(
TREE_OPERAND
(
expr
,
1
),
convert
(
TREE_TYPE
(
TREE_OPERAND
(
expr
,
1
)),
integer_one_node
)))
goto
trunc1
;
goto
trunc1
;
break
;
break
;
...
@@ -204,7 +206,7 @@ convert_to_integer (type, expr)
...
@@ -204,7 +206,7 @@ convert_to_integer (type, expr)
/* We can pass truncation down through left shifting
/* We can pass truncation down through left shifting
when the shift count is a nonnegative constant. */
when the shift count is a nonnegative constant. */
if
(
TREE_CODE
(
TREE_OPERAND
(
expr
,
1
))
==
INTEGER_CST
if
(
TREE_CODE
(
TREE_OPERAND
(
expr
,
1
))
==
INTEGER_CST
&&
!
tree_int_cst_lt
(
TREE_OPERAND
(
expr
,
1
),
integer_zero_node
)
&&
tree_int_cst_sgn
(
TREE_OPERAND
(
expr
,
1
))
>=
0
&&
TREE_CODE
(
TYPE_SIZE
(
type
))
==
INTEGER_CST
)
&&
TREE_CODE
(
TYPE_SIZE
(
type
))
==
INTEGER_CST
)
{
{
/* If shift count is less than the width of the truncated type,
/* If shift count is less than the width of the truncated type,
...
...
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