+2007-12-16 Jakub Jelinek <jakub@redhat.com>
+
+ PR bootstrap/34003
+ * c-decl.c (merge_decls): Copy RTL from olddecl to newdecl.
+ * config/pa/pa.c (pa_encode_section_info): If !first, preserve
+ SYMBOL_FLAG_REFERENCED flag.
+
2007-12-15 Alexandre Oliva <aoliva@redhat.com>
* tree.c (type_hash_add): Fix whitespace.
}
}
+ /* Keep the old rtl since we can safely use it. */
+ if (HAS_RTL_P (olddecl))
+ COPY_DECL_RTL (olddecl, newdecl);
/* Merge the type qualifiers. */
if (TREE_READONLY (newdecl))
static void
pa_encode_section_info (tree decl, rtx rtl, int first)
{
+ int old_referenced = 0;
+
+ if (!first && MEM_P (rtl) && GET_CODE (XEXP (rtl, 0)) == SYMBOL_REF)
+ old_referenced
+ = SYMBOL_REF_FLAGS (XEXP (rtl, 0)) & SYMBOL_FLAG_REFERENCED;
+
default_encode_section_info (decl, rtl, first);
if (first && TEXT_SPACE_P (decl))
if (TREE_CODE (decl) == FUNCTION_DECL)
hppa_encode_label (XEXP (rtl, 0));
}
+ else if (old_referenced)
+ SYMBOL_REF_FLAGS (XEXP (rtl, 0)) |= old_referenced;
}
/* This is sort of inverse to pa_encode_section_info. */
+2007-12-16 Jakub Jelinek <jakub@redhat.com>
+
+ PR bootstrap/34003
+ * gcc.dg/pr34003-1.c: New test.
+ * gcc.dg/pr34003-2.c: New.
+
2007-12-15 Hans-Peter Nilsson <hp@axis.com>
* gcc.target/cris/peep2-xsrand.c, gcc.target/cris/asmreg-1.c,
--- /dev/null
+/* PR bootstrap/34003 */
+/* { dg-do link } */
+/* { dg-options "-O0" } */
+/* { dg-additional-sources "pr34003-2.c" } */
+
+extern void foo (void);
+int bar (void) { foo (); return 1; }
+extern void foo (void);
--- /dev/null
+/* PR bootstrap/34003 */
+/* { dg-do compile } */
+/* { dg-options "-O0" } */
+
+extern void abort (void);
+
+int seen = 0;
+
+void foo (void)
+{
+ ++seen;
+}
+
+int main (void)
+{
+ extern int bar (void);
+ if (bar () != 1 || seen != 1)
+ abort ();
+ return 0;
+}