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
138c94ea
Commit
138c94ea
authored
Jun 09, 1995
by
Richard Kenner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(left_shift): Ignore integer overflow.
From-SVN: r9915
parent
245391da
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
11 deletions
+5
-11
gcc/cexp.y
+5
-11
No files found.
gcc/cexp.y
View file @
138c94ea
...
...
@@ -898,21 +898,15 @@ left_shift (a, b)
struct constant *a;
unsigned long b;
{
/* It's unclear from the C standard whether shifts can overflow.
The following code ignores overflow; perhaps a C standard
interpretation ruling is needed. */
if (b >= HOST_BITS_PER_LONG)
{
if (! a->unsignedp && a->value != 0)
integer_overflow ();
return 0;
}
return 0;
else if (a->unsignedp)
return (unsigned long) a->value << b;
else
{
long l = a->value << b;
if (l >> b != a->value)
integer_overflow ();
return l;
}
return a->value << b;
}
static long
...
...
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