This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Compiler/MSP430FR5994: Compiler INTERNAL ERROR

Part Number: MSP430FR5994

Tool/software: TI C/C++ Compiler

When I compile the short program below, I get a compiler internal error.

For detailled information see below the source.

Thank you.

Source file "hello.cpp"

#include <cstdint>
#include <stdio.h>
#include <msp430.h>

namespace data
{

    class date_t
    {
    public:
        constexpr date_t();
        inline bool Is_leap_year() const;
        uint8_t Days_in_month() const;
        uint8_t Year;
        uint8_t Month;
        uint8_t Day;
    private:
    };

    constexpr date_t::date_t()
    : Year(0), Month(1), Day(1)
    { }

    inline bool date_t::Is_leap_year() const
    {
        return (Year & 3) == 0;
    }

    uint8_t date_t::Days_in_month() const
    {
        static const uint8_t DaysOfMonthTable[16] = {
                /*  0     */ 30, /*precaution*/
                /*  1..12 */ 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31,
                /* 13..15 */ 30, 30, 30 /*precaution*/};
        uint8_t result;

        result = DaysOfMonthTable[Month & 15];
        if ((Month == 2) and Is_leap_year())
        {
            result++;
        }
        return result;
    }
}


/**
 * hello.c
 */
int main(void)
{
    WDTCTL = WDTPW | WDTHOLD;    // stop watchdog timer

    printf("Hello World!\n");

    return 0;
}

Console:

**** Build of configuration Debug for project Error_1 ****

"C:\\ti\\ccsv7\\utils\\bin\\gmake" -k -j 8 all -O
'Building file: ../hello.cpp'
'Invoking: MSP430 Compiler'
"C:/ti/ccsv7/tools/compiler/ti-cgt-msp430_18.1.4.LTS/bin/cl430" -vmspx --data_model=restricted --use_hw_mpy=F5 --include_path="C:/ti/ccsv7/ccs_base/msp430/include" --include_path="D:/sontex/dev/Produit/Integr/731/4_FW/ESSAIS_JMM/Error_1" --include_path="C:/ti/ccsv7/tools/compiler/ti-cgt-msp430_18.1.4.LTS/include" --advice:power=all --advice:hw_config=all --define=__MSP430FR5994__ --define=_MPU_ENABLE -g --printf_support=minimal --diag_warning=225 --diag_wrap=off --display_error_number --silicon_errata=CPU21 --silicon_errata=CPU22 --silicon_errata=CPU40 --preproc_with_compile --preproc_dependency="hello.d"  "../hello.cpp"

>> Compilation failure
subdir_rules.mk:9: recipe for target 'hello.obj' failed

INTERNAL ERROR: C:\ti\ccsv7\tools\compiler\ti-cgt-msp430_18.1.4.LTS\bin\acpia430.exe experienced a segmentation fault
                  while processing function (unknown or file scope) file ../hello.cpp line 43

This is caused by a defect in the TI EABI C/C++ Parser.
TI Customer Support may be able to suggest a workaround to avoid this.

Upgrading to the newest version of the compiler may fix this problem.

Contact TI in the E2E support forums at http://e2e.ti.com under
"Development Tools", "TI C/C++ Compiler".  See the link titled
"Submitting an issue".

We need to see this ENTIRE error message and a complete, reproducible
test case including ALL of the command-line options.
Include the .pp file created by option --preproc_with_comment

gmake: *** [hello.obj] Error 1
gmake: Target 'all' not remade because of errors.

**** Build Finished ****

Compiler

Compiler version:   TI v18.1.4.LTS

Compiler flags:
    -vmspx
    --data_model=restricted
    --use_hw_mpy=F5
    --include_path="${CCS_BASE_ROOT}/msp430/include"
    --include_path="${PROJECT_ROOT}"
    --include_path="${CG_TOOL_ROOT}/include"
    --advice:power=all
    --advice:hw_config=all
    --define=__MSP430FR5994__
    --define=_MPU_ENABLE
    -g
    --printf_support=minimal
    --diag_warning=225
    --diag_wrap=off
    --display_error_number
    --silicon_errata=CPU21
    --silicon_errata=CPU22
    --silicon_errata=CPU40

Linker flags:
    -m"${ProjName}.map"
    --heap_size=300
    --stack_size=300
    --cinit_hold_wdt=on
    -i"${CCS_BASE_ROOT}/msp430/include"
    -i"${CCS_BASE_ROOT}/msp430/lib/5xx_6xx_FRxx"
    -i"${CCS_BASE_ROOT}/msp430/lib/FR59xx"
    -i"${CG_TOOL_ROOT}/lib"
    -i"${CG_TOOL_ROOT}/include"
    --priority
    --reread_libs
    --define=_MPU_ENABLE
    --diag_wrap=off
    --display_error_number
    --warn_sections
    --xml_link_info="${ProjName}_linkInfo.xml"
    --use_hw_mpy=F5
    --rom_model

  • Hi,

    18.1.4.LTS fails.
    18.12.0.LTS compiles without errors.
    Try 18.1.5.LTS if you like.
  • Thank you for reporting this problem, and submitting a concise test case.  I can reproduce the same behavior.  I filed CODEGEN-5830 in the SDOWP to have this investigated.  You are welcome to follow it with the SDOWP link below in my signature.

    Thanks and regards,

    -George

  • Regarding leap year:
    Steps
    Start off using the year you want to calculate.
    See if it is evenly divisible by 4 (a whole number with no remainder). If it is not, like 1997, it is not a leap year. ...
    See if the year is divisible by 100. If a year is divisible by 4, but not 100, like 2012, it is a leap year. ...
    See if the year is divisible by 400.