summaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-devtools/gcc/gcc-4.5/linaro/gcc-4.5-linaro-r99483.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta-oe/recipes-devtools/gcc/gcc-4.5/linaro/gcc-4.5-linaro-r99483.patch')
-rw-r--r--meta-oe/recipes-devtools/gcc/gcc-4.5/linaro/gcc-4.5-linaro-r99483.patch63
1 files changed, 63 insertions, 0 deletions
diff --git a/meta-oe/recipes-devtools/gcc/gcc-4.5/linaro/gcc-4.5-linaro-r99483.patch b/meta-oe/recipes-devtools/gcc/gcc-4.5/linaro/gcc-4.5-linaro-r99483.patch
new file mode 100644
index 000000000..c0be4a03b
--- /dev/null
+++ b/meta-oe/recipes-devtools/gcc/gcc-4.5/linaro/gcc-4.5-linaro-r99483.patch
@@ -0,0 +1,63 @@
12011-02-11 Richard Sandiford <richard.sandiford@linaro.org>
2
3 gcc/
4 * cse.c (count_reg_usage): Check side_effects_p. Remove the
5 separate check for volatile asms.
6
7 gcc/testsuite/
8 * gcc.dg/torture/volatile-pic-1.c: New test.
9
10=== modified file 'gcc/cse.c'
11--- old/gcc/cse.c 2010-11-26 12:03:32 +0000
12+++ new/gcc/cse.c 2011-02-11 09:27:19 +0000
13@@ -6634,9 +6634,10 @@
14 case CALL_INSN:
15 case INSN:
16 case JUMP_INSN:
17- /* We expect dest to be NULL_RTX here. If the insn may trap, mark
18- this fact by setting DEST to pc_rtx. */
19- if (insn_could_throw_p (x))
20+ /* We expect dest to be NULL_RTX here. If the insn may trap,
21+ or if it cannot be deleted due to side-effects, mark this fact
22+ by setting DEST to pc_rtx. */
23+ if (insn_could_throw_p (x) || side_effects_p (PATTERN (x)))
24 dest = pc_rtx;
25 if (code == CALL_INSN)
26 count_reg_usage (CALL_INSN_FUNCTION_USAGE (x), counts, dest, incr);
27@@ -6676,10 +6677,6 @@
28 return;
29
30 case ASM_OPERANDS:
31- /* If the asm is volatile, then this insn cannot be deleted,
32- and so the inputs *must* be live. */
33- if (MEM_VOLATILE_P (x))
34- dest = NULL_RTX;
35 /* Iterate over just the inputs, not the constraints as well. */
36 for (i = ASM_OPERANDS_INPUT_LENGTH (x) - 1; i >= 0; i--)
37 count_reg_usage (ASM_OPERANDS_INPUT (x, i), counts, dest, incr);
38
39=== added file 'gcc/testsuite/gcc.dg/torture/volatile-pic-1.c'
40--- old/gcc/testsuite/gcc.dg/torture/volatile-pic-1.c 1970-01-01 00:00:00 +0000
41+++ new/gcc/testsuite/gcc.dg/torture/volatile-pic-1.c 2011-02-11 09:27:19 +0000
42@@ -0,0 +1,20 @@
43+/* { dg-do run } */
44+/* { dg-require-visibility "" } */
45+/* { dg-require-effective-target fpic } */
46+/* { dg-options "-fPIC" } */
47+
48+volatile int x __attribute__((visibility("hidden")));
49+
50+void __attribute__((noinline)) bar (void)
51+{
52+#if defined (__arm__)
53+ asm volatile ("mov r3,%0" :: "r" (0xdeadbeef) : "r3");
54+#endif
55+ (void) x;
56+}
57+
58+int main (void)
59+{
60+ bar ();
61+ return 0;
62+}
63