aboutsummaryrefslogtreecommitdiff
path: root/gcc/expr.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/expr.c')
-rw-r--r--gcc/expr.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/gcc/expr.c b/gcc/expr.c
index 8d5fa10..d7f87c5 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -9131,8 +9131,9 @@ expand_builtin (exp, target, subtarget, mode, ignore)
if (DECL_FUNCTION_CODE (fndecl) == BUILT_IN_FRAME_ADDRESS)
return tem;
- if (GET_CODE (tem) != REG)
- tem = copy_to_reg (tem);
+ if (GET_CODE (tem) != REG
+ && ! CONSTANT_P (tem))
+ tem = copy_to_mode_reg (Pmode, tem);
return tem;
}