• Resolved

Compiler/TMS320F28335: INTERNAL ERROR: Number of virtual registers beyond limit. Reduce function size

Part Number: TMS320F28335

Tool/software: TI C/C++ Compiler

hello 

I compiled my project with compiler TI v6.4.12 but failed.

The error message:

INTERNAL ERROR: Number of virtual registers beyond limit. Reduce function size.This may be a serious problem. Please contact customer support with adescription of this problem and a sample of the source files that caused this INTERNAL ERROR message to appear.

Someone posted the same error before,he solve this problem with version16.9.0, but it cost a lot of time (almost thirty minutes) to compile my project .I also made a lot of matrix calculation in my code and the error may be caused by that ,but I do not know how to solve the problem.

looking for reply.

thanks

  • Please preprocess the source code that causes this error, and attach that to your next post.  Also show all the build options exactly as the compiler sees them.

    Thanks and regards,

    -George


    TI C/C++ Compiler Forum Moderator
    Please click Verify Answer on the best reply to your question
    The CCS Youtube Channel
     has short how-to videos
    The 
    Compiler Wiki answers most common questions
    Track an issue with SDOWP. Enter your bug id in the Search box.

  • How long does it take to compile your program with 6.4.12?
  • In reply to Archaeologist:

    No more than 10 seconds

  • In reply to George Mock:

    George

    the error caused by the file my_ekf.pp in insert file.

    the following is the error reporting:

    my_efk.zip
    **** Build of configuration Debug for project mbc_bios_2 ****

    "E:\\ccs6.0\\ccsv6\\utils\\bin\\gmake" -j4 -k navigation/my_efk.obj
    'Building file: ../navigation/my_efk.c'
    'Invoking: C2000 Compiler'
    "H:/lib_project/ti-cgt-c2000_6.4.12/bin/cl2000" -v28 -ml -mt --float_support=fpu32
    --opt_for_speed=5 --include_path="H:/lib_project/ti-cgt-c2000_6.4.12/include"
    --include_path="H:/lib_project/mbc_bios_2/navigation"
    --include_path="H:/lib_project/mbc_bios_2/DSP2833x_common/include"
    --include_path="H:/lib_project/mbc_bios_2/DSP2833x_common/source"
    --include_path="H:/lib_project/mbc_bios_2/DSP2833x_headers/include"
    --include_path="H:/lib_project/mbc_bios_2/DSP2833x_headers/source"
    -g --preproc_only --preproc_with_comment --preproc_with_compile
    --diag_wrap=off --diag_warning=225 --diag_warning=255 --display_error_number
    --gen_func_subsections=on --obj_directory="navigation"
    --cmd_file="./configPkg/compiler.opt" "../navigation/my_efk.c"
    >> ../navigation/my_efk.c, line 1732: INTERNAL ERROR: Number of virtual
    registers beyond limit. Reduce function
    size

    This may be a serious problem. Please contact customer support with a
    description of this problem and a sample of the source files that caused this
    INTERNAL ERROR message to appear.

    Cannot continue compilation - ABORTING!


    >> Compilation failure
    gmake: *** [navigation/my_efk.obj] Error 1

    **** Build Finished ****

  • In reply to George Mock:

    George
    Can you help me solve my problem?
    thanks
  • In reply to jinkui wang:

    First, I misunderstood the nature of the problem. Of course it takes just a few second to crash due to too many registers, that check happens early on.

    Your test case involves a very long (MATLAB-generated) function which ends up having about 46,000 virtual registers. This exceeded the capability of 6.4.12, so it just aborted. 6.4.12 was designed that way because it was known that there are certain algorithms that would take an excessively long time to run when the virtual register count gets that high, so the remedy was always to suggest that the user break the function up into smaller pieces. For 16.9.0, we decided to go ahead and compile the program, even though it would certainly take an excessively long time. This is exactly what your test case demonstrates.

    As the number of virtual registers grows, the compilation time grows exponentially. This is just the nature of the algorithm the TI compiler uses to allocate registers. The only remedy is to break the function up into smaller pieces, or just accept the long compilation time.
  • In reply to Archaeologist:

    Will it affect the efficiency of the code implementation?

  • In reply to jinkui wang:

    No.  If anything, it will improve efficiency.  All other things being equal, the compiler is more likely to generate better code for a smaller function.

    Thanks and regards,

    -George


    TI C/C++ Compiler Forum Moderator
    Please click Verify Answer on the best reply to your question
    The CCS Youtube Channel
     has short how-to videos
    The 
    Compiler Wiki answers most common questions
    Track an issue with SDOWP. Enter your bug id in the Search box.

  • In reply to George Mock:

    Ok ,I see ,thank you for answering questions