Number
CS0408970
State
Work in progress
Short description of your case
I want to report a bug in CCS 10.1.
I'm running Windows 7 Professional 64-bit on the following hardware:
CPU: Intel Core i5-3570 CPU @ 3.40 GHz
Graphics Card: nVidia GEforce 6800 GS (256 MB)
Motherboard:msi H61M-P31 (G3)
8 GB ram

I'm running CCS Version: 10.1.1.00004.
I will use a row of "vvv" to denote the beginning of a quote from the computer and "^^^^" to denote the end of a quote.

When I attempt to build my program, I get the following error message:
vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
MSP 430 C/C++ Optimizer v20.2.1.0.LTS has stopped working
A problem caused the program to stop working correctly. Windows will close the program and notify you if a solution is available. 
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Then I have the options to Debug or Close Program.
If I choose Debug, it gives the following detail:
vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
An unhandled Win32 exception occured in [5404] opt40.exe.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Here is a dump of the Console right before the crash:
vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
**** Build of configuration Debug for project Compiler_Crashing_Code ****

"C:\\ti\\ccs1011\\ccs\\utils\\bin\\gmake" -k -j 4 all -O 
 
Building file: "../Compiler_Crashing_Code.c"
Invoking: MSP430 Compiler
"C:/ti/ccs1011/ccs/tools/compiler/ti-cgt-msp430_20.2.1.LTS/bin/cl430" -vmsp --use_hw_mpy=none --include_path="C:/ti/ccs1011/ccs/ccs_base/msp430/include" --include_path="C:/Users/Bryan/workspace_v6_1/Compiler_Crashing_Code" --include_path="C:/ti/ccs1011/ccs/tools/compiler/ti-cgt-msp430_20.2.1.LTS/include" --advice:power=all --define=__MSP430G2553__ -g --printf_support=minimal --diag_warning=225 --diag_wrap=off --display_error_number --preproc_with_compile --preproc_dependency="Compiler_Crashing_Code.d_raw"  "../Compiler_Crashing_Code.c"
 
>> Compilation failure
subdir_rules.mk:9: recipe for target 'Compiler_Crashing_Code.obj' failed
"../Compiler_Crashing_Code.c", line 71: remark #1535-D: (ULP 8.1) variable "i" is used as a constant. Recommend declaring variable as either 'static const' or 'const'
gmake: *** [Compiler_Crashing_Code.obj] Error 1
gmake: Target 'all' not remade because of errors.

**** Build Finished ****
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
This is the code producing the error.
vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv

/* --COPYRIGHT--,BSD_EX
 * Copyright (c) 2012, Texas Instruments Incorporated
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *
 * *  Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 *
 * *  Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 *
 * *  Neither the name of Texas Instruments Incorporated nor the names of
 *    its contributors may be used to endorse or promote products derived
 *    from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 *******************************************************************************
 * 
 *                       MSP430 CODE EXAMPLE DISCLAIMER
 *
 * MSP430 code examples are self-contained low-level programs that typically
 * demonstrate a single peripheral function or device feature in a highly
 * concise manner. For this the code may rely on the device's power-on default
 * register values and settings such as the clock configuration and care must
 * be taken when combining code from several examples to avoid potential side
 * effects. Also see www.ti.com/grace for a GUI- and www.ti.com/msp430ware
 * for an API functional library-approach to peripheral configuration.
 *
 * --/COPYRIGHT--*/
//******************************************************************************
//  MSP430G2xx3 Demo - Timer_A, Toggle P1.0, CCR0 Up Mode ISR, 32kHz ACLK
//
//  Description: Toggle P1.0 using software and the TA_0 ISR. Timer_A is
//  configured for up mode, thus the the timer overflows when TAR counts
//  to CCR0. In this example, CCR0 is loaded with 1000-1.
//  Toggle rate = 32768/(2*1000) = 16.384Hz
//  ACLK = TACLK = 32768Hz, MCLK = SMCLK = DCO
//  //* An external watch crystal on XIN XOUT is required for ACLK *//	
//
//           MSP430G2xx3
//         ---------------
//     /|\|            XIN|-
//      | |               | 32kHz
//      --|RST        XOUT|-
//        |               |
//        |           P1.0|-->LED
//
//  D. Dang
//  Texas Instruments Inc.
//  December 2010
//   Built with CCS Version 4.2.0 and IAR Embedded Workbench Version: 5.10
//******************************************************************************

#include <msp430.h>

int i=842;

int main(void)
{
  WDTCTL = WDTPW + WDTHOLD;                 // Stop WDT
  switch(i)
  {
	case 0 ... 259:
		// stuff
	break;

	case 260 ... 519:
		// stuff
	break;

	case 520 ... 779:
		// stuff
	break;

	case 780 ... 1039:
		// stuff
	break;

	case 1040 ... 1299:
		// stuff
	break;

	case 1300 ... 1559:
		// stuff
	break;

	case 1560 ... 1819:
		// stuff
	break;

	case 1820 ... 22742:
		// stuff
	break;

	default:
		// stuff
	break;

  	}

} // end of main

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

When the range on the last "case" statement is modified to 22741, it crashes the compiler only part of the time: at 22740, it does not crash the compiler.

I can rescale my variable, but this seems like odd behavior. I can't think of any significance to the number 22740.

Any guidance is appreciated. I hope this is helpful in bug eradication.

-Bryan Lowder