diff mbox series

Small tweak to expand_used_vars

Message ID 5639994.MhkbZ0Pkbq@arcturus
State New
Headers show
Series Small tweak to expand_used_vars | expand

Commit Message

Eric Botcazou Aug. 11, 2021, 1:34 p.m. UTC
This completes the replacement of DECL_ATTRIBUTES (current_function_decl) with 
the attribs local variable.

Tested on x86-64/Linux, applied on the mainline as obvious.


2021-08-11  Eric Botcazuo  <ebotcazou@adacore.com>

	* cfgexpand.c (expand_used_vars): Reuse attribs local variable.
diff mbox series

Patch

diff --git a/gcc/cfgexpand.c b/gcc/cfgexpand.c
index 818328071db..03260b019e5 100644
--- a/gcc/cfgexpand.c
+++ b/gcc/cfgexpand.c
@@ -2294,22 +2294,19 @@  expand_used_vars (bitmap forced_stack_vars)
 	if (gen_stack_protect_signal
 	    || cfun->calls_alloca
 	    || has_protected_decls
-	    || lookup_attribute ("stack_protect",
-				 DECL_ATTRIBUTES (current_function_decl)))
+	    || lookup_attribute ("stack_protect", attribs))
 	  create_stack_guard ();
 	break;
 
       case SPCT_FLAG_DEFAULT:
 	if (cfun->calls_alloca
 	    || has_protected_decls
-	    || lookup_attribute ("stack_protect",
-				 DECL_ATTRIBUTES (current_function_decl)))
+	    || lookup_attribute ("stack_protect", attribs))
 	  create_stack_guard ();
 	break;
 
       case SPCT_FLAG_EXPLICIT:
-	if (lookup_attribute ("stack_protect",
-			      DECL_ATTRIBUTES (current_function_decl)))
+	if (lookup_attribute ("stack_protect", attribs))
 	  create_stack_guard ();
 	break;