public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "anlauf at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/114012] overloaded unary operator called twice
Date: Tue, 20 Feb 2024 20:32:38 +0000	[thread overview]
Message-ID: <bug-114012-4-dnJSrg9Mmj@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-114012-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114012

anlauf at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |wrong-code
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2024-02-20
             Status|UNCONFIRMED                 |NEW

--- Comment #1 from anlauf at gcc dot gnu.org ---
The dump-tree shows for the assignment i = -i :

  {
    struct __class__STAR_t val.7;

    val.7._data = (void *) neg (&i)._data;
    val.7._vptr = (struct __vtype__STAR * {ref-all}) neg (&i)._vptr;
    val.7._len = 0;
    i = {CLOBBER};
    assign (&i, &val.7);
  }

We should evaluate neg (&i) only once.

  reply	other threads:[~2024-02-20 20:32 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-20 14:14 [Bug fortran/114012] New: " alexandre.poux at coria dot fr
2024-02-20 20:32 ` anlauf at gcc dot gnu.org [this message]
2024-02-25 19:44 ` [Bug fortran/114012] " anlauf at gcc dot gnu.org
2024-02-25 20:36 ` anlauf at gcc dot gnu.org
2024-02-26 17:50 ` cvs-commit at gcc dot gnu.org
2024-02-27  9:42 ` alexandre.poux at coria dot fr
2024-03-06 21:03 ` cvs-commit at gcc dot gnu.org
2024-03-06 21:06 ` anlauf at gcc dot gnu.org

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=bug-114012-4-dnJSrg9Mmj@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /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).