This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Fix PR 18897 (bootstrap failure, hppa-hpux11)


PR 18897 reports bootstrap failure on hppa2.0w-hp-hpux11.11 (and
probably other PA/HPUX) due to missing .IMPORT directives.  This stems
from my earlier patch to prevent assemble_external from actually doing
anything before parsing reached the end of the file, so that silly things like

  extern void foo(void);
  extern inline void bar(void) { foo(); }
  extern void foo(void) __asm__ ("quux");

would work.  Right now all assemble_external operations are being
delayed until the beginning of cgraph_optimize.  However, if any calls
to assemble_external happen _after_ the beginning of cgraph_optimize,
they are also delayed, and since no one else flushes them, they never occur.

The simplest fix is to introduce another call to
process_pending_assemble_externals from toplev.c, just before the call
to targetm.asm_out.file_end.  It is likely that the call from
cgraph_optimize is now not necessary, but I'd rather not risk it at
this stage.

Bootstrapped hppa2.0w-hp-hpux11.11.  Since this fixes a bootstrap
failure I am checking it in despite not being able to tell if there
are regressions in the test suite.

zw

        PR 18897
        * toplev.c (compile_file): Call process_pending_assemble_externals
        just before targetm.asm_out.file_end.

===================================================================
Index: toplev.c
--- toplev.c	1 Dec 2004 16:46:25 -0000	1.934
+++ toplev.c	18 Dec 2004 06:36:47 -0000
@@ -1034,6 +1034,11 @@ compile_file (void)
 
   dw2_output_indirect_constants ();
 
+  /* Flush any pending external directives.  cgraph did this for
+     assemble_external calls from the front end, but the RTL
+     expander can also generate them.  */
+  process_pending_assemble_externals ();
+
   /* Attach a special .ident directive to the end of the file to identify
      the version of GCC which compiled this code.  The format of the .ident
      string is patterned after the ones produced by native SVR4 compilers.  */



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]