[Bug c/88668] New: Code generated was different for PowerPC on Windows W.R.T Linux.

umesh.kalappa0 at gmail dot com gcc-bugzilla@gcc.gnu.org
Thu Jan 3 06:38:00 GMT 2019


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88668

            Bug ID: 88668
           Summary: Code generated was different for PowerPC on Windows
                    W.R.T Linux.
           Product: gcc
           Version: 8.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: umesh.kalappa0 at gmail dot com
  Target Milestone: ---

Hi All ,

Lets consider the below code

int foo()
{
  printf("Hello World");
}

On linux with configure like :
  --target=powerpc-linux-gnu --prefix=/usr/local/wind/tmp/compilers
--with-pkgversion=' GCC 8.1.0.0 - 2018.10.29' --disable-nls
--enable-languages=c,c++ --enable-targets=all --disable-multilib
--enable-threads --enable-tls --enable-__cxa_atexit --enable-secureplt

code generated like
addis 3,2,.LC0@toc@ha
addi 3,3,.LC0@toc@l

where offset  signed 32 bit used  relatively to  toc base  on linux as expected
 for the  medium code model . and the relocation entry will be generated by gas
 :
R_PPC64_TOC16_HA   and  R_PPC64_TOC16_LO

On windows with configure like :
--host i686-w64-mingw32 --target=powerpc-linux-gnu
--prefix=/usr/local/wind/tmp/compilers --with-pkgversion='GCC 8.1.0.0 -
2018.10.25' --disable-nls --enable-languages=c,c++ --enable-targets=all
--disable-multilib --enable-threads --enable-tls --enable-__cxa_atexit
--enable-secureplt

code generated like :
la 3,.LC0@toc(2)

where offset used  is signed 16  bit used  relatively to  toc base and the
relocation entry will be :
R_PPC64_TOC16  (signed 16 bit offset ).


More information about the Gcc-bugs mailing list