summaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-devtools/gcc/gcc-4.5/linaro/gcc-4.5-linaro-r99530.patch
blob: 64d6262d6066ff8c357a89cf822050e05c0b8d4b (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
2011-07-21  Richard Sandiford  <rdsandiford@googlemail.com>

	gcc/
	Backport from mainline:

	2011-07-21  Richard Sandiford  <richard.sandiford@linaro.org>

	* regcprop.c (maybe_mode_change): Check HARD_REGNO_MODE_OK.

=== modified file 'gcc/regcprop.c'
--- old/gcc/regcprop.c	2010-08-05 15:28:47 +0000
+++ new/gcc/regcprop.c	2011-07-21 12:40:44 +0000
@@ -418,10 +418,9 @@
 
       offset = ((WORDS_BIG_ENDIAN ? wordoffset : 0)
 		+ (BYTES_BIG_ENDIAN ? byteoffset : 0));
-      return gen_rtx_raw_REG (new_mode,
-			      regno + subreg_regno_offset (regno, orig_mode,
-							   offset,
-							   new_mode));
+      regno += subreg_regno_offset (regno, orig_mode, offset, new_mode);
+      if (HARD_REGNO_MODE_OK (regno, new_mode))
+	return gen_rtx_raw_REG (new_mode, regno);
     }
   return NULL_RTX;
 }