[arm-gnu] Possible bug in g++ frontend (G++ Lite arm-2009q1-203)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[arm-gnu] Possible bug in g++ frontend (G++ Lite arm-2009q1-203)



Hello,

I've downloaded this version of the compiler: arm-2009q1-203-arm-none-linux-gnueabi-i686-pc-linux-gnu.tar.bz2

I'm seeing different behavior with gcc and g++ when using a specs file. It looks like if I define the option -mfpu=vfp in the specs file, g++ cannot override it from the command line.

Here's my specs file:

-- gcc.specs --

%rename cc1 old_cc1

*cc1:
-march=armv7-a -mcpu=cortex-a8 -mfloat-abi=softfp -fno-omit-frame-pointer -fno-optimize-sibling-calls -Wno-poison-system-directories %(old_cc1)

%rename cc1plus old_cc1plus

*cc1plus:
-march=armv7-a -mcpu=cortex-a8 -mfpu=vfp -mfloat-abi=softfp -fno-omit-frame-pointer -fno-optimize-sibling-calls -Wno-poison-system-directories %(old_cc1plus)

-- gcc.specs --

My test application is just testing if I can compile some NEON intrinsic calls:

-- test.c/cpp --
#include <arm_neon.h>

int main()
{
        uint32x2_t a, b, c;
        uint16x4_t x, y, z;
        int16x4_t q, w, e;

        a = vadd_u32(b,c);

        x = vadd_u16(y, z);

        q = vqadd_s16 (w, e);

}
-- test.c/cpp --

When using gcc, it will compile:

$ bin/arm-none-linux-gnueabi-gcc -specs=./gcc.specs -mfloat-abi=softfp -mfpu=neon test.c

When using g++:

$ bin/arm-none-linux-gnueabi-g++ -specs=./gcc.specs -mfloat-abi=softfp -mfpu=neon test.cpp
In file included from int.cpp:1:
/home/kaltsi/tmp/cs/arm-2009q1/bin/../lib/gcc/arm-none-linux-gnueabi/4.3.3/include/arm_neon.h:35:2: error: #error You must enable NEON instructions (e.g. -mfloat-abi=softfp -mfpu=neon) to use arm_neon.h
int.cpp: In function 'int main()':
int.cpp:5: error: 'uint32x2_t' was not declared in this scope
int.cpp:5: error: expected `;' before 'a'
int.cpp:6: error: 'uint16x4_t' was not declared in this scope
int.cpp:6: error: expected `;' before 'x'
int.cpp:7: error: 'int16x4_t' was not declared in this scope
int.cpp:7: error: expected `;' before 'q'
int.cpp:9: error: 'a' was not declared in this scope
int.cpp:9: error: 'b' was not declared in this scope
int.cpp:9: error: 'c' was not declared in this scope
int.cpp:9: error: 'vadd_u32' was not declared in this scope
int.cpp:11: error: 'x' was not declared in this scope
int.cpp:11: error: 'y' was not declared in this scope
int.cpp:11: error: 'z' was not declared in this scope
int.cpp:11: error: 'vadd_u16' was not declared in this scope
int.cpp:13: error: 'q' was not declared in this scope
int.cpp:13: error: 'w' was not declared in this scope
int.cpp:13: error: 'e' was not declared in this scope
int.cpp:13: error: 'vqadd_s16' was not declared in this scope

If I leave out the -mfpu=vfp from the gcc.specs, then it will also compile with g++.

Cheers,

--
Juha Kallioinen