aboutsummaryrefslogtreecommitdiffstats
path: root/toolchain-layer/recipes-devtools/gcc/gcc-4.6/linaro/gcc-4.6-linaro-r106782.patch
blob: 5335a9e375068ebf9d47dc9a9690368704767d58 (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-12-17 22:51:25 +0000
+++ new/gcc/regcprop.c	2011-07-21 11:30:53 +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;
 }