This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug optimization/14770] New: redundant store due to the fact that implicit set is not noticed


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]