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
08884e66
Commit
08884e66
authored
Nov 27, 2001
by
Richard Henderson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
New test.
From-SVN: r47370
parent
07e96fc6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
0 deletions
+43
-0
gcc/testsuite/gcc.c-torture/execute/20011126-2.c
+43
-0
No files found.
gcc/testsuite/gcc.c-torture/execute/20011126-2.c
0 → 100644
View file @
08884e66
/* Problem originally visible on ia64.
There is a partial redundancy of "in + 1" that makes GCSE want to
transform the final while loop to
p = in + 1;
tmp = p;
...
goto start;
top:
tmp = tmp + 1;
start:
in = tmp;
if (in < p) goto top;
We miscalculate the number of loop iterations as (p - tmp) = 0
instead of (p - in) = 1, which results in overflow in the doloop
optimization. */
static
const
char
*
test
(
const
char
*
in
,
char
*
out
)
{
while
(
1
)
{
if
(
*
in
==
'a'
)
{
const
char
*
p
=
in
+
1
;
while
(
*
p
==
'x'
)
++
p
;
if
(
*
p
==
'b'
)
return
p
;
while
(
in
<
p
)
*
out
++
=
*
in
++
;
}
}
}
int
main
()
{
char
out
[
4
];
test
(
"aab"
,
out
);
return
0
;
}
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