aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Kenner <kenner@vlsi1.ultra.nyu.edu>1999-03-23 01:09:04 +0000
committerRichard Kenner <kenner@vlsi1.ultra.nyu.edu>1999-03-23 01:09:04 +0000
commit1f423f351e37560c66d78e5faa6a10bd14a71a5b (patch)
tree4c403b26bd812d7a64bf55e446f98d184b84d6cd
parent3932d0a4b673502c24a59742d4568b12b62f6dde (diff)
(expand_builtin, case BUILT_IN_CONSTANT_P): If MODE is VOIDmode, use
mode of expression. git-svn-id: https://gcc.gnu.org/svn/gcc/branches/premerge-fsf-branch@25917 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/expr.c23
1 files changed, 14 insertions, 9 deletions
diff --git a/gcc/expr.c b/gcc/expr.c
index 0d8b4f8bd76..6f72f703a37 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -8903,15 +8903,20 @@ expand_builtin (exp, target, subtarget, mode, ignore)
certain to be valid on this machine, then convert it to
whatever we need. */
else
- return
- convert_to_mode
- (mode,
- gen_rtx_CONST
- (ptr_mode,
- gen_rtx_CONSTANT_P_RTX (ptr_mode,
- expand_expr (arg, NULL_RTX,
- VOIDmode, 0))),
- 0);
+ {
+ if (mode == VOIDmode)
+ mode = TYPE_MODE (TREE_TYPE (exp));
+
+ return
+ convert_to_mode
+ (mode,
+ gen_rtx_CONST
+ (ptr_mode,
+ gen_rtx_CONSTANT_P_RTX (ptr_mode,
+ expand_expr (arg, NULL_RTX,
+ VOIDmode, 0))),
+ 0);
+ }
}