From: "H . J . Lu" <hjl@lucon.org>
To: Richard Henderson <rth@redhat.com>,
gcc@gcc.gnu.org, binutils@sourceware.cygnus.com,
linux-mips@oss.sgi.com
Subject: Re: DWARF2 exception doesn't work with gcc and gas on MIPS.
Date: Thu, 14 Jun 2001 11:41:17 -0700 [thread overview]
Message-ID: <20010614114117.A3092@lucon.org> (raw)
In-Reply-To: <20010614101951.B28824@redhat.com>; from rth@redhat.com on Thu, Jun 14, 2001 at 10:19:51AM -0700
On Thu, Jun 14, 2001 at 10:19:51AM -0700, Richard Henderson wrote:
>
> I could have sworn there was an exception_receiver pattern on mips
> to handle this, but I don't see it now. It's relatively easy to fix;
> see TARGET_LD_BUGGY_LDGP is handled on alpha.
>
Thanks. This patch seems to fix my problem. But I have several
questions:
1. Is the usage of current_frame_info.args_size right?
2. What should be in the place of [(const_int 4)]?
3. Does it need other patterns for similar situations?
4. Is my patch ok?
H.J.
----
2001-06-14 H.J. Lu <hjl@gnu.org>
* config/mips/mips.md (exception_receiver): New.
--- gcc/config/mips/mips.md.except Thu Jun 14 10:34:34 2001
+++ gcc/config/mips/mips.md Thu Jun 14 11:36:31 2001
@@ -10461,3 +10461,21 @@ ld\\t%2,%1-%S1(%2)\;daddu\\t%2,%2,$31\;j
[(set_attr "type" "arith")
(set_attr "mode" "DI")
(set_attr "length" "40")])
+
+;; For o32, the gp register is call clobbered, so it must
+;; be saved & restored around calls by the caller. If the call
+;; doesn't return normally (nonlocal goto, or an exception is
+;; thrown), then the code at the exception handler label must
+;; restore the gp register.
+(define_insn "exception_receiver"
+ [(const_int 4)]
+ "mips_abi == ABI_32"
+ "*
+{
+ static char ldgp[40];
+ sprintf (ldgp, \"lw\\t$gp,%ld($sp)\", current_frame_info.args_size);
+ return ldgp;
+}"
+ [(set_attr "type" "load")
+ (set_attr "mode" "SI")
+ (set_attr "length" "4")])
next prev parent reply other threads:[~2001-06-14 18:41 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-06-14 4:29 DWARF2 exception doesn't work with gcc and gas on MIPS H . J . Lu
2001-06-14 5:50 ` Ian Lance Taylor
2001-06-14 5:53 ` Ian Lance Taylor
2001-06-14 6:23 ` H . J . Lu
2001-06-14 17:19 ` Richard Henderson
2001-06-14 18:41 ` H . J . Lu [this message]
2001-06-14 19:05 ` Richard Henderson
2001-06-14 19:25 ` H . J . Lu
2001-06-14 19:42 ` Richard Henderson
2001-06-14 19:55 ` H . J . Lu
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=20010614114117.A3092@lucon.org \
--to=hjl@lucon.org \
--cc=binutils@sourceware.cygnus.com \
--cc=gcc@gcc.gnu.org \
--cc=linux-mips@oss.sgi.com \
--cc=rth@redhat.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.