diff options
Diffstat (limited to 'recipes-devtools/gcc/gcc-4.5/linaro/gcc-4.5-linaro-r99307.patch')
| -rw-r--r-- | recipes-devtools/gcc/gcc-4.5/linaro/gcc-4.5-linaro-r99307.patch | 138 |
1 files changed, 138 insertions, 0 deletions
diff --git a/recipes-devtools/gcc/gcc-4.5/linaro/gcc-4.5-linaro-r99307.patch b/recipes-devtools/gcc/gcc-4.5/linaro/gcc-4.5-linaro-r99307.patch new file mode 100644 index 0000000000..9c936d4fad --- /dev/null +++ b/recipes-devtools/gcc/gcc-4.5/linaro/gcc-4.5-linaro-r99307.patch | |||
| @@ -0,0 +1,138 @@ | |||
| 1 | 2010-07-12 Yao Qi <yao@codesourcery.com> | ||
| 2 | |||
| 3 | Merge from Sourcery G++ 4.4: | ||
| 4 | |||
| 5 | 2009-10-06 Paul Brook <paul@codesourcery.com> | ||
| 6 | Issue #3869 | ||
| 7 | gcc/ | ||
| 8 | * target.h (gcc_target): Add warn_func_result. | ||
| 9 | * target-def.h (TARGET_WARN_FUNC_RESULT): Define and use. | ||
| 10 | * tree-cfg.h (execute_warn_function_return): Use | ||
| 11 | targetm.warn_func_result. | ||
| 12 | * config/arm/arm.c (TARGET_WARN_FUNC_RESULT): Define. | ||
| 13 | (arm_warn_func_result): New function. | ||
| 14 | |||
| 15 | gcc/testuite/ | ||
| 16 | * gcc.target/arm/naked-3.c: New test. | ||
| 17 | |||
| 18 | 2010-07-10 Sandra Loosemore <sandra@codesourcery.com> | ||
| 19 | |||
| 20 | Backport from mainline: | ||
| 21 | |||
| 22 | === modified file 'gcc/config/arm/arm.c' | ||
| 23 | --- old/gcc/config/arm/arm.c 2010-07-29 16:58:56 +0000 | ||
| 24 | +++ new/gcc/config/arm/arm.c 2010-07-30 13:58:02 +0000 | ||
| 25 | @@ -214,6 +214,7 @@ | ||
| 26 | static int arm_issue_rate (void); | ||
| 27 | static void arm_output_dwarf_dtprel (FILE *, int, rtx) ATTRIBUTE_UNUSED; | ||
| 28 | static bool arm_allocate_stack_slots_for_args (void); | ||
| 29 | +static bool arm_warn_func_result (void); | ||
| 30 | static const char *arm_invalid_parameter_type (const_tree t); | ||
| 31 | static const char *arm_invalid_return_type (const_tree t); | ||
| 32 | static tree arm_promoted_type (const_tree t); | ||
| 33 | @@ -378,6 +379,9 @@ | ||
| 34 | #undef TARGET_TRAMPOLINE_ADJUST_ADDRESS | ||
| 35 | #define TARGET_TRAMPOLINE_ADJUST_ADDRESS arm_trampoline_adjust_address | ||
| 36 | |||
| 37 | +#undef TARGET_WARN_FUNC_RESULT | ||
| 38 | +#define TARGET_WARN_FUNC_RESULT arm_warn_func_result | ||
| 39 | + | ||
| 40 | #undef TARGET_DEFAULT_SHORT_ENUMS | ||
| 41 | #define TARGET_DEFAULT_SHORT_ENUMS arm_default_short_enums | ||
| 42 | |||
| 43 | @@ -2008,6 +2012,14 @@ | ||
| 44 | return !IS_NAKED (arm_current_func_type ()); | ||
| 45 | } | ||
| 46 | |||
| 47 | +static bool | ||
| 48 | +arm_warn_func_result (void) | ||
| 49 | +{ | ||
| 50 | + /* Naked functions are implemented entirely in assembly, including the | ||
| 51 | + return sequence, so suppress warnings about this. */ | ||
| 52 | + return !IS_NAKED (arm_current_func_type ()); | ||
| 53 | +} | ||
| 54 | + | ||
| 55 | |||
| 56 | /* Output assembler code for a block containing the constant parts | ||
| 57 | of a trampoline, leaving space for the variable parts. | ||
| 58 | |||
| 59 | === modified file 'gcc/target-def.h' | ||
| 60 | --- old/gcc/target-def.h 2010-03-24 20:44:48 +0000 | ||
| 61 | +++ new/gcc/target-def.h 2010-07-30 13:58:02 +0000 | ||
| 62 | @@ -212,6 +212,10 @@ | ||
| 63 | #define TARGET_EXTRA_LIVE_ON_ENTRY hook_void_bitmap | ||
| 64 | #endif | ||
| 65 | |||
| 66 | +#ifndef TARGET_WARN_FUNC_RESULT | ||
| 67 | +#define TARGET_WARN_FUNC_RESULT hook_bool_void_true | ||
| 68 | +#endif | ||
| 69 | + | ||
| 70 | #ifndef TARGET_ASM_FILE_START_APP_OFF | ||
| 71 | #define TARGET_ASM_FILE_START_APP_OFF false | ||
| 72 | #endif | ||
| 73 | @@ -1020,6 +1024,7 @@ | ||
| 74 | TARGET_EMUTLS, \ | ||
| 75 | TARGET_OPTION_HOOKS, \ | ||
| 76 | TARGET_EXTRA_LIVE_ON_ENTRY, \ | ||
| 77 | + TARGET_WARN_FUNC_RESULT, \ | ||
| 78 | TARGET_UNWIND_TABLES_DEFAULT, \ | ||
| 79 | TARGET_HAVE_NAMED_SECTIONS, \ | ||
| 80 | TARGET_HAVE_SWITCHABLE_BSS_SECTIONS, \ | ||
| 81 | |||
| 82 | === modified file 'gcc/target.h' | ||
| 83 | --- old/gcc/target.h 2010-03-27 10:27:39 +0000 | ||
| 84 | +++ new/gcc/target.h 2010-07-30 13:58:02 +0000 | ||
| 85 | @@ -1171,6 +1171,10 @@ | ||
| 86 | bits in the bitmap passed in. */ | ||
| 87 | void (*live_on_entry) (bitmap); | ||
| 88 | |||
| 89 | + /* Return false if warnings about missing return statements or suspect | ||
| 90 | + noreturn attributes should be suppressed for the current function. */ | ||
| 91 | + bool (*warn_func_result) (void); | ||
| 92 | + | ||
| 93 | /* True if unwinding tables should be generated by default. */ | ||
| 94 | bool unwind_tables_default; | ||
| 95 | |||
| 96 | |||
| 97 | === added file 'gcc/testsuite/gcc.target/arm/naked-3.c' | ||
| 98 | --- old/gcc/testsuite/gcc.target/arm/naked-3.c 1970-01-01 00:00:00 +0000 | ||
| 99 | +++ new/gcc/testsuite/gcc.target/arm/naked-3.c 2010-07-30 13:58:02 +0000 | ||
| 100 | @@ -0,0 +1,15 @@ | ||
| 101 | +/* { dg-do compile } */ | ||
| 102 | +/* { dg-options "-O2 -Wall" } */ | ||
| 103 | +/* Check that we do not get warnings about missing return statements | ||
| 104 | + or bogus looking noreturn functions. */ | ||
| 105 | +int __attribute__((naked)) | ||
| 106 | +foo(void) | ||
| 107 | +{ | ||
| 108 | + __asm__ volatile ("mov r0, #1\r\nbx lr\n"); | ||
| 109 | +} | ||
| 110 | + | ||
| 111 | +int __attribute__((naked,noreturn)) | ||
| 112 | +bar(void) | ||
| 113 | +{ | ||
| 114 | + __asm__ volatile ("frob r0\n"); | ||
| 115 | +} | ||
| 116 | |||
| 117 | === modified file 'gcc/tree-cfg.c' | ||
| 118 | --- old/gcc/tree-cfg.c 2010-03-16 12:31:38 +0000 | ||
| 119 | +++ new/gcc/tree-cfg.c 2010-07-30 13:58:02 +0000 | ||
| 120 | @@ -47,6 +47,7 @@ | ||
| 121 | #include "value-prof.h" | ||
| 122 | #include "pointer-set.h" | ||
| 123 | #include "tree-inline.h" | ||
| 124 | +#include "target.h" | ||
| 125 | |||
| 126 | /* This file contains functions for building the Control Flow Graph (CFG) | ||
| 127 | for a function tree. */ | ||
| 128 | @@ -7092,6 +7093,9 @@ | ||
| 129 | edge e; | ||
| 130 | edge_iterator ei; | ||
| 131 | |||
| 132 | + if (!targetm.warn_func_result()) | ||
| 133 | + return 0; | ||
| 134 | + | ||
| 135 | /* If we have a path to EXIT, then we do return. */ | ||
| 136 | if (TREE_THIS_VOLATILE (cfun->decl) | ||
| 137 | && EDGE_COUNT (EXIT_BLOCK_PTR->preds) > 0) | ||
| 138 | |||
