buildrootschalter/package/gcc/arc-2014.08/403-update-casesi_compact_jump-instruction-length.patch
Alexey Brodkin b94949efb3 ARC: gcc - fixes for improperly calculated jump/branch offsets
Symptoms usually seen are like that:
--->---
Error: operand out of range (128 is not between -128 and 127)
--->---
where range may differ.

Since compiler tries to use jump/branch instructions with the shortest encoding
of offset it's important to calculate required offset properly.

In case of miscalculation by compiler later assembler throws an error because of
inability to encode requested value.

Fixes are taken from current development branch of GCC for ARC and will be a
part of the next release of ARC tools, so at that point patch should be dropped.

Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com>
Cc: Anton Kolesov <akolesov@synopsys.com>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Cc: Peter Korsgaard <peter@korsgaard.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
2014-10-08 20:55:28 +02:00

32 lines
1.3 KiB
Diff

Update casesi_compact_jump instruction length
Fixes autobuilder issue http://autobuild.buildroot.net/results/bc5/bc5100d6462af4e2805f2bc8d39c87a55d843e2b/
--->---
$ arc-linux-gcc -c -o wps_attr_parse.o -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -pipe -Os -I.../host/usr/arc-buildroot-linux-uclibc/sysroot/usr/include/libnl3/ -I.../build/hostapd-2.2/src -I.../build/hostapd-2.2/src/utils wps_attr_parse.c
wps_attr_parse.s: Assembler messages:
wps_attr_parse.s:860: Error: operand out of range (512 is not between -512 and 511)
--->---
Fix is taken from current development branch of GCC for ARC and will be a
part of the next release of ARC tools, so at that point patch should be dropped.
https://github.com/foss-for-synopsys-dwc-arc-processors/gcc/commit/8e704c43cb50407ec79795f6f7459f09800b9f01
Signed-off-by: Claudiu Zissulescu <claziss@synopsys.com>
---
diff --git a/gcc/config/arc/arc.md b/gcc/config/arc/arc.md
index 88b2e37..8e18703 100644
--- a/gcc/config/arc/arc.md
+++ b/gcc/config/arc/arc.md
@@ -3948,7 +3948,7 @@
output_asm_insn (s, xop);
return \"add_s %2,%2,pcl\n\tj_s%* [%2]\";
}"
- [(set_attr "length" "10")
+ [(set_attr "length" "12")
(set_attr "type" "jump")
(set_attr "iscompact" "true")
(set_attr "cond" "nocond")])