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 middle-end/14060] New: An unused register is saved to the stack.


/* Use ./cc1 -mh -O2 -fomit-frame-pointer.  */

extern long bar (long, long *);

void
foo (long z)
{
  long a[2];

  a[0] = z;

  while (1)
    {
      if (bar (z, a))
	return;
    }
}

Note that er5 is saved but not used anywhere in the function.

_foo:
	mov.l	er4,@-er7
	mov.l	er5,@-er7
	subs	#4,er7
	subs	#4,er7
	mov.l	er0,er4
	mov.l	er0,@er7
.L2:
	mov.l	er7,er1
	mov.l	er4,er0
	jsr	@_bar
	mov.l	er0,er0
	beq	.L2
	adds	#4,er7
	adds	#4,er7
	mov.l	@er7+,er5
	mov.l	@er7+,er4
	rts

-- 
           Summary: An unused register is saved to the stack.
           Product: gcc
           Version: 3.5.0
            Status: UNCONFIRMED
          Keywords: pessimizes-code
          Severity: normal
          Priority: P2
         Component: middle-end
        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 host triplet: i686-pc-linux-gnu
GCC target triplet: h8300-elf


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14060


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