From: David Malcolm Date: Wed, 7 Dec 2016 16:41:05 +0000 (+0000) Subject: Introduce rtl_data::init_stack_alignment X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=8194c537463de4a5e6bd368c1c5fab2fafc40bdf;p=gcc.git Introduce rtl_data::init_stack_alignment Move this part of "expand"'s initialization of crtl into its own method so that it can used by the RTL frontend when postprocessing RTL dumps. gcc/ChangeLog: * cfgexpand.c (pass_expand::execute): Move stack initializations to rtl_data::init_stack_alignment and call it. * emit-rtl.c (rtl_data::init_stack_alignment): New method. * emit-rtl.h (rtl_data::init_stack_alignment): New method. From-SVN: r243371 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 966af5c56c0..1cf31bc3b4b 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2016-12-07 David Malcolm + + * cfgexpand.c (pass_expand::execute): Move stack initializations + to rtl_data::init_stack_alignment and call it. + * emit-rtl.c (rtl_data::init_stack_alignment): New method. + * emit-rtl.h (rtl_data::init_stack_alignment): New method. + 2016-12-07 Wilco Dijkstra * gcc/ira.c (ira_setup_eliminable_regset): Initialize crtl->is_leaf. diff --git a/gcc/cfgexpand.c b/gcc/cfgexpand.c index c3aca593e53..97dc6484364 100644 --- a/gcc/cfgexpand.c +++ b/gcc/cfgexpand.c @@ -6213,10 +6213,7 @@ pass_expand::execute (function *fun) discover_nonconstant_array_refs (); targetm.expand_to_rtl_hook (); - crtl->stack_alignment_needed = STACK_BOUNDARY; - crtl->max_used_stack_slot_alignment = STACK_BOUNDARY; - crtl->stack_alignment_estimated = 0; - crtl->preferred_stack_boundary = STACK_BOUNDARY; + crtl->init_stack_alignment (); fun->cfg->max_jumptable_ents = 0; /* Resovle the function section. Some targets, like ARM EABI rely on knowledge diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c index 5201bd0e0ef..9eccd6863ea 100644 --- a/gcc/emit-rtl.c +++ b/gcc/emit-rtl.c @@ -6291,5 +6291,17 @@ need_atomic_barrier_p (enum memmodel model, bool pre) gcc_unreachable (); } } + +/* Initialize fields of rtl_data related to stack alignment. */ + +void +rtl_data::init_stack_alignment () +{ + stack_alignment_needed = STACK_BOUNDARY; + max_used_stack_slot_alignment = STACK_BOUNDARY; + stack_alignment_estimated = 0; + preferred_stack_boundary = STACK_BOUNDARY; +} + #include "gt-emit-rtl.h" diff --git a/gcc/emit-rtl.h b/gcc/emit-rtl.h index a919bf072ab..88ba5894dfe 100644 --- a/gcc/emit-rtl.h +++ b/gcc/emit-rtl.h @@ -55,6 +55,8 @@ struct GTY(()) incoming_args { /* Datastructures maintained for currently processed function in RTL form. */ struct GTY(()) rtl_data { + void init_stack_alignment (); + struct expr_status expr; struct emit_status emit; struct varasm_status varasm;