public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Martin Jambor <mjambor@suse.cz>
To: Jan Hubicka <hubicka@ucw.cz>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>,
	Richard Biener <rguenther@suse.de>
Subject: Re: [PATCH] ipa: call destructors on lattices before freeing them (PR 113476)
Date: Tue, 13 Feb 2024 18:49:29 +0100	[thread overview]
Message-ID: <ri6bk8kp846.fsf@virgil.suse.cz> (raw)
In-Reply-To: <Zcp-FEcyCHzb-bBw@kam.mff.cuni.cz>

On Mon, Feb 12 2024, Jan Hubicka wrote:
>> Believe it or not, even though I have re-worked the internals of the
>> lattices completely, the array itself is older than my involvement with
>> GCC (or at least with ipa-cp.c ;-).
>> 
>> So it being an array and not a vector is historical coincidence, as far
>> as I am concerned :-).  But that may be the reason, or because vector
>> macros at that time looked scary, or perhaps the initialization by
>> XCNEWVEC zeroing everything out was considered attractive (I kind of
>> like that but constructors would probably be cleaner), I don't know.
>
> If your class is no longer a POD, then the clearing before construcion
> is dead and GCC may optimize it out.  So fixing this may solve some
> surprised in foreseable future when we will try to compile older GCC's
> with newer ones.
>

That's a good point.  I'll prepare a patch converting the whole thing to
use constructors and vectors.

Thanks,

Martin

  reply	other threads:[~2024-02-13 17:49 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-12 17:39 Martin Jambor
2024-02-12 17:50 ` Jan Hubicka
2024-02-12 18:17   ` Martin Jambor
2024-02-12 20:22     ` Jan Hubicka
2024-02-13 17:49       ` Martin Jambor [this message]
2024-02-19 15:04         ` [PATCH] ipa: Convert lattices from pure array to vector " Martin Jambor
2024-02-20  7:11           ` Richard Biener
2024-02-20 10:20           ` Jan Hubicka
2024-02-14  9:52   ` [PATCH] ipa: call destructors on lattices before freeing them " Martin Jambor

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=ri6bk8kp846.fsf@virgil.suse.cz \
    --to=mjambor@suse.cz \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=hubicka@ucw.cz \
    --cc=rguenther@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).