public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/114132] New: [avr] Code sets up a frame pointer without need
@ 2024-02-27 14:27 gjl at gcc dot gnu.org
  2024-02-27 14:28 ` [Bug target/114132] " gjl at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: gjl at gcc dot gnu.org @ 2024-02-27 14:27 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114132

            Bug ID: 114132
           Summary: [avr] Code sets up a frame pointer without need
           Product: gcc
           Version: 13.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gjl at gcc dot gnu.org
  Target Milestone: ---

$ avr-gcc -S -Os -mmcu=attiny40 

of 

void funcab_c (long x, char c) {
}

sets up a frame-pointer without need.

Arguments x and c occupy all of the argument registers R25..R20, so that no arg
registers are left.  Then there is this implementation of
TARGET_FRAME_POINTER_REQUIRED in avr.cc:

static bool
avr_frame_pointer_required_p (void)
{
  return (cfun->calls_alloca
          || cfun->calls_setjmp
          || cfun->has_nonlocal_label
          || crtl->args.info.nregs == 0
          || get_frame_size () > 0);
}

Problem is that crtl->args.info.nregs == 0 does not discriminate between need
for arg pointer and no need for arg pointer (but all arg regs are used up, like
in the example).

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

end of thread, other threads:[~2024-02-29 17:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-27 14:27 [Bug target/114132] New: [avr] Code sets up a frame pointer without need gjl at gcc dot gnu.org
2024-02-27 14:28 ` [Bug target/114132] " gjl at gcc dot gnu.org
2024-02-29 17:47 ` cvs-commit at gcc dot gnu.org
2024-02-29 17:47 ` gjl at gcc dot gnu.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).