summaryrefslogtreecommitdiff
path: root/gcc/builtins.c
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2008-05-30 19:58:30 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2008-05-30 19:58:30 +0000
commit40238f6439fd4250fee99bcea07e4096f34d4567 (patch)
treef3bb4d7db7f0a91324dcbe197825b92e718c759d /gcc/builtins.c
parent5346190fb4317c3ebaa785c8d8e39a749a385267 (diff)
downloadgcc-40238f6439fd4250fee99bcea07e4096f34d4567.tar.gz
2008-05-30 Richard Guenther <rguenther@suse.de>
* builtins.c (build_string_literal): Avoid generating a non-gimple_val result. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@136222 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/builtins.c')
-rw-r--r--gcc/builtins.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/gcc/builtins.c b/gcc/builtins.c
index 695567cfbfc..77cd48beaed 100644
--- a/gcc/builtins.c
+++ b/gcc/builtins.c
@@ -5249,18 +5249,17 @@ build_string_literal (int len, const char *str)
t = build_string (len, str);
elem = build_type_variant (char_type_node, 1, 0);
- index = build_index_type (build_int_cst (NULL_TREE, len - 1));
+ index = build_index_type (size_int (len - 1));
type = build_array_type (elem, index);
TREE_TYPE (t) = type;
TREE_CONSTANT (t) = 1;
TREE_READONLY (t) = 1;
TREE_STATIC (t) = 1;
- type = build_pointer_type (type);
- t = build1 (ADDR_EXPR, type, t);
-
type = build_pointer_type (elem);
- t = build1 (NOP_EXPR, type, t);
+ t = build1 (ADDR_EXPR, type,
+ build4 (ARRAY_REF, elem,
+ t, integer_zero_node, NULL_TREE, NULL_TREE));
return t;
}