public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Martin Liška" <mliska@suse.cz>
To: Jeff Law <law@redhat.com>, gcc-patches@gcc.gnu.org
Cc: Jakub Jelinek <jakub@redhat.com>, Michael Matz <matz@suse.de>
Subject: Re: [PATCH] Optimize macro: make it more predictable
Date: Mon, 9 Nov 2020 11:36:26 +0100	[thread overview]
Message-ID: <32537beb-0486-3352-5f2a-89976107824f@suse.cz> (raw)
In-Reply-To: <2b4f60d1-3488-d014-8e79-bcf9bf52bdfe@redhat.com>

On 11/6/20 6:34 PM, Jeff Law wrote:
> So you XNEWVEC and store the result into "merge_decoded_options".  But
> you free "decoded_options".  Was that intentional?

Hello.

Good point here.

> 
> This seems to bring a bit more predictability, but I suspect there's
> more to do here.

Yes, both should be freed. One can see the following leak on master:

==12237== 176 bytes in 1 blocks are definitely lost in loss record 669 of 786
==12237==    at 0x483BD7B: realloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==12237==    by 0x1AB10CD: xrealloc (xmalloc.c:179)
==12237==    by 0x1A1AE59: prune_options (opts-common.c:1139)
==12237==    by 0x1A1AE59: decode_cmdline_options_to_array(unsigned int, char const**, unsigned int, cl_decoded_option**, unsigned int*) (opts-common.c:1027)
==12237==    by 0xDCD456: decode_cmdline_options_to_array_default_mask(unsigned int, char const**, cl_decoded_option**, unsigned int*) (opts-global.c:273)
==12237==    by 0x921377: parse_optimize_options(tree_node*, bool) (c-common.c:5709)
==12237==    by 0x9768DB: handle_optimize_attribute(tree_node**, tree_node*, tree_node*, int, bool*) (c-attribs.c:4962)
==12237==    by 0x84596A: decl_attributes(tree_node**, tree_node*, int, tree_node*) (attribs.c:723)
==12237==    by 0x856F88: c_decl_attributes(tree_node**, tree_node*, int) (c-decl.c:5043)
==12237==    by 0x8661E5: start_function(c_declspecs*, c_declarator*, tree_node*) (c-decl.c:9408)
==12237==    by 0x8D644A: c_parser_declaration_or_fndef(c_parser*, bool, bool, bool, bool, bool, tree_node**, vec<c_token, va_heap, vl_ptr>, bool, tree_node*, oacc_routine_data*, bool*) (c-parser.c:2444)
==12237==    by 0x8DF343: c_parser_external_declaration(c_parser*) (c-parser.c:1777)
==12237==    by 0x8DFE41: c_parser_translation_unit (c-parser.c:1650)
==12237==    by 0x8DFE41: c_parse_file() (c-parser.c:21876)

Martin

  reply	other threads:[~2020-11-09 10:36 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-23 11:47 Martin Liška
2020-11-03 13:27 ` Richard Biener
2020-11-03 13:34   ` Jakub Jelinek
2020-11-03 13:40     ` Richard Biener
2020-11-09 10:35     ` Martin Liška
2020-11-26 13:56       ` Martin Liška
2020-12-07 11:03         ` Martin Liška
2021-01-11 13:10           ` Martin Liška
2020-11-09 10:27   ` Martin Liška
2020-11-06 17:34 ` Jeff Law
2020-11-09 10:36   ` Martin Liška [this message]
2021-07-01 13:13 ` Martin Liška
2021-08-10 15:52   ` Martin Liška
2021-08-24 11:06     ` Martin Liška
2021-08-24 12:13   ` Richard Biener
2021-08-24 13:04     ` Martin Liška
2021-08-26 11:04       ` Richard Biener
2021-08-26 12:39         ` Martin Liška
2021-08-26 13:20           ` Richard Biener
2021-08-27  8:35           ` Martin Liška
2021-08-27  9:05             ` Richard Biener
2021-09-13 13:52               ` Martin Liška
2021-09-19  5:46                 ` Jeff Law
2021-09-06 11:37         ` [PATCH] flag_complex_method: support optimize attribute Martin Liška
2021-09-06 11:46           ` Jakub Jelinek
2021-09-06 12:16             ` Richard Biener
2021-09-06 12:24               ` Jakub Jelinek
2021-09-07  9:42               ` Martin Liška
2021-09-13 13:32                 ` Martin Liška
2021-09-19 14:45                 ` Jeff Law

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=32537beb-0486-3352-5f2a-89976107824f@suse.cz \
    --to=mliska@suse.cz \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jakub@redhat.com \
    --cc=law@redhat.com \
    --cc=matz@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).