bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug gas/27096] New: [ARM] If-Then instruction and AL condition


From: kordalski.wojciech at gmail dot com
Subject: [Bug gas/27096] New: [ARM] If-Then instruction and AL condition
Date: Sat, 19 Dec 2020 11:49:15 +0000

https://sourceware.org/bugzilla/show_bug.cgi?id=27096

            Bug ID: 27096
           Summary: [ARM] If-Then instruction and AL condition
           Product: binutils
           Version: 2.35.1
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P2
         Component: gas
          Assignee: unassigned at sourceware dot org
          Reporter: kordalski.wojciech at gmail dot com
  Target Milestone: ---

Created attachment 13063
  --> https://sourceware.org/bugzilla/attachment.cgi?id=13063&action=edit
The minimal example

During research of ARM Cortex-M3-based processor for our master thesis, we
found a bug (using a tool that generates random-but-correct sequences of
assembly instructions).

Minimal example:

    .syntax unified
    .thumb

    .align 2
    .type f0, %function
    .thumb_func
    f0:                    @ This assembles successfuly.
        movs.n r0, 42      @ Sets the condition flags, executed
unconditionally.

    .align 2
    .type f1, %function
    .thumb_func
    f1:                    @ This assembles successfully.
        it eq
        moveq.n r0, 42     @ Does not set the condition flags, but executed
conditionally.

    .align 2
    .type f2, %function
    .thumb_func
    f2:                    @ This fails to assemble.
        it al
        moval.n r0, 42     @ Does not set the condition flags, executed
unconditionally.


According to the ARMv7-M Architecture Reference Manual, the code is correct.

    16-bit instructions in the IT block, other than CMP, CMN, and TST, do not
set the condition flags. The AL condition can be specified to get this changed
behavior without conditional execution.

(Description of the IT instruction: Section A7.7.38 IT, page A7-236)


However, the assembler gives following error message (arm-none-eabi-as -o
test.o test.s -mcpu=cortex-m3)

    test.s: Assembler messages:
    test.s:16: Error: instruction not allowed in IT block -- `moval.n r0,42'

Omitting the `al` suffix in `moval.n` instruction (i.e., "it al; mov.n r0, 42")
does not help. The message is analogous ("Error: instruction not allowed in IT
block -- `mov.n r0,42'").

Expected behavior: Assembler should successfully assemble the code.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]