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
e6aef969
Commit
e6aef969
authored
Dec 08, 2004
by
Nathan Sidwell
Committed by
Nathan Sidwell
Dec 08, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* doc/trouble.texi (Non-bugs): Clarify empty loop removal.
From-SVN: r91864
parent
db24eb1f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
5 deletions
+30
-5
gcc/ChangeLog
+4
-0
gcc/doc/trouble.texi
+26
-5
No files found.
gcc/ChangeLog
View file @
e6aef969
2004
-
12
-
08
Nathan
Sidwell
<
nathan
@
codesourcery
.
com
>
*
doc
/
trouble
.
texi
(
Non
-
bugs
):
Clarify
empty
loop
removal
.
2004
-
12
-
08
Uros
Bizjak
<
uros
@
kss
-
loka
.
si
>
*
config
/
i386
/
i386
.
c
(
output_387_binary_op
,
...
...
gcc/doc/trouble.texi
View file @
e6aef969
...
...
@@ -1217,13 +1217,34 @@ to have a delay, so deleting them will not make real programs run any
faster
.
However
,
the
rationale
here
is
that
optimization
of
a
nonempty
loop
cannot
produce
an
empty
one
,
which
holds
for
C
but
is
not
always
the
case
for
C
++
.
cannot
produce
an
empty
one
.
This
held
for
carefully
written
C
compiled
with
less
powerful
optimizers
but
is
not
always
the
case
for
carefully
written
C
++
or
with
more
powerful
optimizers
.
@opindex
funroll
-
loops
Moreover
,
with
@option{
-
funroll
-
loops
}
small
``
empty
''
loops
are
already
removed
,
so
the
current
behavior
is
both
sub
-
optimal
and
inconsistent
and
will
change
in
the
future
.
Thus
GCC
will
remove
operations
from
loops
whenever
it
can
determine
those
operations
are
not
externally
visible
(
apart
from
the
time
taken
to
execute
them
,
of
course
).
As
GCC
improves
,
it
will
remove
the
loop
itself
.
Indeed
,
with
@option{
-
funroll
-
loops
}
small
loops
can
already
be
removed
,
so
leaving
an
empty
non
-
unrolled
loop
is
both
sub
-
optimal
and
inconsistent
.
Be
aware
of
this
when
performing
timing
tests
,
for
instance
the
following
loop
can
be
completely
removed
,
provided
@code{
some_expression
}
can
provably
not
change
any
global
state
.
@smallexample
@{
int
sum
=
0
;
int
ix
;
for
(
ix
=
0
;
ix
!=
10000
;
ix
++
)
sum
+=
some_expression
;
@
}
@end
smallexample
Even
though
@code{
sum
}
is
accumulated
in
the
loop
,
no
use
is
made
of
that
summation
,
so
the
accumulation
can
be
removed
.
@item
Making
side
effects
happen
in
the
same
order
as
in
some
other
compiler
.
...
...
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