Fix for -fpic & sj/lj exceptions in egcs

Geoff Keating geoffk@cygnus.com
Wed Dec 8 10:59:00 GMT 1999


This patch makes gcc:

                === g++ Summary ===

# of expected passes            16899
# of unexpected failures        15
# of unexpected successes       3
# of expected failures          291
# of untested testcases         51

with targets 'unix unix/-fpic unix/-fPIC'.  The remaining failures are
related to virtual destructors and exception handling, and I think are
a generic C++ issue with sj/lj exceptions.

-- 
- Geoffrey Keating <geoffk@cygnus.com>

===File ~/patches/cygnus/egcs-nonlocal.patch================
Index: gcc/ChangeLog
===================================================================
RCS file: /cvs/gcc/egcs/gcc/ChangeLog,v
retrieving revision 1.5148
diff -p -u -r1.5148 ChangeLog
--- ChangeLog	1999/12/07 03:05:45	1.5148
+++ ChangeLog	1999/12/07 21:45:07
@@ -1,3 +1,9 @@
+1999-12-08  Geoff Keating  <geoffk@cygnus.com>
+
+	* config/rs6000/rs6000.md (nonlocal_goto_receiver): Turn into
+	define_expand/define_insn pair, and handle restore of the
+	SVR4 -fpic register.
+
 1999-12-06  David S. Miller  <davem@redhat.com>
 
 	* combine.c (check_promoted_subreg): Do not conditionalize this	upon
Index: gcc/config/rs6000/rs6000.md
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/rs6000/rs6000.md,v
retrieving revision 1.78
diff -p -u -r1.78 rs6000.md
--- rs6000.md	1999/12/04 03:00:03	1.78
+++ rs6000.md	1999/12/07 21:45:08
@@ -8016,7 +8016,24 @@
 
 ;; If we have -mminimal-toc, we need to reload r30 after a nonlocal goto.
 
-(define_insn "nonlocal_goto_receiver"
+(define_expand "nonlocal_goto_receiver"
+  [(unspec_volatile [(const_int 0)] 1)]
+  "(TARGET_TOC && TARGET_MINIMAL_TOC)
+   || ((DEFAULT_ABI == ABI_V4 || DEFAULT_ABI == ABI_SOLARIS) && flag_pic == 1)"
+  "
+{
+  if ((DEFAULT_ABI == ABI_V4 || DEFAULT_ABI == ABI_SOLARIS) && flag_pic == 1)
+  {
+    rtx temp = gen_reg_rtx (Pmode);
+    emit_insn (gen_init_v4_pic (temp));
+    emit_move_insn (gen_rtx_REG (Pmode, PIC_OFFSET_TABLE_REGNUM), temp);
+    DONE;
+  }
+}")
+
+;; If we have -mminimal-toc, we need to reload r30 after a nonlocal goto.
+
+(define_insn ""
   [(unspec_volatile [(const_int 0)] 1)]
   "TARGET_TOC && TARGET_MINIMAL_TOC"
   "*
============================================================


More information about the Gcc-patches mailing list