ICE building a libsupc++ file, pdp11 target

U.Mutlu um@mutluit.com
Fri Jul 13 18:52:00 GMT 2018


Paul Koning wrote on 07/13/2018 08:27 PM:
> I'm trying to see if I can build the pdp11 target for languages other than just C, and the answer is for the most part yes.  But I' running into an ICE I can't figure out.  It's way before the back end comes into the picture as far as I can see, and there's nothing particularly strange looking in the input file that suggests anything.
>
> Any suggestions on where to look?  The failure is:
>
> libtool: compile:  /Users/pkoning/Documents/svn/buildpdp+/./gcc/xgcc -shared-libgcc -B/Users/pkoning/Documents/svn/buildpdp+/./gcc -nostdinc++ -L/Users/pkoning/Documents/svn/buildpdp+/pdp11-aout/libstdc++-v3/src -L/Users/pkoning/Documents/svn/buildpdp+/pdp11-aout/libstdc++-v3/src/.libs -L/Users/pkoning/Documents/svn/buildpdp+/pdp11-aout/libstdc++-v3/libsupc++/.libs -B/usr/local/pdp11-aout/pdp11-aout/bin/ -B/usr/local/pdp11-aout/pdp11-aout/lib/ -isystem /usr/local/pdp11-aout/pdp11-aout/include -isystem /usr/local/pdp11-aout/pdp11-aout/sys-include -I/Users/pkoning/Documents/svn/gcc/libstdc++-v3/../libgcc -I/Users/pkoning/Documents/svn/buildpdp+/pdp11-aout/libstdc++-v3/include/pdp11-aout -I/Users/pkoning/Documents/svn/buildpdp+/pdp11-aout/libstdc++-v3/include -I/Users/pkoning/Documents/svn/gcc/libstdc++-v3/libsupc++ -fno-implicit-templates -Wall -Wextra -Wwrite-strings -Wcast-qual -Wabi -fdiagnostics-show-location=once -frandom-seed=new_opa.lo -g -O2 -std=gnu++1z -c ../../../../gcc/lib
stdc++-v3/libsupc++/new_opa.cc -o new_opa.o
> cc1plus: warning: -Wabi won't warn about anything [-Wabi]
> cc1plus: note: -Wabi warns about differences from the most up-to-date ABI, which is also used by default
> cc1plus: note: use e.g. -Wabi=11 to warn about changes from GCC 7
> ../../../../gcc/libstdc++-v3/libsupc++/new_opa.cc:112:1: internal compiler error: in import_export_decl, at cp/decl2.c:2877
>   }
>   ^
> libbacktrace could not find executable to open
> Please submit a full bug report,
> with preprocessed source if appropriate.
> See <https://gcc.gnu.org/bugs/> for instructions.
> make[3]: *** [new_opa.lo] Error 1


It's failing at the last gcc_assert() below (file 
../gcc_src/gcc/cp/decl2.c:2877 ):


/* DECL is a FUNCTION_DECL or VAR_DECL.  If the object file linkage
    for DECL has not already been determined, do so now by setting
    DECL_EXTERNAL, DECL_COMDAT and other related flags.  Until this
    function is called entities with vague linkage whose definitions
    are available must have TREE_PUBLIC set.

    If this function decides to place DECL in COMDAT, it will set
    appropriate flags -- but will not clear DECL_EXTERNAL.  It is up to
    the caller to decide whether or not to clear DECL_EXTERNAL.  Some
    callers defer that decision until it is clear that DECL is actually
    required.  */

void
import_export_decl (tree decl)
{
   int emit_p;
   bool comdat_p;
   bool import_p;
   tree class_type = NULL_TREE;

   if (DECL_INTERFACE_KNOWN (decl))
     return;

   /* We cannot determine what linkage to give to an entity with vague
      linkage until the end of the file.  For example, a virtual table
      for a class will be defined if and only if the key method is
      defined in this translation unit.  As a further example, consider
      that when compiling a translation unit that uses PCH file with
      "-frepo" it would be incorrect to make decisions about what
      entities to emit when building the PCH; those decisions must be
      delayed until the repository information has been processed.  */
   gcc_assert (at_eof);
   /* Object file linkage for explicit instantiations is handled in
      mark_decl_instantiated.  For static variables in functions with
      vague linkage, maybe_commonize_var is used.

      Therefore, the only declarations that should be provided to this
      function are those with external linkage that are:

      * implicit instantiations of function templates

      * inline function

      * implicit instantiations of static data members of class
        templates

      * virtual tables

      * typeinfo objects

      Furthermore, all entities that reach this point must have a
      definition available in this translation unit.

      The following assertions check these conditions.  */
   gcc_assert (VAR_OR_FUNCTION_DECL_P (decl));
   /* Any code that creates entities with TREE_PUBLIC cleared should
      also set DECL_INTERFACE_KNOWN.  */
   gcc_assert (TREE_PUBLIC (decl));





More information about the Gcc mailing list