summaryrefslogtreecommitdiffstats
path: root/contrib/gcc/varasm.c
diff options
context:
space:
mode:
authorobrien <obrien@FreeBSD.org>2001-03-24 01:58:31 +0000
committerobrien <obrien@FreeBSD.org>2001-03-24 01:58:31 +0000
commit83655f473eb53a186bdcf7f5f8f2927225bb39d0 (patch)
tree4e15b74819832174dd1510759ff5bf2e2cb921a9 /contrib/gcc/varasm.c
parentb2d278bd47d90165e571cf2b9529c2ef154c5c4a (diff)
downloadFreeBSD-src-83655f473eb53a186bdcf7f5f8f2927225bb39d0.zip
FreeBSD-src-83655f473eb53a186bdcf7f5f8f2927225bb39d0.tar.gz
Import the setjump/longjump exception handling fixes from GCC 2.95.3.test3
that were removed from GCC 2.95.3.test4 and the subsequent release due to problems on HP-UX. However, they work just fine on all the BSD's. W/o these patches the following program segmentation faults if compiled with -O2 (but not -Os or -O or -O0): #include <stdio.h> class A { public: A() { printf("c'tor A\n"); } ~A(){ printf("d'tor A\n"); } }; class foo : public A { public: foo() { printf("C'tor foo\n"); throw 8; } ~foo() { printf("D'tor foo\n"); } }; int main(){ try { foo fii; } catch (int){ printf("catch ...\n"); } return 0; }
Diffstat (limited to 'contrib/gcc/varasm.c')
-rw-r--r--contrib/gcc/varasm.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/contrib/gcc/varasm.c b/contrib/gcc/varasm.c
index b935065..56fe2ad 100644
--- a/contrib/gcc/varasm.c
+++ b/contrib/gcc/varasm.c
@@ -3494,6 +3494,18 @@ force_const_mem (mode, x)
pop_obstacks ();
}
+ if (GET_CODE (x) == LABEL_REF)
+ {
+ extern rtx forced_labels;
+
+ push_obstacks_nochange ();
+ rtl_in_saveable_obstack ();
+
+ forced_labels = gen_rtx_EXPR_LIST (VOIDmode,
+ XEXP (x, 0),
+ forced_labels);
+ pop_obstacks ();
+ }
/* Allocate a pool constant descriptor, fill it in, and chain it in. */
OpenPOWER on IntegriCloud