https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110531

            Bug ID: 110531
           Summary: Vect: slp_done_for_suggested_uf is not initialized in
                    tree-vect-loop.cc
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: hliu at amperecomputing dot com
  Target Milestone: ---

This seems an obvious bug in tree-vect-loop.cc:

(1) This var is declared (but not initialized) and used in function
vect_analyze_loop_1:

  bool slp_done_for_suggested_uf;           <---- Warning, this is not
initialized

  /* Run the main analysis.  */
  opt_result res = vect_analyze_loop_2 (loop_vinfo, fatal,
                                        &suggested_unroll_factor,
                                        slp_done_for_suggested_uf);

(2) It is used before set in function vect_analyze_loop_2:
static opt_result
vect_analyze_loop_2 (loop_vec_info loop_vinfo, bool &fatal,
                     unsigned *suggested_unroll_factor,
                     bool& slp_done_for_suggested_uf)
  ...
  bool slp = !applying_suggested_uf || slp_done_for_suggested_uf;  <--- used
without initialized
  ...
  slp_done_for_suggested_uf = slp;


I don't know the detail logic and wonder if it should be initialized as "true"
or "false" (probably it should be "false").

Reply via email to