aboutsummaryrefslogtreecommitdiff
path: root/gcc/final.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2018-12-07 00:41:04 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2018-12-07 00:41:04 +0100
commit820037ecf679ce5cadb5c91e07cfad2d6d57cf0c (patch)
treeccafd9c67b17129cb2f511f4ef2abe536c52cfaa /gcc/final.c
parent1e41b184480fb990c432624b5f698012fb0649e1 (diff)
downloadgcc-820037ecf679ce5cadb5c91e07cfad2d6d57cf0c.zip
gcc-820037ecf679ce5cadb5c91e07cfad2d6d57cf0c.tar.gz
gcc-820037ecf679ce5cadb5c91e07cfad2d6d57cf0c.tar.bz2
re PR target/85593 (GCC on ARM allocates R3 for local variable when calling naked function with O2 optimizations enabled)
PR target/85593 * final.c (rest_of_handle_final): Don't call collect_fn_hard_reg_usage for functions with naked attribute. * gcc.target/i386/pr85593.c: New test. From-SVN: r266881
Diffstat (limited to 'gcc/final.c')
-rw-r--r--gcc/final.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/gcc/final.c b/gcc/final.c
index f707d2f..4233181 100644
--- a/gcc/final.c
+++ b/gcc/final.c
@@ -4659,7 +4659,11 @@ rest_of_handle_final (void)
final_start_function_1 (&first, asm_out_file, &seen, optimize);
final_1 (first, asm_out_file, seen, optimize);
if (flag_ipa_ra
- && !lookup_attribute ("noipa", DECL_ATTRIBUTES (current_function_decl)))
+ && !lookup_attribute ("noipa", DECL_ATTRIBUTES (current_function_decl))
+ /* Functions with naked attributes are supported only with basic asm
+ statements in the body, thus for supported use cases the information
+ on clobbered registers is not available. */
+ && !lookup_attribute ("naked", DECL_ATTRIBUTES (current_function_decl)))
collect_fn_hard_reg_usage ();
final_end_function ();