public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/34436]  New: Illegal assembly on ARM/Thumb
@ 2007-12-11 22:30 joel at gcc dot gnu dot org
  2007-12-11 22:32 ` [Bug target/34436] " joel at gcc dot gnu dot org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: joel at gcc dot gnu dot org @ 2007-12-11 22:30 UTC (permalink / raw)
  To: gcc-bugs

Appears to be invalid code produced when -mthumb selected.  

Happens with gcc 4.1.1 and 4.2.2 when compiling with:

arm-rtems4.9-gcc  -mcpu=arm7tdmi  -mthumb -O2  -c /tmp/test1.c

/tmp/cccISkv7.s: Assembler messages:
/tmp/cccISkv7.s:205: Error: unshifted register required -- `eor
r2,r3,r3,ROR#16'
/tmp/cccISkv7.s:206: Error: unshifted register required -- `bic
r2,r2,#0xff0000'
/tmp/cccISkv7.s:208: Error: unshifted register required -- `eor r3,r3,r2,LSR#8'
/tmp/cccISkv7.s:217: Error: unshifted register required -- `eor
r3,r2,r2,ROR#16'
/tmp/cccISkv7.s:218: Error: unshifted register required -- `bic
r3,r3,#0xff0000'
/tmp/cccISkv7.s:220: Error: unshifted register required -- `eor r2,r2,r3,LSR#8'
/tmp/cccISkv7.s:236: Error: unshifted register required -- `eor r2,r3,r3,ROR#16
.....

Assembler was invoked as 
/opt/rtems-4.9/lib/gcc/arm-rtems4.9/4.2.2/../../../../arm-rtems4.9/bin/as -mcpu
=arm7tdmi -mfpu=softfpa -o test1.o /tmp/cc7F7jPZ.s

When I compile test2.c, it gives errors about duplicate type definitions.  That
is the same file with cpp comments removed.  Strange.


-- 
           Summary: Illegal assembly on ARM/Thumb
           Product: gcc
           Version: 4.2.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: joel at gcc dot gnu dot org
GCC target triplet: arm-unknown-rtems


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34436


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug target/34436] Illegal assembly on ARM/Thumb
  2007-12-11 22:30 [Bug c/34436] New: Illegal assembly on ARM/Thumb joel at gcc dot gnu dot org
@ 2007-12-11 22:32 ` joel at gcc dot gnu dot org
  2007-12-11 22:35 ` pinskia at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: joel at gcc dot gnu dot org @ 2007-12-11 22:32 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from joel at gcc dot gnu dot org  2007-12-11 22:32 -------
Created an attachment (id=14733)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=14733&action=view)
Test Case #1 produces illegal assembly

When compiled as described in the first post, this file gives illegal assembly
messages from gas.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34436


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug target/34436] Illegal assembly on ARM/Thumb
  2007-12-11 22:30 [Bug c/34436] New: Illegal assembly on ARM/Thumb joel at gcc dot gnu dot org
  2007-12-11 22:32 ` [Bug target/34436] " joel at gcc dot gnu dot org
  2007-12-11 22:35 ` pinskia at gcc dot gnu dot org
@ 2007-12-11 22:35 ` joel at gcc dot gnu dot org
  2007-12-11 22:39 ` joel dot sherrill at oarcorp dot com
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: joel at gcc dot gnu dot org @ 2007-12-11 22:35 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from joel at gcc dot gnu dot org  2007-12-11 22:34 -------
Found inline assembly that caused problem.  Sorry.


-- 

joel at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |INVALID


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34436


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug target/34436] Illegal assembly on ARM/Thumb
  2007-12-11 22:30 [Bug c/34436] New: Illegal assembly on ARM/Thumb joel at gcc dot gnu dot org
  2007-12-11 22:32 ` [Bug target/34436] " joel at gcc dot gnu dot org
@ 2007-12-11 22:35 ` pinskia at gcc dot gnu dot org
  2007-12-11 22:35 ` joel at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-12-11 22:35 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from pinskia at gcc dot gnu dot org  2007-12-11 22:35 -------
    asm volatile ("EOR   %1, %0, %0, ROR #16\n"
                  "BIC   %1, %1, #0xff0000\n"
                  "MOV   %0, %0, ROR #8\n"
                  "EOR   %0, %0, %1, LSR #8\n"
                  : "=r" (value), "=r" (tmp)
                  : "0" (value), "1" (tmp));



:)


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34436


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug target/34436] Illegal assembly on ARM/Thumb
  2007-12-11 22:30 [Bug c/34436] New: Illegal assembly on ARM/Thumb joel at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2007-12-11 22:35 ` joel at gcc dot gnu dot org
@ 2007-12-11 22:39 ` joel dot sherrill at oarcorp dot com
  2007-12-12  0:31 ` rask at gcc dot gnu dot org
  2007-12-12 14:05 ` joel at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: joel dot sherrill at oarcorp dot com @ 2007-12-11 22:39 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from joel dot sherrill at oarcorp dot com  2007-12-11 22:38 -------
Subject: Re:  Illegal assembly on ARM/Thumb

pinskia at gcc dot gnu dot org wrote:
> ------- Comment #3 from pinskia at gcc dot gnu dot org  2007-12-11 22:35 -------
>     asm volatile ("EOR   %1, %0, %0, ROR #16\n"
>                   "BIC   %1, %1, #0xff0000\n"
>                   "MOV   %0, %0, ROR #8\n"
>                   "EOR   %0, %0, %1, LSR #8\n"
>                   : "=r" (value), "=r" (tmp)
>                   : "0" (value), "1" (tmp));
>
>
>
> :)
>   

Thank you.  I spotted that when I was about to add the second
test code.  I realized that my sed for cpp lines with # was
probably hitting assembly.  I closed this about the same time
you did.

I have shot this back to the RTEMS Arm/Thumb person. They
should have caught this and added a Thumb version.

Thanks.  Sorry for the PR.

--joel
>
>   


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34436


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug target/34436] Illegal assembly on ARM/Thumb
  2007-12-11 22:30 [Bug c/34436] New: Illegal assembly on ARM/Thumb joel at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2007-12-11 22:39 ` joel dot sherrill at oarcorp dot com
@ 2007-12-12  0:31 ` rask at gcc dot gnu dot org
  2007-12-12 14:05 ` joel at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: rask at gcc dot gnu dot org @ 2007-12-12  0:31 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from rask at gcc dot gnu dot org  2007-12-12 00:31 -------
See also bug 18560. I.e. consider using a C version instead.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34436


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug target/34436] Illegal assembly on ARM/Thumb
  2007-12-11 22:30 [Bug c/34436] New: Illegal assembly on ARM/Thumb joel at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2007-12-12  0:31 ` rask at gcc dot gnu dot org
@ 2007-12-12 14:05 ` joel at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: joel at gcc dot gnu dot org @ 2007-12-12 14:05 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from joel at gcc dot gnu dot org  2007-12-12 14:05 -------
RTEMS had a default implementation of the method in question that was in C.  So
for the Thumb, I changed things to use it until the Thumb maintainer adds a
better version.

Thanks.  I wasn't even finished adding the test cases when I spotted the real
problem.  I am sorry.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34436


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2007-12-12 14:05 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-12-11 22:30 [Bug c/34436] New: Illegal assembly on ARM/Thumb joel at gcc dot gnu dot org
2007-12-11 22:32 ` [Bug target/34436] " joel at gcc dot gnu dot org
2007-12-11 22:35 ` pinskia at gcc dot gnu dot org
2007-12-11 22:35 ` joel at gcc dot gnu dot org
2007-12-11 22:39 ` joel dot sherrill at oarcorp dot com
2007-12-12  0:31 ` rask at gcc dot gnu dot org
2007-12-12 14:05 ` joel at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).