[Bug gas/22493] New: push {sp} fails on mcpu=cortex-a7

2017-11-25 Thread bugzi...@fritzler-avr.de
https://sourceware.org/bugzilla/show_bug.cgi?id=22493

Bug ID: 22493
   Summary: push {sp} fails on mcpu=cortex-a7
   Product: binutils
   Version: 2.29
Status: UNCONFIRMED
  Severity: normal
  Priority: P2
 Component: gas
  Assignee: unassigned at sourceware dot org
  Reporter: bugzi...@fritzler-avr.de
  Target Milestone: ---
Target: cortex-a7

The arm-none-eabi-as translates "push {sp}" wrong.
Instead of "stmfd sp!, {sp}" im getting "str sp, [sp, #-4]!".
This str is UNPREDICTABLE says ARMv7-A Refmanual (the cortex a7 throws an
undefined).
Because it uses writeback and Rn == Rt.
Im referencing to this doc:
http://liris.cnrs.fr/~mmrissa/lib/exe/fetch.php?media=armv7-a-r-manual.pdf (ARM
DDI 0406C.b (ID072512))
Chapter A8.8.205, page 676.

And im not getting a warning!
If im typing "str sp, [sp, #-4]!" manually I get a warning.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug gas/22493] push {sp} fails on mcpu=cortex-a7

2017-12-05 Thread bugzi...@fritzler-avr.de
https://sourceware.org/bugzilla/show_bug.cgi?id=22493

--- Comment #2 from bugzi...@fritzler-avr.de ---
Hello,
of course I will give you more details.

At first "y52d" ist not stm it is str ;)
stm is "y92d".

Therefore I repeated your test but with two more instructions.
Now you can see the difference.

$ cat pr22493.s 
.text
label:
stmfd sp!, {sp}
push {sp}
str sp, [sp, #-4]! //this line(5) is the warning!


$ arm-none-eabi-as -march=armv7-a pr22493.s -o pr22493.o
pr22493.s: Assembler messages:
pr22493.s:5: Warning: source register same as write-back base


$ ./arm-none-eabi-objdump -d pr22493.o
pr22493.o: file format elf32-littlearm
Disassembly of section .text:

 :
   0:   e92d2000stmfd   sp!, {sp}
   4:   e52dd004push{sp}; (str sp, [sp, #-4]!)
   8:   e52dd004push{sp}; (str sp, [sp, #-4]!)


$ arm-none-eabi-as -v
GNU assembler version 2.29.1 (arm-none-eabi) using BFD version (GNU Binutils)
2.29.1
$ arm-none-eabi-objdump -v
GNU objdump (GNU Binutils) 2.29.1

Now the details HOW the bug was generated:
In our course the students have to write some exceptionhandlers and print all
registers if an exception happens.
Therefore a student used push {sp} and nothing worked because his undef handler
wasnt finished and the -as didnt throw a warning. 

Greetings
Martin

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils


[Bug gas/22493] push {sp} fails on mcpu=cortex-a7

2017-12-15 Thread bugzi...@fritzler-avr.de
https://sourceware.org/bugzilla/show_bug.cgi?id=22493

--- Comment #4 from bugzi...@fritzler-avr.de ---
Hello Nick,
I patched my binutils with your patch and now it gets translated right.

Here is the evidence (same asm Code as in Comment 2):

$ arm-none-eabi-objdump -d pr22493.o
pr22493.o: file format elf32-littlearm
Disassembly of section .text:
 :
   0:   e92d2000stmfd   sp!, {sp}
   4:   e92d2000stmfd   sp!, {sp}
   8:   e52dd004push{sp}; (str sp, [sp, #-4]!)

Greetings
Martin

-- 
You are receiving this mail because:
You are on the CC list for the bug.
___
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils