summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/gcc/gcc-4.6/fix-for-ice-50099.patch
blob: 57b03d2bfb874db99b01e2f970377c58a70abee8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
This patch address an issue with the compiler generating an ICE
during compliation of lttng-ust.

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

Upstream-Status: Pending

Signed-off-by: Khem Raj <khem.raj@gmail.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>

Index: gcc/config/arm/arm.md
===================================================================
--- gcc-4.6.0/gcc/config/arm/arm.md	(revision 178135)
+++ gcc-4.6.0/gcc/config/arm/arm.md	(working copy)
@@ -4217,6 +4217,7 @@ (define_split
   "TARGET_32BIT"
   [(set (match_dup 0) (ashiftrt:SI (match_dup 1) (const_int 31)))]
 {
+  rtx srcop = operands[1];
   rtx lo_part = gen_lowpart (SImode, operands[0]);
   enum machine_mode src_mode = GET_MODE (operands[1]);
 
@@ -4224,14 +4225,21 @@ (define_split
       && !reg_overlap_mentioned_p (operands[0], operands[1]))
     emit_clobber (operands[0]);
 
+  if (TARGET_ARM && src_mode == QImode
+      && !arm_reg_or_extendqisi_mem_op (srcop, QImode))
+    {
+      rtx dest = gen_lowpart (QImode, lo_part);
+      emit_move_insn (dest, srcop);
+      srcop = dest;
+    }
   if (!REG_P (lo_part) || src_mode != SImode
-      || !rtx_equal_p (lo_part, operands[1]))
+      || !rtx_equal_p (lo_part, srcop))
     {
       if (src_mode == SImode)
-        emit_move_insn (lo_part, operands[1]);
+        emit_move_insn (lo_part, srcop);
       else
         emit_insn (gen_rtx_SET (VOIDmode, lo_part,
-				gen_rtx_SIGN_EXTEND (SImode, operands[1])));
+				gen_rtx_SIGN_EXTEND (SImode, srcop)));
       operands[1] = lo_part;
     }
   operands[0] = gen_highpart (SImode, operands[0]);