]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
backport: re PR target/85593 (GCC on ARM allocates R3 for local variable when calling...
authorJakub Jelinek <jakub@redhat.com>
Fri, 30 Aug 2019 11:19:17 +0000 (13:19 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Fri, 30 Aug 2019 11:19:17 +0000 (13:19 +0200)
Backported from mainline
2018-12-07  Jakub Jelinek  <jakub@redhat.com>

PR target/85593
* final.c (rest_of_handle_final): Don't call collect_fn_hard_reg_usage
for functions with naked attribute.

From-SVN: r275077

gcc/ChangeLog
gcc/final.c

index 131276bcf50b69b3c448955df0ed17d1a82c0b32..434031d876d0a796fc9028d681fa5a95b3906a73 100644 (file)
@@ -1,6 +1,12 @@
 2019-08-30  Jakub Jelinek  <jakub@redhat.com>
 
        Backported from mainline
+       2018-12-07  Jakub Jelinek  <jakub@redhat.com>
+
+       PR target/85593
+       * final.c (rest_of_handle_final): Don't call collect_fn_hard_reg_usage
+       for functions with naked attribute.
+
        2018-11-20  Jakub Jelinek  <jakub@redhat.com>
 
        PR tree-optimization/87895
index c3023285c216d15e937d0fc70c55b2a6eb5728cc..43743f05d847c353220d49903af6dbdf5180df5c 100644 (file)
@@ -4490,7 +4490,11 @@ rest_of_handle_final (void)
   assemble_start_function (current_function_decl, fnname);
   final_start_function (get_insns (), asm_out_file, optimize);
   final (get_insns (), asm_out_file, optimize);
-  if (flag_ipa_ra)
+  if (flag_ipa_ra
+      /* 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 ();