CCSTUDIO: Probable compiler issue on signed comparaison

Part Number: CCSTUDIO
Other Parts Discussed in Thread: RM48L952

Hello,

 

We are using a RM48L952.

We are using ti-cgt-arm_20.2.7.LTS to compile. (from CCS 12.8.1)

Compiler flags are:

-mv7R4 --code_state=32 --float_support=VFPv3D16 -me -c --c99 -pdew --diag_warning=225 --diag_wrap=off --display_error_number --enum_type=packed --abi=eabi -I$(BUILD_INCLUDE_PATH) -g -Ooff --define=DEBUG_USAGE --define=CCS --diag_suppress=2104 --define=_RM48x_

We have a simple test case to compare 2 signed int which fails.

For example, this:

if( ( S_DidInfo.s32_Min > s32_DataAsInt ) || ( S_DidInfo.s32_Max < s32_DataAsInt ) )
 
This test is used to check if the value is in the range.
For which you have a structure S_DidInfo with MIn and Max field as signed long, and s32_DataAsInt a variable also as signed long.
We have a basic function case for which min is -25000 and max is 25000, and the s32_DataAsInt is equal to 0.
So we have:
( -25000 > 0 ) || ( 25000 < 0 ), and the result of this if test is TRUE.
I cannot explain this behavior.
Is there an know issue on signed comparaison for the version ti-cgt-arm_20.2.7.LTS?
Any advice or comment on that?
I have added the debug info, we can see the R0=0xFFFF9E58 (-25000) and R12 = 0. The screen is after the CMP, but before the BLT executions.
After the BLT execution, we go at 0x24B420, so, inside the if branch as if the condition is true, while it is not.
I was not able to interpret the OP code your can see in memory window, I can find the proper doc I guess.
 
Thanks for your feedback.
 
Damien
  • Hi Damien,

    In order for us to investigate further can you follow the directions in the article How to Submit a Compiler Test Case. We will be able to better assist with full context.

    Thanks and regards,
    Mackay

  • Hello,

    Please find information below:

    I just removed most of the -I that shows the include directory of applicative modules.


    Building O:/nuke-maintenance/Builds/ti_arm_rm48/SwToolCom/Source/DiagnosticServiceInterface/DSIN_SrvWriteDataById.o
    D:/Logiciels/ti/ccs1281/ccs/tools/compiler/ti-cgt-arm_20.2.7.LTS/bin/armcl.exe -mv7R4 --code_state=32 --float_support=VFPv3D16 -me -c --c99 -pdew --diag_warning=225 --diag_wrap=off --display_error_number --enum_type=packed --abi=eabi -ID:/Logiciels/ti/ccs1281/ccs/tools/compiler/ti-cgt-arm_20.2.7.LTS/include -ppc -ppa --verbose -g -Ooff --define=DEBUG_USAGE --define=CCS --define=WITHOUT_WD --diag_suppress=2104 --define=_RM48x_ -DDEMO_BOARD_USED    -IO:/nuke-maintenance/Dev/MemMap/Source/Include  --obj_extension=.o -frO:/nuke-maintenance/Builds/ti_arm_rm48/SwToolCom/Source/DiagnosticServiceInterface O:/nuke-maintenance/Dev/SwToolCom/Source/DiagnosticServiceInterface/DSIN_SrvWriteDataById.c
    TI ARM C/C++ Compiler                   v20.2.7.LTS
    Copyright (c) 1996-2018 Texas Instruments Incorporated
       "D:/Logiciels/ti/ccs1281/ccs/tools/compiler/ti-cgt-arm_20.2.7.LTS/include/_defs.h"   ==> __isfinite
       "D:/Logiciels/ti/ccs1281/ccs/tools/compiler/ti-cgt-arm_20.2.7.LTS/include/_defs.h"   ==> __isfinitef
       "D:/Logiciels/ti/ccs1281/ccs/tools/compiler/ti-cgt-arm_20.2.7.LTS/include/_defs.h"   ==> __isfinitel
       "D:/Logiciels/ti/ccs1281/ccs/tools/compiler/ti-cgt-arm_20.2.7.LTS/include/_defs.h"   ==> __isnan
       "D:/Logiciels/ti/ccs1281/ccs/tools/compiler/ti-cgt-arm_20.2.7.LTS/include/_defs.h"   ==> __isnanf
       "D:/Logiciels/ti/ccs1281/ccs/tools/compiler/ti-cgt-arm_20.2.7.LTS/include/_defs.h"   ==> __isnanl
       "D:/Logiciels/ti/ccs1281/ccs/tools/compiler/ti-cgt-arm_20.2.7.LTS/include/_defs.h"   ==> __isnormal
       "D:/Logiciels/ti/ccs1281/ccs/tools/compiler/ti-cgt-arm_20.2.7.LTS/include/_defs.h"   ==> __isnormalf
       "D:/Logiciels/ti/ccs1281/ccs/tools/compiler/ti-cgt-arm_20.2.7.LTS/include/_defs.h"   ==> __isnormall
       "D:/Logiciels/ti/ccs1281/ccs/tools/compiler/ti-cgt-arm_20.2.7.LTS/include/_defs.h"   ==> __signbit
       "D:/Logiciels/ti/ccs1281/ccs/tools/compiler/ti-cgt-arm_20.2.7.LTS/include/_defs.h"   ==> __signbitf
       "D:/Logiciels/ti/ccs1281/ccs/tools/compiler/ti-cgt-arm_20.2.7.LTS/include/_defs.h"   ==> __signbitl
       "D:/Logiciels/ti/ccs1281/ccs/tools/compiler/ti-cgt-arm_20.2.7.LTS/include/_defs.h"   ==> __isinff
       "D:/Logiciels/ti/ccs1281/ccs/tools/compiler/ti-cgt-arm_20.2.7.LTS/include/_defs.h"   ==> __isinf
       "D:/Logiciels/ti/ccs1281/ccs/tools/compiler/ti-cgt-arm_20.2.7.LTS/include/_defs.h"   ==> __isinfl
       "D:/Logiciels/ti/ccs1281/ccs/tools/compiler/ti-cgt-arm_20.2.7.LTS/include/_defs.h"   ==> __fpclassifyf
       "D:/Logiciels/ti/ccs1281/ccs/tools/compiler/ti-cgt-arm_20.2.7.LTS/include/_defs.h"   ==> __fpclassify
       "D:/Logiciels/ti/ccs1281/ccs/tools/compiler/ti-cgt-arm_20.2.7.LTS/include/_defs.h"   ==> __fpclassifyl
       "O:/nuke-maintenance/Dev/SwToolCom/Source/DiagnosticServiceInterface/DSIN_SrvWriteDataById.c"   ==> DSIN_SrvWriteDataById

    I will sent the pp file to you only for confidentiality purpose.

    The options -ppc -ppa --verbose was just added for you to produce the information and pp file.

    Thanks.

    Damien

  • Hello,

    Could you please contact me directly by email so that I can provide you the file.

    It seems I am not able to contact directly from the forum.

    Thanks

    Damien

  • Hello Damien,

    I've opened up private messaging here on the forum, and would prefer to communicate that way rather than via email.

    Thanks and regards,
    Mackay

  • Hello,

    Normally, you have receive the file by private message, please let mw know if you are not received anything.

    Thanks.