diff options
author | Richard Guenther <rguenther@suse.de> | 2008-05-30 19:58:30 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2008-05-30 19:58:30 +0000 |
commit | acdfeac3e1073d863467b59f5cbe7d9f99dca74b (patch) | |
tree | f3bb4d7db7f0a91324dcbe197825b92e718c759d | |
parent | 97c3860d8070502a581cf20b8a256d1b1a515a79 (diff) | |
download | gcc-acdfeac3e1073d863467b59f5cbe7d9f99dca74b.zip gcc-acdfeac3e1073d863467b59f5cbe7d9f99dca74b.tar.gz gcc-acdfeac3e1073d863467b59f5cbe7d9f99dca74b.tar.bz2 |
builtins.c (build_string_literal): Avoid generating a non-gimple_val result.
2008-05-30 Richard Guenther <rguenther@suse.de>
* builtins.c (build_string_literal): Avoid generating
a non-gimple_val result.
From-SVN: r136222
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/builtins.c | 9 |
2 files changed, 9 insertions, 5 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 9d29edc..82739e0 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2008-05-30 Richard Guenther <rguenther@suse.de> + + * builtins.c (build_string_literal): Avoid generating + a non-gimple_val result. + 2008-05-30 DJ Delorie <dj@redhat.com> * exec-tool.in: Use an environment variable (private) instead of a diff --git a/gcc/builtins.c b/gcc/builtins.c index 695567c..77cd48b 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; } |