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

Change documentation to explain when B3 is saved to a register instead of the stack

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Medium Medium

      The C6000 compiler manual, in the section titled How a Called Function Responds , states the following ...

      If the called function calls any other functions, the return address must be saved on the stack.  Otherwise, it is left in the return register (B3) and is overwritten by the next function call.

      However, there are cases where B3 is not saved on the stack, but in a register.  Use the attached files.  In the C code, the function add3 calls add2.  Both functions are implemented in the file.  Build it ...

      % cl6x -@options.txt try1.c

      Inspect the resulting asm file.  Note how add3 calls add2.  It copies B3 to A0, and not to a location on the stack.

      The manual should be changed to explain the details of where the return address is saved under different circumstances.

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

              Created:
              Updated: