re PR target/43920 (Choosing conditional execution over conditional branches for...
authorTom de Vries <tom@codesourcery.com>
Tue, 5 Apr 2011 10:33:13 +0000 (10:33 +0000)
committerTom de Vries <vries@gcc.gnu.org>
Tue, 5 Apr 2011 10:33:13 +0000 (10:33 +0000)
2011-04-05  Tom de Vries  <tom@codesourcery.com>

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

From-SVN: r171978

gcc/ChangeLog
gcc/config/arm/arm.h

index 15e1b86f40a524d2516d5a90ee53734382f527ff..3676c54ae304b3823b7ec0ffd26d800cffef9864 100644 (file)
@@ -1,3 +1,9 @@
+2011-04-05  Tom de Vries  <tom@codesourcery.com>
+
+       PR target/43920
+       * config/arm/arm.h (BRANCH_COST): Set to 1 for Thumb-2 when optimizing
+       for size.
+
 2011-04-05  Tom de Vries  <tom@codesourcery.com>
 
        PR target/43920
index 5c3f2f81fcedf08f6a79fd5369ff7cd01709a503..f302de2158f68bd3b9857be2688ea5e4d606c3c4 100644 (file)
@@ -2019,7 +2019,8 @@ typedef struct
 /* 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))
 \f
 /* Position Independent Code.  */
 /* We decide which register to use based on the compilation options and