[Bug target/96402] [10/11 Regression] Wrong code with -moutline-atomics

2020-08-03 Thread fab...@ritter-vogt.de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96402

Fabian Vogt  changed:

   What|Removed |Added

 CC||fab...@ritter-vogt.de

--- Comment #4 from Fabian Vogt  ---
FTR, this was originally reported as
https://bugzilla.opensuse.org/show_bug.cgi?id=1174753 with some more info:

> Assembly dump of CAS16 operation generated:
> 004006f0 <__aarch64_cas16_acq_rel>:
>   4006f0:   9110adrpx16, 42 
> <__libc_start_main@GLIBC_2.17>
>   4006f4:   3940e610ldrbw16, [x16, #57]
>   4006f8:   3470cbz w16, 400704 
> <__aarch64_cas16_acq_rel+0x14>
>   4006fc:   4860fc82caspal  x0, x1, x2, x3, [x4]
>   400700:   d65f03c0ret
>   400704:   aa0003f0mov x16, x0
>   400708:   aa0103f1mov x17, x1
>   40070c:   c87f8480ldaxp   x0, x1, [x4]
>   400710:   eb10001fcmp x0, x16
>   400714:   fa510020ccmpx1, x17, #0x0, eq  // eq = none
>   400718:   5461b.ne400724 <__aarch64_cas16_acq_rel+0x34> 
>  // b.any
>   40071c:   c82fc490stlxp   w15, x16, x17, [x4]
>   400720:   356fcbnzw15, 40070c 
> <__aarch64_cas16_acq_rel+0x1c>
>   400724:   d65f03c0ret
>   400728:   d503201fnop
>   40072c:   d503201fnop
> 
> CASPAL instruction (at 4006fc) would compare and read 2 64-bit values
> starting at memory specified in register x4 to values stored in x0 and x1,
> and if they compare equal, overwrite values stored at x4 with x2 and x3.
> 
> However the fallback instructions (starting at 40070c) writes x0 and x1
> (saved in x16 and x17 at 400704) to memory pointed by x4 rather than x2 and
> x3.

[Bug c/70830] New: ARM interrupt attribute: push/pop do not support {reglist}^

2016-04-27 Thread fab...@ritter-vogt.de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70830

Bug ID: 70830
   Summary: ARM interrupt attribute: push/pop do not support
{reglist}^
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: fab...@ritter-vogt.de
  Target Milestone: ---

Using attribute((interrupt)) on a function that accesses a local and a global
variable causes gcc to emit broken assembly. It needs to be "ldm" instead of
pop.


Code:

long *a;
__attribute__((interrupt)) void fn1() {
  for (int x; x;)
*(long *)8096384 = a[20 / x];
}

Output:

> >arm-none-eabi-gcc -c -Os test.c
> test.s: Assembler messages:
> test.s:47: Error: push/pop do not support {reglist}^ -- `pop 
> {r0,r1,r2,r3,pc}^'

[Bug c++/60691] New: Build fails in libstdc++ with --enable-sjlj-exceptions on ARM

2014-03-27 Thread fab...@ritter-vogt.de
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60691

Bug ID: 60691
   Summary: Build fails in libstdc++ with --enable-sjlj-exceptions
on ARM
   Product: gcc
   Version: 4.8.2
Status: UNCONFIRMED
  Severity: major
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: fab...@ritter-vogt.de

Created attachment 32468
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=32468&action=edit
Assembly produced if gcc invoked manually

I try to compile gcc with sjlj exceptions enabled, however, the build fails at
libstdc++. It's probably a gcc bug but it triggers an assertion in gas as well.

GCC command:

/opt/nspire/Ndless/ndless-sdk/toolchain/build/./gcc/xgcc -shared-libgcc
-B/opt/nspire/Ndless/ndless-sdk/toolchain/build/./gcc -nostdinc++
-L/opt/nspire/Ndless/ndless-sdk/toolchain/build/arm-none-eabi/libstdc++-v3/src
-L/opt/nspire/Ndless/ndless-sdk/toolchain/build/arm-none-eabi/libstdc++-v3/src/.libs
-B/opt/nspire/Ndless/ndless-sdk/toolchain/install/arm-none-eabi/bin/
-B/opt/nspire/Ndless/ndless-sdk/toolchain/install/arm-none-eabi/lib/ -isystem
/opt/nspire/Ndless/ndless-sdk/toolchain/install/arm-none-eabi/include -isystem
/opt/nspire/Ndless/ndless-sdk/toolchain/install/arm-none-eabi/sys-include
-I/opt/nspire/Ndless/ndless-sdk/toolchain/gcc-4.8.2/libstdc++-v3/../libgcc
-I/opt/nspire/Ndless/ndless-sdk/toolchain/build/arm-none-eabi/libstdc++-v3/include/arm-none-eabi
-I/opt/nspire/Ndless/ndless-sdk/toolchain/build/arm-none-eabi/libstdc++-v3/include
-I/opt/nspire/Ndless/ndless-sdk/toolchain/gcc-4.8.2/libstdc++-v3/libsupc++
-Wall -Wextra -Wwrite-strings -Wcast-qual -Wabi
-fdiagnostics-show-location=once -ffunction-sections -fdata-sections
-frandom-seed=eh_alloc.lo -mcpu=arm926ej-s -fpic -mlong-calls -c
../../../../gcc-4.8.2/libstdc++-v3/libsupc++/eh_alloc.cc -o eh_alloc.o

Output:

/tmp/cc6EsAB0.s: Assembler messages:
/tmp/cc6EsAB0.s:320: Error: missing .fnstart before unwinding directive
/tmp/cc6EsAB0.s:320: Error: duplicate .personality directive
/tmp/cc6EsAB0.s:321: Error: missing .fnstart before unwinding directive
/tmp/cc6EsAB0.s:321: Internal error!
Assertion failure in create_unwind_entry at
../../binutils-2.24/gas/config/tc-arm.c line 20915.
Please report this bug.

Sadly I can't give the commands gcc executes as this doesn't happen if I
execute the command manually. Probably other environment vars set in the GCC
Makefile. I attached the .s file gcc gives me with -s if I execute it manually,
maybe it's helpful.

GCC configure options:

--target=arm-none-eabi --prefix=$PREFIX --enable-interwork --disable-multilib
--enable-languages="c,c++" --enable-sjlj-exceptions --with-system-zlib
--with-newlib --disable-shared --with-gnu-as --with-gnu-ld --with-float=soft
--disable-werror

binutils configure options:

--target=arm-none-eabi --prefix=$PREFIX --enable-interwork --disable-multilib
--with-system-zlib --with-gnu-as --with-gnu-ld --disable-nls --with-float=soft
--disable-werror

I run make with CXXFLAGS_FOR_TARGET="-mcpu=arm926ej-s -fpic -mlong-calls"


[Bug c++/60691] Build fails in libstdc++ with --enable-sjlj-exceptions on ARM

2014-03-27 Thread fab...@ritter-vogt.de
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60691

--- Comment #2 from Fabian Vogt  ---
It crashes and produces weird results if linked to bFLT.
If SJLJ isn't supported for ARM, why does --enable-sjlj-exceptions still exist?


[Bug c++/60691] Build fails in libstdc++ with --enable-sjlj-exceptions on ARM

2014-04-02 Thread fab...@ritter-vogt.de
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60691

--- Comment #4 from Fabian Vogt  ---
(In reply to Andrew Pinski from comment #3)
> (In reply to Fabian Vogt from comment #2)
> > It crashes and produces weird results if linked to bFLT.
> 
> Yes because EABI is an elf only abi, if it does not have a place for the
> unwind tables, then it is incompatible with the ABI :).
Is it enough to put it (sorted/ordered) anywhere in the binary and point
__exidx_start (IIRC) and __exidx_end to the correct positions?

> >If SJLJ isn't supported for ARM, why does --enable-sjlj-exceptions still 
> >exist?
> 
> Because it is supported for some other targets, mainly windows based ones.

Hmm.. Windows RT? :P

Anyway, I had also reported the bug on binutils' bugzilla and the gas internal
error has been fixed. Nick even made a patch for gcc so it doesn't generate bad
asm anymore :-)

Bug report on gas: https://sourceware.org/bugzilla/show_bug.cgi?id=16765
Proposed patch: https://sourceware.org/bugzilla/attachment.cgi?id=7520


[Bug c++/61008] New: g++ crash in analyze_functions

2014-04-29 Thread fab...@ritter-vogt.de
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=61008

Bug ID: 61008
   Summary: g++ crash in analyze_functions
   Product: gcc
   Version: 4.9.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: fab...@ritter-vogt.de

Created attachment 32708
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=32708&action=edit
-save-temps

After I added the implementation of the BillboardRender constructor,
g++ crashes while compiling.

Command line:
/opt/nspire/Ndless/ndless-sdk/toolchain/install/bin/arm-none-eabi-g++
-mcpu=arm926ej-s -I /home/fabian/.ndless/include -I
/opt/nspire/Ndless/ndless-sdk/bin/../include -fPIC -fno-use-cxa-atexit
-fno-exceptions -fno-rtti -mlong-calls -D _TINSPIRE -std=c++11 -O3 -g -Wall -W
-marm -ffast-math -mcpu=arm926ej-s -fno-math-errno -fno-tree-vectorize
-fomit-frame-pointer -flto -c billboardrenderer.cpp -o billboardrenderer.o

arm-none-eabi-g++ -v:
Using built-in specs.
COLLECT_GCC=arm-none-eabi-g++
COLLECT_LTO_WRAPPER=/opt/nspire/Ndless/ndless-sdk/toolchain/install/lib/gcc/arm-none-eabi/4.9.0/lto-wrapper
Target: arm-none-eabi
Configured with: ../gcc-4.9.0/configure --target=arm-none-eabi
--prefix=/opt/nspire/Ndless/ndless-sdk/toolchain/install --enable-interwork
--enable-multilib --enable-languages=c,c++ --with-system-zlib --with-newlib
--with-headers=../newlib-2.0.0/newlib/libc/include --disable-shared
--with-gnu-as --with-gnu-ld --with-float=soft --disable-werror
Thread model: single
gcc version 4.9.0 (GCC)

Constructor:
BillboardRenderer::BillboardRenderer(std::map> map) : map(map)
{
}

I attached the files it generates with -save-temps.


[Bug c++/61008] g++ crash in analyze_functions

2014-04-29 Thread fab...@ritter-vogt.de
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=61008

--- Comment #1 from Fabian Vogt  ---
Created attachment 32711
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=32711&action=edit
-save-temps (assembler)


[Bug c++/61008] g++ crash in analyze_functions

2014-04-29 Thread fab...@ritter-vogt.de
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=61008

Fabian Vogt  changed:

   What|Removed |Added

  Attachment #32711|0   |1
is obsolete||

--- Comment #2 from Fabian Vogt  ---
Created attachment 32712
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=32712&action=edit
Preprocessed source


[Bug c++/61008] g++ crash in analyze_functions

2014-04-29 Thread fab...@ritter-vogt.de
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=61008

--- Comment #3 from Fabian Vogt  ---
Forgot to paste the output:
billboardrenderer.cpp:13:51: warning: unused parameter 'block'
[-Wunused-parameter]
 AABB BillboardRenderer::getAABB(const BLOCK_WDATA block, GLFix x, GLFix y,
GLFix z)
   ^
billboardrenderer.cpp:13:64: warning: unused parameter 'x' [-Wunused-parameter]
 AABB BillboardRenderer::getAABB(const BLOCK_WDATA block, GLFix x, GLFix y,
GLFix z)
^
billboardrenderer.cpp:13:73: warning: unused parameter 'y' [-Wunused-parameter]
 AABB BillboardRenderer::getAABB(const BLOCK_WDATA block, GLFix x, GLFix y,
GLFix z)
 ^
billboardrenderer.cpp:13:82: warning: unused parameter 'z' [-Wunused-parameter]
 AABB BillboardRenderer::getAABB(const BLOCK_WDATA block, GLFix x, GLFix y,
GLFix z)
   
  ^
cc1plus: internal compiler error: Segmentation fault
0x91c79f crash_signal
../../gcc-4.9.0/gcc/toplev.c:337
0x6b5252 analyze_functions
../../gcc-4.9.0/gcc/cgraphunit.c:1043
0x6b6204 finalize_compilation_unit()
../../gcc-4.9.0/gcc/cgraphunit.c:2326
0x56bd78 cp_write_global_declarations()
../../gcc-4.9.0/gcc/cp/decl2.c:4611
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See  for instructions.
make: *** [billboardrenderer.o] Error 1


[Bug lto/61048] New: compiling with -fsanitize=address crashes GCC if pointers are used

2014-05-03 Thread fab...@ritter-vogt.de
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=61048

Bug ID: 61048
   Summary: compiling with -fsanitize=address crashes GCC if
pointers are used
   Product: gcc
   Version: 4.9.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: lto
  Assignee: unassigned at gcc dot gnu.org
  Reporter: fab...@ritter-vogt.de

test.cpp:
include 
int main()
{
int *i = reinterpret_cast(0xC100);
std::cout << *i << std::endl;
}

Compile with:
arm-none-eabi-g++ test.cpp -c -o test.o -fsanitize=address -flto
Link with:
arm-none-eabi-g++ test.o -o test -Wl,-flto

arm-none-eabi-g++ -v:
Using built-in specs.
COLLECT_GCC=arm-none-eabi-g++
COLLECT_LTO_WRAPPER=/opt/nspire/Ndless/ndless-sdk/toolchain/install/lib/gcc/arm-none-eabi/4.9.0/lto-wrapper
Target: arm-none-eabi
Configured with: ../gcc-4.9.0/configure --target=arm-none-eabi
--prefix=/opt/nspire/Ndless/ndless-sdk/toolchain/install --enable-interwork
--enable-multilib --enable-languages=c,c++ --with-system-zlib --with-newlib
--with-headers=../newlib-2.0.0/newlib/libc/include --disable-shared
--with-gnu-as --with-gnu-ld --with-float=soft --disable-werror
Thread model: single
gcc version 4.9.0 (GCC)

Result:
lto1: internal compiler error: in streamer_get_builtin_tree, at
tree-streamer-in.c:1124
0x914191 streamer_get_builtin_tree(lto_input_block*, data_in*)
../../gcc-4.9.0/gcc/tree-streamer-in.c:1124
0x6f55d4 lto_input_tree_1(lto_input_block*, data_in*, LTO_tags, unsigned int)
../../gcc-4.9.0/gcc/lto-streamer-in.c:1265
0x6f57c1 lto_input_scc(lto_input_block*, data_in*, unsigned int*, unsigned
int*)
../../gcc-4.9.0/gcc/lto-streamer-in.c:1193
0x50375e lto_read_decls
../../gcc-4.9.0/gcc/lto/lto.c:1879
0x504ef5 lto_file_finalize
../../gcc-4.9.0/gcc/lto/lto.c:2214
0x504ef5 lto_create_files_from_ids
../../gcc-4.9.0/gcc/lto/lto.c:2224
0x504ef5 lto_file_read
../../gcc-4.9.0/gcc/lto/lto.c:2264
0x504ef5 read_cgraph_and_symbols
../../gcc-4.9.0/gcc/lto/lto.c:2967
0x504ef5 lto_main()
../../gcc-4.9.0/gcc/lto/lto.c:3412
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.
lto-wrapper:
/opt/nspire/Ndless/ndless-sdk/toolchain/install/bin/arm-none-eabi-g++ returned
1 exit status
/opt/nspire/Ndless/ndless-sdk/toolchain/install/arm-none-eabi/bin/ld.real:
lto-wrapper failed
collect2: error: ld returned 1 exit status

It compiles fine if I remove "-flto" (disregarding undefined references)


[Bug c++/60691] Build fails in libstdc++ with --enable-sjlj-exceptions on ARM

2014-12-12 Thread fab...@ritter-vogt.de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60691

--- Comment #6 from Fabian Vogt  ---
If sjlj exceptions are not supported for ARM, shouldn't the configure option be
invalid for ARM or at least print a warning?
If an option does exist and it simply crashes the compiler during make, it's
definitely broken and must be removed.