aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.4.3
diff options
context:
space:
mode:
authorAndrew Hsieh <andrewhsieh@google.com>2012-11-30 13:28:55 +0800
committerAndrew Hsieh <andrewhsieh@google.com>2012-12-02 12:30:51 +0800
commit85e4e292e4b1f9cbd85e9db9310fbcbc59e3ac23 (patch)
tree8d7150290b7cc1d0f846c2a54231216afcb5e967 /gcc-4.4.3
parent5bd430abc2568af86ea97f8133c23ca8dc383cd8 (diff)
downloadtoolchain_gcc-85e4e292e4b1f9cbd85e9db9310fbcbc59e3ac23.tar.gz
toolchain_gcc-85e4e292e4b1f9cbd85e9db9310fbcbc59e3ac23.tar.bz2
toolchain_gcc-85e4e292e4b1f9cbd85e9db9310fbcbc59e3ac23.zip
Fix GCC 4.6 ARM ICE at reload1.c:1061
See http://code.google.com/p/android/issues/detail?id=20862 Disable r172951 in -O0 to fix issue. r172951 optimizes the case when the estimated funciton size is small, all branches in funciton become short jump, ie. the function doesn't contain far jump which clobber register "lr". Unfortunately the estimation may not be correct before register allocation because spill code may increase the function size and invalidate the assumption about whether to save/restore "lr" or not. Fortunately, "lr" is already save/restored when the funciton use r4-r7 or contains spill code. r172951 works because register allocator must exhaust r4-r7 before spill code, so the size estimation when r4-r7 are NOT used is accurate. Unfortunately this isn't the case in -O0 when compiler doesn't use r4-r7 at all yet somehow the size estimation is wrong. Disable it for -O0 r172951 | carrot | 2011-04-26 09:55:33 +0800 (Tue, 26 Apr 2011) | 5 lines * gcc/config/arm/arm.c (SHORTEST_FAR_JUMP_LENGTH): New constant. (estimate_function_length): New function. (thumb_far_jump_used_p): No far jump is needed in short function. Change-Id: I0973d2141787332fc61501fbe76dc7c44c9d1282
Diffstat (limited to 'gcc-4.4.3')
-rw-r--r--gcc-4.4.3/gcc/config/arm/arm.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc-4.4.3/gcc/config/arm/arm.c b/gcc-4.4.3/gcc/config/arm/arm.c
index 054383ca0..bef07e3d1 100644
--- a/gcc-4.4.3/gcc/config/arm/arm.c
+++ b/gcc-4.4.3/gcc/config/arm/arm.c
@@ -18526,8 +18526,8 @@ thumb_far_jump_used_p (void)
/* In reload pass we haven't got the exact jump instruction length,
but we can get a reasonable estimation based on the maximum
- possible function length. */
- if (!reload_completed)
+ possible function length. */
+ if (optimize && !reload_completed)
{
int function_length = estimate_function_length();
if (function_length < SHORTEST_FAR_JUMP_LENGTH)