summaryrefslogtreecommitdiffstats
path: root/recipes-devtools/gcc/gcc-4.5/linaro/gcc-4.5-linaro-r99405.patch
blob: 7fc943f4bc485aed793125bcc1b41e9fb438b744 (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
2010-09-22  Chung-Lin Tang  <cltang@codesourcery.com>

	Backport from mainline:

	2010-09-22  Chung-Lin Tang  <cltang@codesourcery.com>

	gcc/
	* postreload.c (move2add_note_store): Add reg_symbol_ref[] checks
	to update conditions. Fix reg_mode[] check.

=== modified file 'gcc/postreload.c'
Index: gcc-4.5/gcc/postreload.c
===================================================================
--- gcc-4.5.orig/gcc/postreload.c
+++ gcc-4.5/gcc/postreload.c
@@ -2103,15 +2103,17 @@ move2add_note_store (rtx dst, const_rtx 
 		       && (MODES_OK_FOR_MOVE2ADD
 			   (dst_mode, reg_mode[REGNO (XEXP (src, 1))])))
 		{
-		  if (reg_base_reg[REGNO (XEXP (src, 1))] < 0)
+		  if (reg_base_reg[REGNO (XEXP (src, 1))] < 0
+		      && reg_symbol_ref[REGNO (XEXP (src, 1))] == NULL_RTX)
 		    offset = reg_offset[REGNO (XEXP (src, 1))];
 		  /* Maybe the first register is known to be a
 		     constant.  */
 		  else if (reg_set_luid[REGNO (base_reg)]
 			   > move2add_last_label_luid
 			   && (MODES_OK_FOR_MOVE2ADD
-			       (dst_mode, reg_mode[REGNO (XEXP (src, 1))]))
-			   && reg_base_reg[REGNO (base_reg)] < 0)
+			       (dst_mode, reg_mode[REGNO (base_reg)]))
+			   && reg_base_reg[REGNO (base_reg)] < 0
+			   && reg_symbol_ref[REGNO (base_reg)] == NULL_RTX)
 		    {
 		      offset = reg_offset[REGNO (base_reg)];
 		      base_reg = XEXP (src, 1);