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
ceb7983c
Commit
ceb7983c
authored
Oct 07, 1993
by
Richard Kenner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(force_to_mode): Sign-extend constant being truncated.
From-SVN: r5654
parent
7be2640d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
1 deletions
+12
-1
gcc/combine.c
+12
-1
No files found.
gcc/combine.c
View file @
ceb7983c
...
@@ -5614,7 +5614,18 @@ force_to_mode (x, mode, mask, reg)
...
@@ -5614,7 +5614,18 @@ force_to_mode (x, mode, mask, reg)
/* If X is a CONST_INT, return a new one. Do this here since the
/* If X is a CONST_INT, return a new one. Do this here since the
test below will fail. */
test below will fail. */
if
(
GET_CODE
(
x
)
==
CONST_INT
)
if
(
GET_CODE
(
x
)
==
CONST_INT
)
return
GEN_INT
(
INTVAL
(
x
)
&
mask
);
{
HOST_WIDE_INT
cval
=
INTVAL
(
x
)
&
mask
;
int
width
=
GET_MODE_BITSIZE
(
mode
);
/* If MODE is narrower that HOST_WIDE_INT and CVAL is a negative
number, sign extend it. */
if
(
width
>
0
&&
width
<
HOST_BITS_PER_WIDE_INT
&&
(
cval
&
((
HOST_WIDE_INT
)
1
<<
(
width
-
1
)))
!=
0
)
cval
|=
(
HOST_WIDE_INT
)
-
1
<<
width
;
return
GEN_INT
(
cval
);
}
/* If X is narrower than MODE, just get X in the proper mode. */
/* If X is narrower than MODE, just get X in the proper mode. */
if
(
GET_MODE_SIZE
(
GET_MODE
(
x
))
<
GET_MODE_SIZE
(
mode
))
if
(
GET_MODE_SIZE
(
GET_MODE
(
x
))
<
GET_MODE_SIZE
(
mode
))
...
...
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