public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "olegendo at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/52642] New: SH Target: libstdc++ failures due to call insn swapped before prologue frame insns
Date: Tue, 20 Mar 2012 20:34:00 -0000	[thread overview]
Message-ID: <bug-52642-4@http.gcc.gnu.org/bugzilla/> (raw)

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

             Bug #: 52642
           Summary: SH Target: libstdc++ failures due to call insn swapped
                    before prologue frame insns
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: olegendo@gcc.gnu.org
                CC: kkojima@gcc.gnu.org
            Target: sh*-*-*


Carry over from PR 51244 comment #33 ...

Looking into the libstdc++ failures for sh4-unknown-linux-gnu,
it seems that the call insn was swapped before prologue frame insns
and then it makes unwinder confused.  -fno-delayed-branch also stops
that swapping for these failing cases.  The patch below works for me.

    * config/sh/sh.c (sh_expand_prologue): Emit blockage at the end
    of prologue for unwinder and profiler.

--- ORIG/trunk/gcc/config/sh/sh.c    2012-03-06 10:28:32.000000000 +0900
+++ trunk/gcc/config/sh/sh.c    2012-03-14 20:22:15.000000000 +0900
@@ -7234,6 +7234,13 @@ sh_expand_prologue (void)
       emit_insn (gen_shcompact_incoming_args ());
     }

+  /* If we are profiling, make sure no instructions are scheduled before
+     the call to mcount.  Similarly if some call instructions are swapped
+     before frame related insns, it'll make unwinder confused because
+     currently SH has no unwind info for function epilogues.  */
+  if (crtl->profile || flag_exceptions || flag_unwind_tables)
+    emit_insn (gen_blockage ());
+
   if (flag_stack_usage_info)
     current_function_static_stack_size = stack_usage;
 }


             reply	other threads:[~2012-03-20 20:32 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-20 20:34 olegendo at gcc dot gnu.org [this message]
2012-03-20 20:48 ` [Bug target/52642] " olegendo at gcc dot gnu.org
2012-03-21 22:42 ` olegendo at gcc dot gnu.org
2012-05-31 23:02 ` olegendo at gcc dot gnu.org
2012-07-30  0:07 ` olegendo at gcc dot gnu.org
2012-07-30  3:17 ` kkojima at gcc dot gnu.org
2012-07-30  6:26 ` olegendo at gcc dot gnu.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=bug-52642-4@http.gcc.gnu.org/bugzilla/ \
    --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).