[PATCH, ARM] PR68674 Fix LTO support for neon builtin and error catching (ping)
Christian Bruel
christian.bruel@st.com
Thu Jan 7 10:31:00 GMT 2016
It seems that changing the arm_cpu_builtins code in arm-c.c to do:
cpp_undef (pfile, "__ARM_NEON_FP");
if (TARGET_NEON_FP)
builtin_define_with_int_value ("__ARM_NEON_FP", TARGET_NEON_FP);
instead of:
if (TARGET_NEON_FP)
builtin_define_with_int_value ("__ARM_NEON_FP", TARGET_NEON_FP);
else
cpp_undef (pfile, "__ARM_NEON_FP");
fixes this. I guess we should be undefing any macros before redefining them.I
>> I don't know, If we are going from v7 to v8, the __ARM_NEON_FP value indeed changes. The question is whether we want to hide this to the user ?
> Well, the user explicitly changed the fpu level with the pragma in the testcase, which rightly has the effect of
> changing the value of some predefines. I don't think warning is appropriate here, as long as the predefine
> has the right value in the right pragma scope.
>
note that the issue can be reproduced on the current trunc with the
default configure with
arm-none-eabi-gcc -mfloat-abi=softfp -mfpu=neon-fp-armv8
--------------------------------------------------
#pragma GCC target ("fpu=neon")
-------------------------------------------------
that gives:
warning: "__ARM_NEON_FP" redefined
<built-in>: note: this is the location of the previous definition
So I agree, the warning seems intuitively useless, but I'd just need to
mention :
iso/iec 99 A.3 and 6.10 (Preprocessing directives) #pragma is a
preprocessor directive
and iso/iec 99 6.10.3 (Macro Replacement)
also, you fix is slightly wrong, since the warning should be kept for
other explicit #define user redefinitions. And I think we shouldn't use
cpp_undef for that. It's better to use NODE_CONDITIONAL flags on the
macro identifier, since this is what it is.
I'd like to send a patch for this separately, so you can continue
reviewing this one independently of the decision
note that for the time being to make the patches independent the current
test can be fixed with
#if __ARM_ARCH==8
#pragma GCC target ("fpu=neon-fp-armv8")
#else
#pragma GCC target ("fpu=neon")
#endif
thanks for catching this with the aarch32 v8 validation. I'll add this
option to my validation scripts.
Cheers
More information about the Gcc-patches
mailing list