aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/nds32/nds32.md
diff options
context:
space:
mode:
authorChung-Ju Wu <jasonwucj@gmail.com>2014-09-03 09:04:46 +0000
committerChung-Ju Wu <jasonwucj@gcc.gnu.org>2014-09-03 09:04:46 +0000
commit2da1e7c02214850d6b49a1f63c29fe6ccb7118a9 (patch)
treebc60ff7ca0482a432a6147cfc074d8038b2a1e98 /gcc/config/nds32/nds32.md
parent6f3d3f9c7c6db3468b8d0269bbca946df2c48d5f (diff)
downloadgcc-2da1e7c02214850d6b49a1f63c29fe6ccb7118a9.zip
gcc-2da1e7c02214850d6b49a1f63c29fe6ccb7118a9.tar.gz
gcc-2da1e7c02214850d6b49a1f63c29fe6ccb7118a9.tar.bz2
[NDS32] We need to make sure it is NOT a variadic function so that some v3push/v3pop preparation can be applied.
-- The rationale of such avoidance is that the 'pop25' instruction also contains return behavior and we have no chance to further adjust stack pointer before returning to caller, which is very important to variadic function. -- So we do not setup v3push/v3pop (push25/pop25) information for a variadic function. It will use normal stack push/pop instead. * config/nds32/nds32.c (nds32_compute_stack_frame): Do not use v3push/v3pop for variadic function. * config/nds32/nds32.md (prologue, epilogue): Likewise. From-SVN: r214857
Diffstat (limited to 'gcc/config/nds32/nds32.md')
-rw-r--r--gcc/config/nds32/nds32.md16
1 files changed, 12 insertions, 4 deletions
diff --git a/gcc/config/nds32/nds32.md b/gcc/config/nds32/nds32.md
index ccf33d9..18d6d1b 100644
--- a/gcc/config/nds32/nds32.md
+++ b/gcc/config/nds32/nds32.md
@@ -1971,8 +1971,12 @@ create_template:
(define_expand "prologue" [(const_int 0)]
""
{
- /* Note that only under V3/V3M ISA, we could use v3push prologue. */
- if (TARGET_V3PUSH)
+ /* Note that only under V3/V3M ISA, we could use v3push prologue.
+ In addition, we do not want to use v3push for isr function
+ and variadic function. */
+ if (TARGET_V3PUSH
+ && !nds32_isr_function_p (current_function_decl)
+ && (cfun->machine->va_args_size == 0))
nds32_expand_prologue_v3push ();
else
nds32_expand_prologue ();
@@ -1982,8 +1986,12 @@ create_template:
(define_expand "epilogue" [(const_int 0)]
""
{
- /* Note that only under V3/V3M ISA, we could use v3pop epilogue. */
- if (TARGET_V3PUSH)
+ /* Note that only under V3/V3M ISA, we could use v3pop epilogue.
+ In addition, we do not want to use v3pop for isr function
+ and variadic function. */
+ if (TARGET_V3PUSH
+ && !nds32_isr_function_p (current_function_decl)
+ && (cfun->machine->va_args_size == 0))
nds32_expand_epilogue_v3pop ();
else
nds32_expand_epilogue ();