]> git.ipfire.org Git - thirdparty/gcc.git/commit
vect: Avoid copying of uninitialized variable [PR118628]
authorJakub Jelinek <jakub@redhat.com>
Thu, 23 Jan 2025 19:03:36 +0000 (20:03 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Thu, 23 Jan 2025 19:03:36 +0000 (20:03 +0100)
commit8f6dd185d16dec8ca9351a754f0ece153f89d85c
treedadeee2faa06161a0b323181e931fe61ed5b4bba
parent3cef53a4d4ff44a5b61284bb0e6977f7ba7b3aab
vect: Avoid copying of uninitialized variable [PR118628]

vectorizable_{store,load} does roughly
      tree offvar;
      tree running_off;
      if (!costing_p)
        {
          ... initialize offvar ...
        }
      running_off = offvar;
      for (...)
        {
          if (costing_p)
            {
              ...
              continue;
            }
          ... use running_off ...
        }
so, it copies unconditionally sometimes uninitialized variable (but then
uses the copied variable only if it was set to something initialized).
Still, I think it is better to avoid copying around maybe uninitialized
vars.

2025-01-23  Jakub Jelinek  <jakub@redhat.com>

PR tree-optimization/118628
* tree-vect-stmts.cc (vectorizable_store, vectorizable_load):
Initialize offvar to NULL_TREE.
gcc/tree-vect-stmts.cc