public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r11-4739] Fix uninitialized memory use in ipa-modref
@ 2020-11-05 14:25 Jan Hubicka
  0 siblings, 0 replies; only message in thread
From: Jan Hubicka @ 2020-11-05 14:25 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:ea937e7d8730b4faa18bc67413dbb14567be7390

commit r11-4739-gea937e7d8730b4faa18bc67413dbb14567be7390
Author: Jan Hubicka <jh@suse.cz>
Date:   Thu Nov 5 15:25:14 2020 +0100

    Fix uninitialized memory use in ipa-modref
    
            * ipa-modref.c (parm_map_for_arg): Initialize parm_offset and
            parm_offset_knonw.
            (read_section): Set writes_errno to false.

Diff:
---
 gcc/ipa-modref.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/gcc/ipa-modref.c b/gcc/ipa-modref.c
index b40f3da3ba2..9df3d2bcf2d 100644
--- a/gcc/ipa-modref.c
+++ b/gcc/ipa-modref.c
@@ -525,6 +525,9 @@ parm_map_for_arg (gimple *stmt, int i)
   poly_int64 offset;
   struct modref_parm_map parm_map;
 
+  parm_map.parm_offset_known = false;
+  parm_map.parm_offset = 0;
+
   offset_known = unadjusted_ptr_and_unit_offset (op, &op, &offset);
   if (TREE_CODE (op) == SSA_NAME
       && SSA_NAME_IS_DEFAULT_DEF (op)
@@ -1533,10 +1536,12 @@ read_section (struct lto_file_decl_data *file_data, const char *data,
       modref_summary_lto *modref_sum_lto = summaries_lto
 					   ? summaries_lto->get_create (node)
 					   : NULL;
-
       if (optimization_summaries)
 	modref_sum = optimization_summaries->get_create (node);
 
+      if (modref_sum)
+	modref_sum->writes_errno = false;
+
       gcc_assert (!modref_sum || (!modref_sum->loads
 				  && !modref_sum->stores));
       gcc_assert (!modref_sum_lto || (!modref_sum_lto->loads


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-11-05 14:25 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-05 14:25 [gcc r11-4739] Fix uninitialized memory use in ipa-modref Jan Hubicka

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).