This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug optimization/14770] New: redundant store due to the fact that implicit set is not noticed
- From: "kazu at cs dot umass dot edu" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 29 Mar 2004 16:15:54 -0000
- Subject: [Bug optimization/14770] New: redundant store due to the fact that implicit set is not noticed
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Consider:
void foo (int);
void
bar (int a)
{
if (!a)
foo (0);
}
gcc with -Os -march=athlon-xp -fomit-frame-pointer generates
bar:
cmpl $0, 4(%esp)
jne .L1
movl $0, 4(%esp) <- redundant
jmp foo
.L1:
ret
Note that movl is redundant because we know that 4(%esp) contains 0.
With -O3 -march=athlon-xp -fomit-frame-pointer, I still get
the same "cmpl" at rtl level when gcse2 is run.
I wonder if we could notice implicit sets in gcse after reload.
--
Summary: redundant store due to the fact that implicit set is not
noticed
Product: gcc
Version: 3.5.0
Status: UNCONFIRMED
Keywords: pessimizes-code
Severity: enhancement
Priority: P2
Component: optimization
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: kazu at cs dot umass dot edu
CC: gcc-bugs at gcc dot gnu dot org
GCC target triplet: i686-pc-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14770