public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/52642] New: SH Target: libstdc++ failures due to call insn swapped before prologue frame insns
@ 2012-03-20 20:34 olegendo at gcc dot gnu.org
  2012-03-20 20:48 ` [Bug target/52642] " olegendo at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: olegendo at gcc dot gnu.org @ 2012-03-20 20:34 UTC (permalink / raw)
  To: gcc-bugs

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;
 }


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

* [Bug target/52642] SH Target: libstdc++ failures due to call insn swapped before prologue frame insns
  2012-03-20 20:34 [Bug target/52642] New: SH Target: libstdc++ failures due to call insn swapped before prologue frame insns olegendo at gcc dot gnu.org
@ 2012-03-20 20:48 ` olegendo at gcc dot gnu.org
  2012-03-21 22:42 ` olegendo at gcc dot gnu.org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: olegendo at gcc dot gnu.org @ 2012-03-20 20:48 UTC (permalink / raw)
  To: gcc-bugs

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

Oleg Endo <olegendo at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2012-03-20
     Ever Confirmed|0                           |1


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

* [Bug target/52642] SH Target: libstdc++ failures due to call insn swapped before prologue frame insns
  2012-03-20 20:34 [Bug target/52642] New: SH Target: libstdc++ failures due to call insn swapped before prologue frame insns olegendo at gcc dot gnu.org
  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
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: olegendo at gcc dot gnu.org @ 2012-03-21 22:42 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Oleg Endo <olegendo at gcc dot gnu.org> 2012-03-21 21:12:08 UTC ---
Just for the record...
I've committed the patch as rev 185616, but also messed up the ChangeLog /
commit message header, so it doesn't show up here.
(The ChangeLog entry is now fixed)


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

* [Bug target/52642] SH Target: libstdc++ failures due to call insn swapped before prologue frame insns
  2012-03-20 20:34 [Bug target/52642] New: SH Target: libstdc++ failures due to call insn swapped before prologue frame insns olegendo at gcc dot gnu.org
  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
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: olegendo at gcc dot gnu.org @ 2012-05-31 23:02 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Oleg Endo <olegendo at gcc dot gnu.org> 2012-05-31 23:01:22 UTC ---
Author: olegendo
Date: Thu May 31 23:01:13 2012
New Revision: 188087

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=188087
Log:
    Backport from mainline
    2012-03-21  Kaz Kojima  <kkojima@gcc.gnu.org>

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


Modified:
    branches/gcc-4_7-branch/gcc/ChangeLog
    branches/gcc-4_7-branch/gcc/config/sh/sh.c


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

* [Bug target/52642] SH Target: libstdc++ failures due to call insn swapped before prologue frame insns
  2012-03-20 20:34 [Bug target/52642] New: SH Target: libstdc++ failures due to call insn swapped before prologue frame insns olegendo at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  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
  5 siblings, 0 replies; 7+ messages in thread
From: olegendo at gcc dot gnu.org @ 2012-07-30  0:07 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Oleg Endo <olegendo at gcc dot gnu.org> 2012-07-30 00:07:26 UTC ---
Kaz, is it OK to close this issue?


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

* [Bug target/52642] SH Target: libstdc++ failures due to call insn swapped before prologue frame insns
  2012-03-20 20:34 [Bug target/52642] New: SH Target: libstdc++ failures due to call insn swapped before prologue frame insns olegendo at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  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
  5 siblings, 0 replies; 7+ messages in thread
From: kkojima at gcc dot gnu.org @ 2012-07-30  3:17 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Kazumoto Kojima <kkojima at gcc dot gnu.org> 2012-07-30 03:16:51 UTC ---
(In reply to comment #3)
> Kaz, is it OK to close this issue?

Yes.  Please go ahead.


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

* [Bug target/52642] SH Target: libstdc++ failures due to call insn swapped before prologue frame insns
  2012-03-20 20:34 [Bug target/52642] New: SH Target: libstdc++ failures due to call insn swapped before prologue frame insns olegendo at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2012-07-30  3:17 ` kkojima at gcc dot gnu.org
@ 2012-07-30  6:26 ` olegendo at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: olegendo at gcc dot gnu.org @ 2012-07-30  6:26 UTC (permalink / raw)
  To: gcc-bugs

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

Oleg Endo <olegendo at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED

--- Comment #5 from Oleg Endo <olegendo at gcc dot gnu.org> 2012-07-30 06:26:42 UTC ---
Fixed on 4.7 and 4.8


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

end of thread, other threads:[~2012-07-30  6:26 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-20 20:34 [Bug target/52642] New: SH Target: libstdc++ failures due to call insn swapped before prologue frame insns olegendo at gcc dot gnu.org
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

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).