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
6cb70f0c
Commit
6cb70f0c
authored
Nov 19, 1994
by
Jim Wilson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(build_binary_op): Can shorten shift only if shift count
is less than size in bits of arg0. From-SVN: r8528
parent
03f36098
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
0 deletions
+4
-0
gcc/c-typeck.c
+4
-0
No files found.
gcc/c-typeck.c
View file @
6cb70f0c
...
@@ -2391,6 +2391,10 @@ build_binary_op (code, orig_op0, orig_op1, convert_p)
...
@@ -2391,6 +2391,10 @@ build_binary_op (code, orig_op0, orig_op1, convert_p)
unsigned_arg
=
TREE_UNSIGNED
(
TREE_TYPE
(
op0
));
unsigned_arg
=
TREE_UNSIGNED
(
TREE_TYPE
(
op0
));
if
(
TYPE_PRECISION
(
TREE_TYPE
(
arg0
))
<
TYPE_PRECISION
(
result_type
)
if
(
TYPE_PRECISION
(
TREE_TYPE
(
arg0
))
<
TYPE_PRECISION
(
result_type
)
/* We can shorten only if the shift count is less than the
number of bits in the smaller type size. */
&&
TREE_INT_CST_HIGH
(
op1
)
==
0
&&
TYPE_PRECISION
(
TREE_TYPE
(
arg0
))
>
TREE_INT_CST_LOW
(
op1
)
/* If arg is sign-extended and then unsigned-shifted,
/* If arg is sign-extended and then unsigned-shifted,
we can simulate this with a signed shift in arg's type
we can simulate this with a signed shift in arg's type
only if the extended result is at least twice as wide
only if the extended result is at least twice as wide
...
...
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