aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1995-04-26 12:29:48 -0400
committerRichard Kenner <kenner@gcc.gnu.org>1995-04-26 12:29:48 -0400
commit33cf5823a5cb6439135e3820e924695819a4759f (patch)
treeb9b51dada4ca281467dd107bee78ebff55cf8fe4 /gcc
parentccafc85b7ff4c29f2ba72bc6fe19d91fe67da577 (diff)
downloadgcc-33cf5823a5cb6439135e3820e924695819a4759f.zip
gcc-33cf5823a5cb6439135e3820e924695819a4759f.tar.gz
gcc-33cf5823a5cb6439135e3820e924695819a4759f.tar.bz2
(expand_builtin, case BUILT_IN_CONSTANT_P): A pointer to a string
constant is a constant. From-SVN: r9475
Diffstat (limited to 'gcc')
-rw-r--r--gcc/expr.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/gcc/expr.c b/gcc/expr.c
index 04e5442..8186189 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -7505,8 +7505,15 @@ expand_builtin (exp, target, subtarget, mode, ignore)
if (arglist == 0)
return const0_rtx;
else
- return (TREE_CODE_CLASS (TREE_CODE (TREE_VALUE (arglist))) == 'c'
- ? const1_rtx : const0_rtx);
+ {
+ tree arg = TREE_VALUE (arglist);
+
+ STRIP_NOPS (arg);
+ return (TREE_CODE_CLASS (TREE_CODE (arg)) == 'c'
+ || (TREE_CODE (arg) == ADDR_EXPR
+ && TREE_CODE (TREE_OPERAND (arg, 0)) == STRING_CST)
+ ? const1_rtx : const0_rtx);
+ }
case BUILT_IN_FRAME_ADDRESS:
/* The argument must be a nonnegative integer constant.