This is the mail archive of the gcc@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: A very "strange" bug in gcc 2.96


>>>>> "H" == H J Lu <hjl@lucon.org> writes:

    H> There is the ia32 asm ouput from gcc 2.96 with -O2. Please
    H> notice that

    H> 	jmp foo

    H> is generated, instead of

    H>         call foo leave ret

This is presumably due to the new sibling call optimization.

Richard, Jeff: I would very much appreciate your comments on this
issue.

    H> without -fPIC. With "jmp foo", it doesn't work anymore. If it
    H> is intentional, we should declare PIC is required for building
    H> shared libraries.

I think that using -fPIC should be required for building shared
libraries.

But, you are right that there is an issue here in that this does
change behavior relative to older versions of the compiler.  Perhaps
someone could clarify this piece of documentation from the gcc info
pages:

  `-shared'
       Produce a shared object which can then be linked with other
       objects to form an executable.  Not all systems support this
       option.  You must also specify `-fpic' or `-fPIC' on some systems
       when you specify this option.

as well as the descriptions of -fpic and -fPIC.

--
Mark Mitchell                   mark@codesourcery.com
CodeSourcery, LLC               http://www.codesourcery.com

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