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
ad2e7dd0
Commit
ad2e7dd0
authored
Jul 26, 1994
by
Richard Kenner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(expand_expr, case ARRAY_REF): Don't fold L"foo"[2].
From-SVN: r7797
parent
ee7204ee
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
gcc/expr.c
+5
-2
No files found.
gcc/expr.c
View file @
ad2e7dd0
...
@@ -4340,13 +4340,16 @@ expand_expr (exp, target, tmode, modifier)
...
@@ -4340,13 +4340,16 @@ expand_expr (exp, target, tmode, modifier)
}
}
/* Fold an expression like: "foo"[2].
/* Fold an expression like: "foo"[2].
This is not done in fold so it won't happen inside &. */
This is not done in fold so it won't happen inside &.
Don't fold if this is for wide characters since it's too
difficult to do correctly and this is a very rare case. */
if
(
TREE_CODE
(
array
)
==
STRING_CST
if
(
TREE_CODE
(
array
)
==
STRING_CST
&&
TREE_CODE
(
index
)
==
INTEGER_CST
&&
TREE_CODE
(
index
)
==
INTEGER_CST
&&
!
TREE_INT_CST_HIGH
(
index
)
&&
!
TREE_INT_CST_HIGH
(
index
)
&&
(
i
=
TREE_INT_CST_LOW
(
index
))
<
TREE_STRING_LENGTH
(
array
)
&&
(
i
=
TREE_INT_CST_LOW
(
index
))
<
TREE_STRING_LENGTH
(
array
)
&&
GET_MODE_CLASS
(
mode
)
==
MODE_INT
)
&&
GET_MODE_CLASS
(
mode
)
==
MODE_INT
&&
GET_MODE_SIZE
(
mode
)
==
1
)
return
GEN_INT
(
TREE_STRING_POINTER
(
array
)[
i
]);
return
GEN_INT
(
TREE_STRING_POINTER
(
array
)[
i
]);
/* If this is a constant index into a constant array,
/* If this is a constant index into a constant array,
...
...
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