From: Jan Hubicka Date: Thu, 5 Nov 2020 14:25:14 +0000 (+0100) Subject: Fix uninitialized memory use in ipa-modref X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ea937e7d8730b4faa18bc67413dbb14567be7390;p=gcc.git 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 --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