From 06c9eb5136fe0e778cc3a643131eba2a3dfb77a8 Mon Sep 17 00:00:00 2001 From: Jan Hubicka Date: Mon, 10 Jan 2011 22:54:33 +0100 Subject: re PR lto/46083 (gcc.dg/initpri1.c FAILs with -flto/-fwhopr (attribute constructor/destructor doesn't work)) PR lto/46083 * lto-streamer-out.c (pack_ts_function_decl_value_fields): Store DECL_FINI_PRIORITY. * lto-streamer-in.c (unpack_ts_function_decl_value_fields): Restore DECL_FINI_PRIORITY. * gcc.dg/initpri3.c: New testcase. From-SVN: r168642 --- gcc/lto-streamer-in.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'gcc/lto-streamer-in.c') diff --git a/gcc/lto-streamer-in.c b/gcc/lto-streamer-in.c index 4fe9cdb..ba48cbb 100644 --- a/gcc/lto-streamer-in.c +++ b/gcc/lto-streamer-in.c @@ -1683,6 +1683,11 @@ unpack_ts_function_decl_value_fields (struct bitpack_d *bp, tree expr) DECL_DISREGARD_INLINE_LIMITS (expr) = (unsigned) bp_unpack_value (bp, 1); DECL_PURE_P (expr) = (unsigned) bp_unpack_value (bp, 1); DECL_LOOPING_CONST_OR_PURE_P (expr) = (unsigned) bp_unpack_value (bp, 1); + if (DECL_STATIC_DESTRUCTOR (expr)) + { + priority_type p = (priority_type) bp_unpack_value (bp, HOST_BITS_PER_SHORT); + SET_DECL_FINI_PRIORITY (expr, p); + } } -- cgit v1.1