Under some conditions, including use of --opt_level=2, C++ code that throws an exception runs away

XMLWordPrintable

    • Type: Bug
    • Resolution: Unresolved
    • Priority: Medium
    • Code Generation Tools
    • CODEGEN-14839
    • Hide
      C7000_1.4.0.LTS
      C7000_6.x.0.LTS*
      C6000_8.2.0
      C6000_8.3.0
      MSP430_20.2.0.LTS
      C7000_2.1.0.LTS
      C6000_8.5.0.LTS
      MSP430_21.6.0.LTS
      C7000_3.1.0.LTS
      C7000_5.0.1.LTS
      C7000_4.1.0.LTS
      Show
      C7000_1.4.0.LTS C7000_6.x.0.LTS* C6000_8.2.0 C6000_8.3.0 MSP430_20.2.0.LTS C7000_2.1.0.LTS C6000_8.5.0.LTS MSP430_21.6.0.LTS C7000_3.1.0.LTS C7000_5.0.1.LTS C7000_4.1.0.LTS
    • 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.

            Assignee:
            TI User
            Reporter:
            TI User
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:

                Connection: Intermediate to External PROD System
                EXTSYNC-6111 - Under some conditions, including us...
                SYNCHRONIZED
                • Last Sync Date: