Bug 61008 - g++ crash in analyze_functions
Summary: g++ crash in analyze_functions
Status: RESOLVED WORKSFORME
Alias: None
Product: gcc
Classification: Unclassified
Component: middle-end (show other bugs)
Version: 4.9.0
: P3 normal
Target Milestone: 4.9.4
Assignee: Not yet assigned to anyone
URL:
Keywords: ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2014-04-29 21:32 UTC by Fabian Vogt
Modified: 2017-06-22 15:38 UTC (History)
2 users (show)

See Also:
Host:
Target: arm-none-eabi
Build:
Known to work: 4.9.4
Known to fail:
Last reconfirmed:


Attachments
-save-temps (127 bytes, text/plain)
2014-04-29 21:32 UTC, Fabian Vogt
Details
-save-temps (assembler) (127 bytes, text/plain)
2014-04-29 21:34 UTC, Fabian Vogt
Details
Preprocessed source (95.32 KB, text/plain)
2014-04-29 21:35 UTC, Fabian Vogt
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Fabian Vogt 2014-04-29 21:32:46 UTC
Created attachment 32708 [details]
-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<uint8_t, std::tuple<unsigned int, unsigned int, const char*>> map) : map(map)
{
}

I attached the files it generates with -save-temps.
Comment 1 Fabian Vogt 2014-04-29 21:34:01 UTC
Created attachment 32711 [details]
-save-temps (assembler)
Comment 2 Fabian Vogt 2014-04-29 21:35:07 UTC
Created attachment 32712 [details]
Preprocessed source
Comment 3 Fabian Vogt 2014-04-29 21:36:47 UTC
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 <http://gcc.gnu.org/bugs.html> for instructions.
make: *** [billboardrenderer.o] Error 1
Comment 4 Ramana Radhakrishnan 2017-06-22 15:38:12 UTC
(In reply to Fabian Vogt from comment #3)
> 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 <http://gcc.gnu.org/bugs.html> for instructions.
> make: *** [billboardrenderer.o] Error 1

Works for me with gcc 4.9.4