[Bug c++/92374] New: Unable to link relocatable object when GCC is configured with "--disable-comdat"

2019-11-05 Thread g.hoogewerf at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92374

Bug ID: 92374
   Summary: Unable to link relocatable object when GCC is
configured with "--disable-comdat"
   Product: gcc
   Version: 7.4.1
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: g.hoogewerf at gmail dot com
  Target Milestone: ---

Recent versions of GCC exhibit problems building relocatable objects when GCC
is configured with "--disable-comdat".  The easiest way to reproduce the
problem is to link libstdc++.a into a relocatable object:

> ./test/arm-none-eabi/bin/arm-none-eabi-ld -r --whole-archive 
> ./test/arm-none-eabi/arm-none-eabi/lib/libstdc++.a -o test.o

The following error occurs in that case:

> `.LC2' referenced in section 
> `.gnu.linkonce.t._ZNSt7__cxx1117moneypunct_bynameIwLb0EEC2EPKcj' of ./test
> /arm-none-eabi/arm-none-eabi/lib/libstdc++.a(cxx11-wlocale-inst.o): defined 
> in discarded section 
> `.gnu.linkonce.r._ZSt16__convert_from_vRKPiPciPKcz.str1.4' of 
> ./test/arm-none-eabi/arm-none-eabi/lib/libstdc++.a(cxx11-wlocale-inst.o)
> [more errors to follow]

GCC configuration info:

> ./test/arm-none-eabi/bin/arm-none-eabi-gcc -v
> Using built-in specs.
> COLLECT_GCC=./test/arm-none-eabi/bin/arm-none-eabi-gcc
> COLLECT_LTO_WRAPPER=/scratch/arm-none-eabi-newlib/test/arm-none-eabi\
> /libexec/gcc/arm-none-eabi/7.4.1/lto-wrapper
> Target: arm-none-eabi
> Configured with: /src/gcc/configure --prefix=/scratch/arm-none-eabi-newlib\
> /test/arm-none-eabi --build=i686-pc-linux-gnu --host=i686-pc-linux-gnu \
> --target=arm-none-eabi --enable-languages=c,c++ --disable-libssp \
> --disable-multilib --disable-comdat --disable-nls --disable-fixed-point \
> --disable-decimal-float --enable-__cxa_atexit --disable-lto \
> --with-newlib --with-sysroot=/scratch/arm-none-eabi-newlib/test\
> /arm-none-eabi/arm-none-eabi/libc
> Thread model: single
> gcc version 7.4.1 20191105 (GCC)

This issue is reproducible on gcc-7-branch and gcc-8-branch.  Trunk and the
gcc-9-branch seem to be unaffected.

[Bug c++/92374] Unable to link relocatable object when GCC is configured with "--disable-comdat"

2019-11-05 Thread g.hoogewerf at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92374

--- Comment #1 from GHoogewerf  ---
Created attachment 47174
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=47174&action=edit
Proposed fix for gcc-7-branch

This patch seems to address the issue in the gcc-7-branch.

[Bug c++/92374] Unable to link relocatable object when GCC is configured with "--disable-comdat"

2019-11-06 Thread g.hoogewerf at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92374

--- Comment #3 from GHoogewerf  ---
I'm using a module loader/linker (ELF) that can't handle comdat groups.  The
provided example is just a way to demonstrate the problem in a different way.

Since the "--disable-comdat" option exists in recent versions of GCC, I figured
it'd still be supported.  I don't mind if this won't get fixed, I just wanted
to share what I found.

Thanks,

[Bug target/70894] New: ICE when using neon intrinsic with mabi=apcs-gnu

2016-05-01 Thread g.hoogewerf at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70894

Bug ID: 70894
   Summary: ICE when using neon intrinsic with mabi=apcs-gnu
   Product: gcc
   Version: 5.3.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: g.hoogewerf at gmail dot com
  Target Milestone: ---

The following test case triggers an ICE on several versions of GCC, including
5.3.0 and 4.9.3.

void crashFunction(unsigned char val)
{
__builtin_neon_vdup_nv16qi ((__builtin_neon_qi) val);
}


To trigger the ICE, the source should be compiled with:
arm-none-eabi-gcc -c neon.c -mfpu=neon -mfloat-abi=softfp -mabi=apcs-gnu


When running with -v -save-temps, the output is:

Using built-in specs.
COLLECT_GCC=./GccBuild/build/arm-none-eabi-newlib/tools/i686-pc-linux-gnu/arm-none-eabi/bin/arm-none-eabi-gcc
Target: arm-none-eabi
Configured with: /home/ghoogewerf/GccBuild/src/gcc/configure
--prefix=/home/ghoogewerf/GccBuild/build/arm-none-eabi-newlib/tools/i686-pc-linux-gnu/arm-none-eabi
--build=i686-pc-linux-gnu --host=i686-pc-linux-gnu --target=arm-none-eabi
--enable-languages=c,c++ --disable-libssp --disable-multilib --disable-nls
--disable-fixed-point --disable-decimal-float --disable-lto --with-newlib
--with-headers=/home/ghoogewerf/GccBuild/src/newlib/newlib/libc/include
Thread model: single
gcc version 5.3.0 (GCC) 
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-c' '-mfpu=neon' '-mfloat-abi=softfp'
'-mabi=apcs-gnu'

/home/ghoogewerf/GccBuild/build/arm-none-eabi-newlib/tools/i686-pc-linux-gnu/arm-none-eabi/libexec/gcc/arm-none-eabi/5.3.0/cc1
-E -quiet -v -D__USES_INITFINI__ neon.c -mfpu=neon -mfloat-abi=softfp
-mabi=apcs-gnu -fpch-preprocess -o neon.i
#include "..." search starts here:
#include <...> search starts here:

/home/ghoogewerf/GccBuild/build/arm-none-eabi-newlib/tools/i686-pc-linux-gnu/arm-none-eabi/lib/gcc/arm-none-eabi/5.3.0/include

/home/ghoogewerf/GccBuild/build/arm-none-eabi-newlib/tools/i686-pc-linux-gnu/arm-none-eabi/lib/gcc/arm-none-eabi/5.3.0/include-fixed

/home/ghoogewerf/GccBuild/build/arm-none-eabi-newlib/tools/i686-pc-linux-gnu/arm-none-eabi/lib/gcc/arm-none-eabi/5.3.0/../../../../arm-none-eabi/sys-include

/home/ghoogewerf/GccBuild/build/arm-none-eabi-newlib/tools/i686-pc-linux-gnu/arm-none-eabi/lib/gcc/arm-none-eabi/5.3.0/../../../../arm-none-eabi/include
End of search list.
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-c' '-mfpu=neon' '-mfloat-abi=softfp'
'-mabi=apcs-gnu'

/home/ghoogewerf/GccBuild/build/arm-none-eabi-newlib/tools/i686-pc-linux-gnu/arm-none-eabi/libexec/gcc/arm-none-eabi/5.3.0/cc1
-fpreprocessed neon.i -quiet -dumpbase neon.c -mfpu=neon -mfloat-abi=softfp
-mabi=apcs-gnu -auxbase neon -version -o neon.s
GNU C11 (GCC) version 5.3.0 (arm-none-eabi)
compiled by GNU C version 5.3.0, GMP version 6.1.0, MPFR version 3.1.3,
MPC version 1.0.3
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
GNU C11 (GCC) version 5.3.0 (arm-none-eabi)
compiled by GNU C version 5.3.0, GMP version 6.1.0, MPFR version 3.1.3,
MPC version 1.0.3
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 46d53ae1749a0f498e12cc1c3bd3e85f
neon.c: In function 'crashFunction':
neon.c:4:5: internal compiler error: in copy_to_mode_reg, at explow.c:617
 __builtin_neon_vdup_nv16qi ((__builtin_neon_qi) val);
 ^
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.


Thanks,
G. Hoogewerf

[Bug target/82811] New: Assembler error on tic6x-none-elf with march=c64x+

2017-11-02 Thread g.hoogewerf at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82811

Bug ID: 82811
   Summary: Assembler error on tic6x-none-elf with march=c64x+
   Product: gcc
   Version: 7.2.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: target
  Assignee: unassigned at gcc dot gnu.org
  Reporter: g.hoogewerf at gmail dot com
  Target Milestone: ---

The following test case triggers an error on several versions of GCC, including
7.2.0 and 4.9.4. I tried several versions of binutils, including 2.20 and
2.26.1.

long long test(long long a, long long b)
{
long long c = 0;

c |= ((a & 0x) <<  0);
c |= (b << 16);

return c;
}

To trigger the error, the source should be compiled with: "-march=c64x+ -O2".
The error does not occur when building with "-march=c67x+".

When running with -v -save-temps, the output is:

Using built-in specs.
COLLECT_GCC=./tools/i686-pc-linux-gnu/tic6x-none-elf/bin/tic6x-none-elf-gcc
Target: tic6x-none-elf
Configured with: /home/ghoogewerf/GccBuild/src/gcc/configure
--prefix=/home/ghoogewerf/GccBuild/build/tic6x-none-elf-newlib/tools/i686-pc-linux-gnu/tic6x-none-elf
--build=i686-pc-linux-gnu --host=i686-pc-linux-gnu --target=tic6x-none-elf
--enable-languages=c,c++ --disable-libssp --disable-wchar_t --disable-multilib
--with-pkgversion='Test G++ 7.2.0-p3' --disable-nls --disable-fixed-point
--disable-decimal-float --with-arch=c64x+ --disable-lto --with-newlib
--with-headers=/home/ghoogewerf/GccBuild/src/newlib/newlib/libc/include
Thread model: single
gcc version 7.2.0 (Test G++ 7.2.0-p3) 
COLLECT_GCC_OPTIONS='-c' '-O2' '-Wall' '-Wextra' '-march=c64x+' '-v'
'-save-temps'

/home/ghoogewerf/GccBuild/build/tic6x-none-elf-newlib/tools/i686-pc-linux-gnu/tic6x-none-elf/libexec/gcc/tic6x-none-elf/7.2.0/cc1
-E -quiet -v pack.c -march=c64x+ -Wall -Wextra -O2 -fpch-preprocess -o pack.i
#include "..." search starts here:
#include <...> search starts here:

/home/ghoogewerf/GccBuild/build/tic6x-none-elf-newlib/tools/i686-pc-linux-gnu/tic6x-none-elf/lib/gcc/tic6x-none-elf/7.2.0/include

/home/ghoogewerf/GccBuild/build/tic6x-none-elf-newlib/tools/i686-pc-linux-gnu/tic6x-none-elf/lib/gcc/tic6x-none-elf/7.2.0/include-fixed

/home/ghoogewerf/GccBuild/build/tic6x-none-elf-newlib/tools/i686-pc-linux-gnu/tic6x-none-elf/lib/gcc/tic6x-none-elf/7.2.0/../../../../tic6x-none-elf/sys-include

/home/ghoogewerf/GccBuild/build/tic6x-none-elf-newlib/tools/i686-pc-linux-gnu/tic6x-none-elf/lib/gcc/tic6x-none-elf/7.2.0/../../../../tic6x-none-elf/include
End of search list.
COLLECT_GCC_OPTIONS='-c' '-O2' '-Wall' '-Wextra' '-march=c64x+' '-v'
'-save-temps'

/home/ghoogewerf/GccBuild/build/tic6x-none-elf-newlib/tools/i686-pc-linux-gnu/tic6x-none-elf/libexec/gcc/tic6x-none-elf/7.2.0/cc1
-fpreprocessed pack.i -quiet -dumpbase pack.c -march=c64x+ -auxbase pack -O2
-Wall -Wextra -version -o pack.s
GNU C11 (Test G++ 7.2.0-p3) version 7.2.0 (tic6x-none-elf)
compiled by GNU C version 4.9.4, GMP version 6.1.0, MPFR version 3.1.3,
MPC version 1.0.3, isl version none
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
GNU C11 (Test G++ 7.2.0-p3) version 7.2.0 (tic6x-none-elf)
compiled by GNU C version 4.9.4, GMP version 6.1.0, MPFR version 3.1.3,
MPC version 1.0.3, isl version none
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: f86a3322b854da36fc325771f0c6992e
COLLECT_GCC_OPTIONS='-c' '-O2' '-Wall' '-Wextra' '-march=c64x+' '-v'
'-save-temps'

/home/ghoogewerf/GccBuild/build/tic6x-none-elf-newlib/tools/i686-pc-linux-gnu/tic6x-none-elf/lib/gcc/tic6x-none-elf/7.2.0/../../../../tic6x-none-elf/bin/as
-march=c64x+ -o pack.o pack.s
pack.s: Assembler messages:
pack.s:15: Error: operand 1 of 'pack2' on wrong side

Thanks,
G. Hoogewerf