2011-04-26  Andrew Stubbs  <ams@codesourcery.com>

	Backport from FSF:

	2011-04-05  Tom de Vries  <tom@codesourcery.com>

	PR target/43920
	gcc/
	* config/arm/arm.h (BRANCH_COST): Set to 1 for Thumb-2 when optimizing
	for size.

=== modified file 'gcc/config/arm/arm.h'
--- old/gcc/config/arm/arm.h	2011-05-03 15:17:25 +0000
+++ new/gcc/config/arm/arm.h	2011-04-26 14:42:21 +0000
@@ -2018,7 +2018,8 @@
 /* Try to generate sequences that don't involve branches, we can then use
    conditional instructions */
 #define BRANCH_COST(speed_p, predictable_p) \
-  (TARGET_32BIT ? 4 : (optimize > 0 ? 2 : 0))
+  (TARGET_32BIT ? (TARGET_THUMB2 && !speed_p ? 1 : 4) \
+		: (optimize > 0 ? 2 : 0))
 
 /* Position Independent Code.  */
 /* We decide which register to use based on the compilation options and

