public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/14060] New: An unused register is saved to the stack.
@ 2004-02-07  6:25 kazu at cs dot umass dot edu
  2004-02-07  6:38 ` [Bug middle-end/14060] " kazu at cs dot umass dot edu
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: kazu at cs dot umass dot edu @ 2004-02-07  6:25 UTC (permalink / raw)
  To: gcc-bugs

/* 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


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2005-02-08 10:19 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-02-07  6:25 [Bug middle-end/14060] New: An unused register is saved to the stack kazu at cs dot umass dot edu
2004-02-07  6:38 ` [Bug middle-end/14060] " kazu at cs dot umass dot edu
2004-02-07  8:39 ` pinskia at gcc dot gnu dot org
2004-02-09 17:07 ` kazu at cs dot umass dot edu
2005-02-08 17:10 ` steven at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).