diff options
author | Maxim Kuvyrkov <maxim@codesourcery.com> | 2010-05-06 10:28:46 +0000 |
---|---|---|
committer | Maxim Kuvyrkov <mkuvyrkov@gcc.gnu.org> | 2010-05-06 10:28:46 +0000 |
commit | 315a02daf18b7148822e1fed4b991a512be09138 (patch) | |
tree | 9319d57e69845176e990416338a7a051a090b809 | |
parent | 3734d9607ee407f4c73aa613f96dbfbc0dd6f500 (diff) | |
download | gcc-315a02daf18b7148822e1fed4b991a512be09138.zip gcc-315a02daf18b7148822e1fed4b991a512be09138.tar.gz gcc-315a02daf18b7148822e1fed4b991a512be09138.tar.bz2 |
* tree.c (initializer_zerop): Handle STRING_CST.
From-SVN: r159103
-rw-r--r-- | gcc/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/tree.c | 13 |
2 files changed, 17 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index fff9626..620ef3d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +2010-05-06 Maxim Kuvyrkov <maxim@codesourcery.com> + + * tree.c (initializer_zerop): Handle STRING_CST. + 2010-05-06 Manuel López-Ibáñez <manu@gcc.gnu.org> PR 40989 @@ -9414,6 +9414,19 @@ initializer_zerop (const_tree init) return true; } + case STRING_CST: + { + int i; + + /* We need to loop through all elements to handle cases like + "\0" and "\0foobar". */ + for (i = 0; i < TREE_STRING_LENGTH (init); ++i) + if (TREE_STRING_POINTER (init)[i] != '\0') + return false; + + return true; + } + default: return false; } |