From aa2642ef15852495d84f737010522358ed159271 Mon Sep 17 00:00:00 2001 From: Chung-Ju Wu Date: Fri, 16 Jan 2015 06:02:11 +0000 Subject: [PATCH] [NDS32] Fix wrong data flow when building nds32 target with --enable-checking=yes. gcc/ * config/nds32/constants.md (UNSPEC_VOLATILE_POP25_RETURN): New. * config/nds32/nds32.md (pop25return): New. * config/nds32/nds32.c (nds32_expand_epilogue_v3pop): Emit pop25return pattern. From-SVN: r219710 --- gcc/ChangeLog | 7 +++++++ gcc/config/nds32/constants.md | 1 + gcc/config/nds32/nds32.c | 3 +++ gcc/config/nds32/nds32.md | 12 ++++++++++++ 4 files changed, 23 insertions(+) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 5ef518b3d22..1d998d02fb7 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2015-01-16 Chung-Ju Wu + + * config/nds32/constants.md (UNSPEC_VOLATILE_POP25_RETURN): New. + * config/nds32/nds32.md (pop25return): New. + * config/nds32/nds32.c (nds32_expand_epilogue_v3pop): Emit + pop25return pattern. + 2015-01-16 Chung-Ju Wu * doc/invoke.texi (NDS32 Options): Remove -mforce-fp-as-gp, diff --git a/gcc/config/nds32/constants.md b/gcc/config/nds32/constants.md index 1c37c5fd724..ea1cd4cf52b 100644 --- a/gcc/config/nds32/constants.md +++ b/gcc/config/nds32/constants.md @@ -41,6 +41,7 @@ UNSPEC_VOLATILE_MTUSR UNSPEC_VOLATILE_SETGIE_EN UNSPEC_VOLATILE_SETGIE_DIS + UNSPEC_VOLATILE_POP25_RETURN ]) ;; ------------------------------------------------------------------------ diff --git a/gcc/config/nds32/nds32.c b/gcc/config/nds32/nds32.c index f7d5e706e56..d38ea896d79 100644 --- a/gcc/config/nds32/nds32.c +++ b/gcc/config/nds32/nds32.c @@ -3449,6 +3449,9 @@ nds32_expand_epilogue_v3pop (void) nds32_emit_stack_v3pop (Rb, Re, GEN_INT (14), GEN_INT (0)); } + + /* Generate return instruction. */ + emit_jump_insn (gen_pop25return ()); } /* ------------------------------------------------------------------------ */ diff --git a/gcc/config/nds32/nds32.md b/gcc/config/nds32/nds32.md index 8302969fcab..01faa681cad 100644 --- a/gcc/config/nds32/nds32.md +++ b/gcc/config/nds32/nds32.md @@ -2253,3 +2253,15 @@ create_template: (set_attr "length" "4")]) ;; ---------------------------------------------------------------------------- + +;; Pseudo NOPs + +(define_insn "pop25return" + [(return) + (unspec_volatile:SI [(reg:SI LP_REGNUM)] UNSPEC_VOLATILE_POP25_RETURN)] + "" + "! return for pop 25" + [(set_attr "length" "0")] +) + +;; ---------------------------------------------------------------------------- -- 2.30.2