This patch fixes an issue where tree-strlen was incorrectly removing a
store of 0 into a string because it thought a prior CLOBBER (which is
an empty constructor with no elements) was zero-initializing the
string.

Bootstrapped and tested on x86_64-unknown-linux-gnu. OK for trunk?

Thanks,
Teresa

2014-11-12    <tejohn...@google.com>

        PR tree-optimization/63841
        * tree.c (initializer_zerop): A constructor with no elements
        does not zero initialize.

Index: tree.c
===================================================================
--- tree.c      (revision 217190)
+++ tree.c      (working copy)
@@ -10330,6 +10330,8 @@ initializer_zerop (const_tree init)
       {
        unsigned HOST_WIDE_INT idx;

+        if (!CONSTRUCTOR_NELTS (init))
+          return false;
        FOR_EACH_CONSTRUCTOR_VALUE (CONSTRUCTOR_ELTS (init), idx, elt)
          if (!initializer_zerop (elt))
            return false;


-- 
Teresa Johnson | Software Engineer | tejohn...@google.com | 408-460-2413

Reply via email to