[EXT_EP-9596] Compiler intermittently fails with INTERNAL ERROR: optimizer experienced a segmentation fault Created: 18/Dec/19  Updated: 11/May/20  Resolved: 18/Dec/19

Status: Fixed
Project: Embedded Software & Tools
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Medium
Reporter: TI User Assignee: TI User
Resolution: Fixed Votes: 0
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Product: Code Generation Tools
Internal ID: CODEGEN-7011
Forum URL: https://e2e.ti.com/support/tools/ccs/f/81/t/866937
Found In Release: C6000_8.2.0
C2000_18.1.0.LTS
C6000_8.3.0
MSP430_20.2.0.LTS
C7000_1.4.0.LTS*
ARM_18.12.0.LTS
PRU_2.3.0
ARM_20.2.0.LTS
C2000_20.2.0.LTS
ARM_18.1.0.LTS
MSP430_18.1.0.LTS
PRU_2.4.0*
MSP430_18.12.0.LTS
C2000_18.12.0.LTS
Fix In Release: ARM_18.12.5.LTS
MSP430_20.2.0.LTS
MSP430_18.1.8.LTS
ARM_20.2.0.LTS
C2000_20.2.0.LTS
MSP430_18.12.5.LTS
C2000_18.12.5.LTS
PRU_2.4.0*
ARM_18.1.8.LTS
C2000_18.1.8.LTS
C6000_8.3.6
PRU_2.3.4*
C6000_8.2.9
Affected Platform/Device: default
Workaround: Compile at -o1 or less; the pass with the bug runs only at -o2 or greater. In this particular case, making m_register_address a regular field instead of a bitfield will also avoid the issue. There isn't a simple change to the source that might avoid it in the general case; avoidance requires that several aspects that combine for the error, don't combine.
Release Notes: If a struct contains a bitfield, and a function contains both a read and a write of that bitfield, and the expression written includes an operation (such as '&' with a constant) that truncates the value in the same way that the bitfield write does, then the optimiser may crash due to a bad memory access.

The important detail is the write to the bitfield. Note that field writes in C++ don't look struct accesses, but are. Also note that the compiler can inline calls and rearrange code to create the problematic situation in ways that are not obvious.

 Description   

Compiler intermittently fails with INTERNAL ERROR: opt2000 experienced a segmentation fault


Generated at Wed Apr 16 17:02:37 CDT 2025 using Jira 9.12.17#9120017-sha1:aba4002bcd633f188b6a4bb5dd8a0e1f20b79ee4.