Uploaded image for project: 'Embedded Software & Tools'
  1. Embedded Software & Tools
  2. EXT_EP-12181

tiarmclang silently ignores #pragma FUNCTION_OPTIONS, when a diagnostic is expected

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Medium Medium

      This code ...

      #pragma FUNCTION_OPTIONS(fxn, "--opt_level=3")
      #pragma FUNC_EXT_CALLED(fxn)
      int fxn(int arg)
      {
          return arg + 3;
      }
      

      ... compiles clean with TI Arm compiler armcl. And even though only --opt_level=0 is used, it is optimized at level 3. Try the same thing with tiarmclang ...

      % tiarmclang -c file.c
      file.c:2:9: warning: pragma FUNC_EXT_CALLED is a legacy TI pragma and not supported in clang
            compilers. [-Wti-pragmas]
          2 | #pragma FUNC_EXT_CALLED(fxn)
            |         ^
      1 warning generated.
      

      A diagnostic is emitted for FUNC_EXT_CALLED. A diagnostic is expected for FUNCTION_OPTIONS, but it does not appear. Furthermore, the generated code is not optimized.

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

              Created:
              Updated:
              Resolved: