(DO_GLOBAL_DTORS_BODY): Use an asm statement to keep the optimizer
authorRichard Kenner <kenner@gcc.gnu.org>
Fri, 28 Jul 1995 13:39:56 +0000 (09:39 -0400)
committerRichard Kenner <kenner@gcc.gnu.org>
Fri, 28 Jul 1995 13:39:56 +0000 (09:39 -0400)
from deleting an assignment that it is dead.

From-SVN: r10187

gcc/config/pa/pa.h

index 3f1504b02b3fc4b960a1781262fd904322887014..485dbbce1a889d2f839cf72c97505f38ab9cb9ac 100644 (file)
@@ -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)
-