From: Richard Kenner Date: Fri, 28 Jul 1995 13:39:56 +0000 (-0400) Subject: (DO_GLOBAL_DTORS_BODY): Use an asm statement to keep the optimizer X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=185496bb2b6bd071b15c42c681b0c3d60390bce0;p=gcc.git (DO_GLOBAL_DTORS_BODY): Use an asm statement to keep the optimizer from deleting an assignment that it is dead. From-SVN: r10187 --- diff --git a/gcc/config/pa/pa.h b/gcc/config/pa/pa.h index 3f1504b02b3..485dbbce1a8 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) -