On Thu, Nov 13, 2014 at 6:36 AM, Jakub Jelinek <ja...@redhat.com> wrote: > On Thu, Nov 13, 2014 at 06:20:16AM -0800, Teresa Johnson wrote: >> Here is the new patch. Bootstrapped and tested on >> x86_64-unknown-linux-gnu. OK for trunk? >> >> Thanks, >> Teresa >> >> 2014-11-13 <tejohn...@google.com> >> >> gcc: >> PR tree-optimization/63841 >> * tree.c (initializer_zerop): A constructor with no elements >> does not zero initialize. >> >> gcc/testsuite: >> PR tree-optimization/63841 >> * g++.dg/tree-ssa/pr63841.C: New test. >> >> 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 (TREE_CLOBBER_P (init)) >> + return false; > > Wrong formatting.
Sorry, not sure I understand why? My mailer does tend to eat spaces, but it is indented the correct amount and I think has the right spaces within the line. > > Also, while this perhaps is useful, I'd say the right fix is that > strlen_optimize_stmt > should just ignore gimple_clobber_p (stmt) statements (well, call > the maybe_invalidate at the end for them). > So > - else if (is_gimple_assign (stmt)) > + else if (is_gimple_assign (stmt) && !gimple_clobber_p (stmt)) > in strlen_optimize_stmt. Ok, I have held off on my commit for now. I considered fixing this in tree-ssa-strlen, but thought this was a potentially larger problem with initializer_zerop, where it shouldn't be considering a clobber to be a zero init and might be affecting other callers as well. If we make the change to initializer_zerop is it still useful to change tree-strlen? Teresa > > Jakub -- Teresa Johnson | Software Engineer | tejohn...@google.com | 408-460-2413