aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChung-Ju Wu <jasonwucj@gmail.com>2018-08-12 13:41:22 +0000
committerChung-Ju Wu <jasonwucj@gcc.gnu.org>2018-08-12 13:41:22 +0000
commitd057a470d3bbf617b86f0010cae9cb1741661918 (patch)
tree16cdd65673f7db27b38450ee4e12dc842d31a2d8
parent68acadb1ff292f5f62cdeb5a17dcb92613087727 (diff)
downloadgcc-d057a470d3bbf617b86f0010cae9cb1741661918.zip
gcc-d057a470d3bbf617b86f0010cae9cb1741661918.tar.gz
gcc-d057a470d3bbf617b86f0010cae9cb1741661918.tar.bz2
[NDS32] Add new option: -msched-prolog-epilog
gcc/ * config/nds32/nds32.c (nds32_expand_prologue, nds32_expand_epilogue): Support -msched-prolog-epilog option. * config/nds32/nds32.opt (msched-prolog-epilog): New option. From-SVN: r263496
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/config/nds32/nds32.c16
-rw-r--r--gcc/config/nds32/nds32.opt4
3 files changed, 20 insertions, 6 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 59f48ee..02f007b 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,11 @@
2018-08-12 Chung-Ju Wu <jasonwucj@gmail.com>
+ * config/nds32/nds32.c (nds32_expand_prologue, nds32_expand_epilogue):
+ Support -msched-prolog-epilog option.
+ * config/nds32/nds32.opt (msched-prolog-epilog): New option.
+
+2018-08-12 Chung-Ju Wu <jasonwucj@gmail.com>
+
* common/config/nds32/nds32-common.c
(nds32_option_optimization_table): Enalbe -malways-align.
diff --git a/gcc/config/nds32/nds32.c b/gcc/config/nds32/nds32.c
index f68341e..d58be37 100644
--- a/gcc/config/nds32/nds32.c
+++ b/gcc/config/nds32/nds32.c
@@ -4763,9 +4763,11 @@ nds32_expand_prologue (void)
if (flag_pic && df_regs_ever_live_p (PIC_OFFSET_TABLE_REGNUM))
nds32_emit_load_gp ();
- /* Prevent the instruction scheduler from
- moving instructions across the boundary. */
- emit_insn (gen_blockage ());
+ /* If user applies -mno-sched-prolog-epilog option,
+ we need to prevent instructions of function body from being
+ scheduled with stack adjustment in prologue. */
+ if (!flag_sched_prolog_epilog)
+ emit_insn (gen_blockage ());
}
/* Function for normal multiple pop epilogue. */
@@ -4779,9 +4781,11 @@ nds32_expand_epilogue (bool sibcall_p)
The result will be in cfun->machine. */
nds32_compute_stack_frame ();
- /* Prevent the instruction scheduler from
- moving instructions across the boundary. */
- emit_insn (gen_blockage ());
+ /* If user applies -mno-sched-prolog-epilog option,
+ we need to prevent instructions of function body from being
+ scheduled with stack adjustment in epilogue. */
+ if (!flag_sched_prolog_epilog)
+ emit_insn (gen_blockage ());
/* If the function is 'naked', we do not have to generate
epilogue code fragment BUT 'ret' instruction.
diff --git a/gcc/config/nds32/nds32.opt b/gcc/config/nds32/nds32.opt
index d73f5af..0e50c99 100644
--- a/gcc/config/nds32/nds32.opt
+++ b/gcc/config/nds32/nds32.opt
@@ -444,6 +444,10 @@ mforce-no-ext-dsp
Target Undocumented Report Mask(FORCE_NO_EXT_DSP)
Force disable hardware loop, even use -mext-dsp.
+msched-prolog-epilog
+Target Var(flag_sched_prolog_epilog) Init(0)
+Permit scheduling of a function's prologue and epilogue sequence.
+
mret-in-naked-func
Target Var(flag_ret_in_naked_func) Init(1)
Generate return instruction in naked function.