Hi Guys,

  The patch below fixes PR 68770 - a warning from valgrind about an
  uninitialised value being used in the default_secondary_reload.  The
  problem turns out to the in copy_costs which creates its own secondary
  reload information structure, but it does not initialise all of the
  fields.  One field in particular - t_icode - is examined by
  default_secondary_reload, and it was this that was triggering the
  valgrind warning.

  Tested with no regressions on a x86_64-pc-linux-gnu and a
  powerpc64-le-linux-gnu toolchain.

  OK to apply ?

Cheers
  Nick

gcc/ChangeLog
2015-12-22  Nick Clifton  <ni...@redhat.com>

        PR target/68770
        * ira-costs.c (copy_cost): Initialise the t_code field of the sri
        structure.

Index: ira-costs.c
===================================================================
--- ira-costs.c (revision 231898)
+++ ira-costs.c (working copy)
@@ -442,6 +442,9 @@
      copy it.  */
   sri.prev_sri = prev_sri;
   sri.extra_cost = 0;
+  /* PR 68770: Secondary reload might examine the t_icode field.  */
+  sri.t_icode = CODE_FOR_nothing;
+
   secondary_class = targetm.secondary_reload (to_p, x, rclass, mode, &sri);
 
   if (secondary_class != NO_REGS)

Reply via email to