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
d4c89139
Commit
d4c89139
authored
Sep 12, 1993
by
Per Bothner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(expand_expr, ARRAY_REF): Coerce low_bound to sizetype.
From-SVN: r5313
parent
59b22f64
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
2 deletions
+13
-2
gcc/expr.c
+13
-2
No files found.
gcc/expr.c
View file @
d4c89139
...
...
@@ -3889,9 +3889,20 @@ expand_expr (exp, target, tmode, modifier)
tree
index_type
=
TREE_TYPE
(
index
);
int
i
;
/* Optimize the special-case of a zero lower bound. */
/* Optimize the special-case of a zero lower bound.
We convert the low_bound to sizetype to avoid some problems
with constant folding. (E.g. suppose the lower bound is 1,
and its mode is QI. Without the conversion, (ARRAY
+(INDEX-(unsigned char)1)) becomes ((ARRAY+(-(unsigned char)1))
+INDEX), which becomes (ARRAY+255+INDEX). Oops!)
But sizetype isn't quite right either (especially if
the lowbound is negative). FIXME */
if
(
!
integer_zerop
(
low_bound
))
index
=
fold
(
build
(
MINUS_EXPR
,
index_type
,
index
,
low_bound
));
index
=
fold
(
build
(
MINUS_EXPR
,
index_type
,
index
,
convert
(
sizetype
,
low_bound
)));
if
(
TREE_CODE
(
index
)
!=
INTEGER_CST
||
TREE_CODE
(
TYPE_SIZE
(
type
))
!=
INTEGER_CST
)
...
...
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