-
Type:
Bug
-
Resolution: Unresolved
-
Priority:
Medium
-
Code Generation Tools
-
CODEGEN-14839
-
-
C7000_6.x.0.LTS*
-
default
The attached C++ file has these lines ...
void exception_mishandle_example()
{
static constexpr size_t N = 32;
/* Marked volatile so compiler doesn't pre-optimize them */
volatile char tmp_array[N];
volatile int no_opt = 0;
/* Will live inside two vector registers */
SimpleData d1(5);
SimpleData d2(20);
/* Unique_ptr can also fit into a register */
auto unique_ptr = std::make_unique<SimpleData>(10);
printf("Value: %d\r\n", unique_ptr->getValue());
/* Throws an exception */
eme_inner(no_opt);
The function eme_inner throws an exception that should be caught in main. When built with --opt_level=1 or lower, that is what happens. When built with --opt_level=2 or higher, code runs away and never comes back.