This is the mail archive of the gcc-bugs@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]

Re: Constify IDENTIFIER_POINTER; reduce calls to get_identifier


The change 

        * varasm.c (make_function_rtl, make_decl_rtl): Rearrange code
        for comprehensibility.  Do not call get_identifier if we did
        not change the DECL_ASSEMBLER_NAME of the decl.  Use alloca to
        create temporary string constants, not ggc_alloc_string.  No
        need to copy result of ASM_FORMAT_PRIVATE_NAME.  Use const
        char * to hold IDENTIFIER_POINTERs.

fails bootstrap on NetBSD a.out architectures.

In NetBSD, prototypes of some functions such as setjmp are being
transformed by some preprocessor magic and finally ends up like

        int     setjmp  (jmp_buf)   __asm__("___setjmp14"  )  ;

After your patch to varasm.c, the "___setjmp14" symbolname is prefixed by
an extra "_", and thus prevent linkage of files containing setjmp.

So for the snipped below (as it looks like after preprocessing)

       typedef long jmp_buf[13 ]  ;
       int     setjmp  (jmp_buf)   __asm__("___setjmp14"  )  ;
       void
       foo(void)
       {
            setjmp(0);
       }

I get

       i386> nm x.o 
                U ____setjmp14
       00000000 t ___gnu_compiled_c
       00000000 T _foo
       00000000 t gcc2_compiled.

after the varasm.c change, instead of the expected

       i386> nm x.o 
       00000000 t ___gnu_compiled_c
                U ___setjmp14
       00000000 T _foo
       00000000 t gcc2_compiled.

   /Krister


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