aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1995-07-28 09:39:56 -0400
committerRichard Kenner <kenner@gcc.gnu.org>1995-07-28 09:39:56 -0400
commit185496bb2b6bd071b15c42c681b0c3d60390bce0 (patch)
tree3dd6c2d62ee80100a567b6c1fd2b3224f21f482e /gcc
parentba11c17994a5aba402252e4a7d0e5c91cad0aea9 (diff)
downloadgcc-185496bb2b6bd071b15c42c681b0c3d60390bce0.zip
gcc-185496bb2b6bd071b15c42c681b0c3d60390bce0.tar.gz
gcc-185496bb2b6bd071b15c42c681b0c3d60390bce0.tar.bz2
(DO_GLOBAL_DTORS_BODY): Use an asm statement to keep the optimizer
from deleting an assignment that it is dead. From-SVN: r10187
Diffstat (limited to 'gcc')
-rw-r--r--gcc/config/pa/pa.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/gcc/config/pa/pa.h b/gcc/config/pa/pa.h
index 3f1504b..485dbbc 100644
--- a/gcc/config/pa/pa.h
+++ b/gcc/config/pa/pa.h
@@ -2190,13 +2190,17 @@ extern void hppa_encode_label ();
#endif
/* We want __gcc_plt_call to appear in every program built by
- gcc, so we make a reference to it out of __main. */
+ gcc, so we make a reference to it out of __main.
+ We use the asm statement to fool the optimizer into not
+ removing the dead (but important) initialization of
+ REFERENCE. */
+
#define DO_GLOBAL_DTORS_BODY \
do { \
extern void __gcc_plt_call (); \
void (*reference)() = &__gcc_plt_call; \
func_ptr *p; \
+ __asm__ ("" : : "r" (reference)); \
for (p = __DTOR_LIST__ + 1; *p; ) \
(*p++) (); \
} while (0)
-