public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jonathan Wakely <jwakely.gcc@gmail.com>
To: Tibor Billes <tbilles@gmx.com>
Cc: gcc-help <gcc-help@gcc.gnu.org>
Subject: Re: Undefined behavior or compiler bug?
Date: Mon, 15 Jun 2020 21:24:11 +0100	[thread overview]
Message-ID: <CAH6eHdSmEUjpZY0QxKqu6-scp=KJYWNQuxnn_GK7h0wbVrErQA@mail.gmail.com> (raw)
In-Reply-To: <alpine.DEB.2.21.2006151916340.16315@serpens>

On Mon, 15 Jun 2020 at 18:34, Tibor Billes <tbilles@gmx.com> wrote:
>
> Hi,
>
> I'm using the -fsanitize=undefined flag and got a runtime error after a
> compiler upgrade from 7.2 to 9.3. I was happy at first that the upgraded
> compiler caught an error that I can fix before it hits me in production.
>
> However after some investigation, I cannot figure out what's wrong in the
> code. That's why I seek help on this mailing list, can someone explain
> the bug to me? Or is it a bug in the compiler that I should report?
>
> The simplified version of the test code on Compiler Explorer:
> https://godbolt.org/z/7rAxJj
>
> It shows that different compiler versions behave differently.
>
> There is a comment on line 16 that explicitly defaults the Derived
> constructor. If you switch the comment with line 17, both compiler verions
> run fine without producing the runtime error although the defaulted
> constructor should be exactly the same the user defined one:
> https://godbolt.org/z/UShm-u
>
> Can someone please explain what's wrong?

Looks like a bug, please do report it to bugzilla, thanks.

  reply	other threads:[~2020-06-15 20:24 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-15 17:32 Tibor Billes
2020-06-15 20:24 ` Jonathan Wakely [this message]
2020-06-16  5:16   ` Tibor Billes

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='CAH6eHdSmEUjpZY0QxKqu6-scp=KJYWNQuxnn_GK7h0wbVrErQA@mail.gmail.com' \
    --to=jwakely.gcc@gmail.com \
    --cc=gcc-help@gcc.gnu.org \
    --cc=tbilles@gmx.com \
    /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).