summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/gcc/gcc-4.5.0/gcc-pr43698-arm-rev-instr.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/gcc/gcc-4.5.0/gcc-pr43698-arm-rev-instr.patch')
-rw-r--r--meta/recipes-devtools/gcc/gcc-4.5.0/gcc-pr43698-arm-rev-instr.patch117
1 files changed, 117 insertions, 0 deletions
diff --git a/meta/recipes-devtools/gcc/gcc-4.5.0/gcc-pr43698-arm-rev-instr.patch b/meta/recipes-devtools/gcc/gcc-4.5.0/gcc-pr43698-arm-rev-instr.patch
new file mode 100644
index 0000000000..61c883e1ff
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc-4.5.0/gcc-pr43698-arm-rev-instr.patch
@@ -0,0 +1,117 @@
1backport http://gcc.gnu.org/viewcvs?view=revision&revision=162404
2from trunk
3
4Which fixes http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43698
5
62010-07-22 Ramana Radhakrishnan <ramana.radhakrishnan@arm.com>
7
8 PR target/43698
9 * config/arm/arm.md: Split arm_rev into *arm_rev
10 and *thumb1_rev. Set *arm_rev to be predicable.
11
122010-07-22 Ramana Radhakrishnan <ramana.radhakrishnan@arm.com>
13
14 PR target/43698
15 * gcc.target/arm/pr43698.c: New test.
16
17
18/scratch/oe/sysroots/i686-linux/usr/share/quilt/compat/date
19Usage: date [OPTION]... [+FORMAT]
20Display the current time in the given FORMAT.
21
22 -d, --date=STRING display time described by STRING, not `now'
23 -f, --file=DATEFILE like --date once for each line of DATEFILE
24 -R, --rfc-822 output RFC-822 compliant date string
25 -u, --utc, --universal print or set Coordinated Universal Time
26 --help display this help and exit
27date is /scratch/oe/sysroots/i686-linux/usr/share/quilt/compat/date
28date is /scratch/oe/sysroots/i686-linux/usr/share/quilt/compat/date
29date is /bin/date
30date is /scratch/oe/sysroots/i686-linux/usr/share/quilt/compat/date
31date is /scratch/oe/sysroots/i686-linux/usr/share/quilt/compat/date
32date is /bin/date
33date is /scratch/oe/sysroots/i686-linux/usr/share/quilt/compat/date
34date is /scratch/oe/sysroots/i686-linux/usr/share/quilt/compat/date
35date is /bin/date
36date is /scratch/oe/sysroots/i686-linux/usr/share/quilt/compat/date
37date is /scratch/oe/sysroots/i686-linux/usr/share/quilt/compat/date
38date is /bin/date
39date
40Khem
41Index: gcc-4.5/gcc/config/arm/arm.md
42===================================================================
43--- gcc-4.5.orig/gcc/config/arm/arm.md 2010-07-20 20:31:25.000000000 -0700
44+++ gcc-4.5/gcc/config/arm/arm.md 2010-07-22 14:55:54.303169081 -0700
45@@ -11197,15 +11197,21 @@
46 (set_attr "length" "4")]
47 )
48
49-(define_insn "arm_rev"
50+(define_insn "*arm_rev"
51 [(set (match_operand:SI 0 "s_register_operand" "=r")
52 (bswap:SI (match_operand:SI 1 "s_register_operand" "r")))]
53- "TARGET_EITHER && arm_arch6"
54- "rev\t%0, %1"
55- [(set (attr "length")
56- (if_then_else (eq_attr "is_thumb" "yes")
57- (const_int 2)
58- (const_int 4)))]
59+ "TARGET_32BIT && arm_arch6"
60+ "rev%?\t%0, %1"
61+ [(set_attr "predicable" "yes")
62+ (set_attr "length" "4")]
63+)
64+
65+(define_insn "*thumb1_rev"
66+ [(set (match_operand:SI 0 "s_register_operand" "=l")
67+ (bswap:SI (match_operand:SI 1 "s_register_operand" "l")))]
68+ "TARGET_THUMB1 && arm_arch6"
69+ "rev\t%0, %1"
70+ [(set_attr "length" "2")]
71 )
72
73 (define_expand "arm_legacy_rev"
74Index: gcc-4.5/gcc/testsuite/gcc.target/arm/pr43698.c
75===================================================================
76--- /dev/null 1970-01-01 00:00:00.000000000 +0000
77+++ gcc-4.5/gcc/testsuite/gcc.target/arm/pr43698.c 2010-07-22 14:56:35.406670213 -0700
78@@ -0,0 +1,39 @@
79+/* { dg-do run } */
80+/* { dg-options "-Os -march=armv7-a" } */
81+#include <stdint.h>
82+#include <stdlib.h>
83+
84+
85+char do_reverse_endian = 0;
86+
87+# define bswap_32(x) \
88+ ((((x) & 0xff000000) >> 24) | \
89+ (((x) & 0x00ff0000) >> 8) | \
90+ (((x) & 0x0000ff00) << 8) | \
91+ (((x) & 0x000000ff) << 24))
92+
93+#define EGET(X) \
94+ (__extension__ ({ \
95+ uint64_t __res; \
96+ if (!do_reverse_endian) { __res = (X); \
97+ } else if (sizeof(X) == 4) { __res = bswap_32((X)); \
98+ } \
99+ __res; \
100+ }))
101+
102+void __attribute__((noinline)) X(char **phdr, char **data, int *phoff)
103+{
104+ *phdr = *data + EGET(*phoff);
105+}
106+
107+int main()
108+{
109+ char *phdr;
110+ char *data = (char *)0x40164000;
111+ int phoff = 0x34;
112+ X(&phdr, &data, &phoff);
113+ if (phdr != (char *)0x40164034)
114+ abort ();
115+ exit (0);
116+}
117+