public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "j at uriah dot heep dot sax dot de" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/42240] wrong Epilog on nacked function
Date: Tue, 01 Dec 2009 16:58:00 -0000	[thread overview]
Message-ID: <20091201165835.26527.qmail@sourceware.org> (raw)
In-Reply-To: <bug-42240-18514@http.gcc.gnu.org/bugzilla/>



------- Comment #5 from j at uriah dot heep dot sax dot de  2009-12-01 16:58 -------
My first analysis shows that this is likely to be related to the
introduction of RTL prologues/epilogues in GCC 4.3.  GCC 4.2.2
has:

  if (avr_naked_function_p (current_function_decl))
    {
      fputs ("/* epilogue: naked */\n", file);
      goto out;
    }
...
 out:
  fprintf (file, "/* epilogue end (size=%d) */\n", epilogue_size);
  fprintf (file, "/* function %s size %d (%d) */\n", current_function_name (),
           prologue_size + function_size + epilogue_size, function_size);
  commands_in_file += prologue_size + function_size + epilogue_size;
  commands_in_prologues += prologue_size;
  commands_in_epilogues += epilogue_size;
}

GCC 4.3.4 has:

  /* epilogue: naked  */
  if (cfun->machine->is_naked)
    {
      emit_jump_insn (gen_return ());
      return;
    }

So apparently, emit_jump_insn (gen_return ()); is responsible for creating
the infinite loop.


-- 


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


  parent reply	other threads:[~2009-12-01 16:58 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-01 16:18 [Bug c/42240] New: " stefan dot dreyer at yahoo dot de
2009-12-01 16:19 ` [Bug c/42240] " stefan dot dreyer at yahoo dot de
2009-12-01 16:44 ` stefan dot dreyer at yahoo dot de
2009-12-01 16:45 ` stefan dot dreyer at yahoo dot de
2009-12-01 16:46 ` stefan dot dreyer at yahoo dot de
2009-12-01 16:58 ` j at uriah dot heep dot sax dot de [this message]
2009-12-01 19:21 ` [Bug target/42240] wrong epilogue on naked function a dot kaiser at gmx dot net
2009-12-01 19:38 ` a dot kaiser at gmx dot net
2009-12-01 22:50 ` a dot kaiser at gmx dot net
2010-07-22 11:26 ` anitha dot boyapati at atmel dot com
2010-07-26  6:49 ` anitha dot boyapati at atmel dot com
2010-07-26 17:37 ` eric dot weddington at atmel dot com
2010-07-26 17:41 ` [Bug target/42240] [4.3/4.4 Regression, avr] " eric dot weddington at atmel dot com
2010-07-27 11:35 ` anitha dot boyapati at atmel dot com
2010-07-31 10:22 ` [Bug target/42240] [4.3/4.4 Regression] " rguenth at gcc dot gnu dot org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20091201165835.26527.qmail@sourceware.org \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).