Compiler allocates wrong register for asm statement

XMLWordPrintable

    • Type: Bug
    • Resolution: Unresolved
    • Priority: Medium

      For this source code ...

      unsigned int sp;
      
      void fxn()
      {
          /* Compilation fails as the compiler selects a `Dx` register instead of a `Ax` register to load the address of `sp`. */
          __asm volatile("ST.32 *%0, A15" : : "r"(&sp));
      
      }
      

      Compile it ...

      % c29clang -c file.c
      file.c:7:20: error: illegal base register for indirect
          7 |     __asm volatile("ST.32 *%0, A15" : : "r"(&sp));
            |                    ^
      <inline asm>:1:11: note: instantiated into assembly here
          1 |         ST.32 *D0, A15
            |                  ^
      1 error generated.
      

            Assignee:
            TI User
            Reporter:
            TI User
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:

                Connection: Intermediate to External PROD System
                EXTSYNC-5667 - Compiler allocates wrong register f...
                SYNCHRONIZED
                • Last Sync Date: