]> gcc.gnu.org Git - gcc.git/commitdiff
builtins.c (build_string_literal): Avoid generating a non-gimple_val result.
authorRichard Guenther <rguenther@suse.de>
Fri, 30 May 2008 19:58:30 +0000 (19:58 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Fri, 30 May 2008 19:58:30 +0000 (19:58 +0000)
2008-05-30  Richard Guenther  <rguenther@suse.de>

* builtins.c (build_string_literal): Avoid generating
a non-gimple_val result.

From-SVN: r136222

gcc/ChangeLog
gcc/builtins.c

index 9d29edca4fc92c81ba1d53808788565a28a9cbfd..82739e03eff3666f1ae3821ef76fb1d57976524f 100644 (file)
@@ -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
index 695567cfbfc8e0981698991f0d305b11232f7e8f..77cd48beaed6924dcf602e0500e517ec5ea04d01 100644 (file)
@@ -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;
 }
 
This page took 0.081771 seconds and 5 git commands to generate.