public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@redhat.com>
To: Haoxin Tu <haoxintu@gmail.com>
Cc: GCC Mailing List <gcc@gcc.gnu.org>
Subject: Re: Question about why GCC produces the wrong-code bug
Date: Sat, 17 Sep 2022 23:02:34 +0200	[thread overview]
Message-ID: <YyY16n2jg7fNO6Hj@tucnak> (raw)
In-Reply-To: <CALDyosZUYq_xz9i2XE+Dft-_zJ+hE3R3_DKmEXfihk8WS_ZrNg@mail.gmail.com>

On Sat, Sep 17, 2022 at 11:18:56PM +0800, Haoxin Tu via Gcc wrote:
> Dear developers,
> 
> May I seek your help with some understanding of why GCC produces the
> wrong-code bug? I understand that such a bug can only be reproduced in an
> old GCC version, but I still want to know why GCC made mistake here.
> 
> The bug-revealing code makes GCC-4.7.0 produce miscompiled code under the
> -O3 option.
> 
> $gcc-4.7.0 -O1 s.c -o s1; ./s1
> Aborted (core dumped)
> $gcc-4.7.0 -O3 s.c -o s2; ./s2

From what I can see, this has been introduced in
r0-109841-g42373e0b05c26d047925387d71fa833540dad8f0
aka PR49094 fix and got fixed in
r0-118982-gf2ea3c151c65c472024cf22b2e772819578d2011
aka PR54634 fix.  But if you want to know more, you need to figure it out
yourself, nobody is going to spend time on no longer supported 10 years old
compiler.

	Jakub


      reply	other threads:[~2022-09-17 21:02 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-17 15:18 Haoxin Tu
2022-09-17 21:02 ` Jakub Jelinek [this message]

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=YyY16n2jg7fNO6Hj@tucnak \
    --to=jakub@redhat.com \
    --cc=gcc@gcc.gnu.org \
    --cc=haoxintu@gmail.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).