public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Florian Weimer <fweimer@redhat.com>
To: Adrian Moreno via Gcc-help <gcc-help@gcc.gnu.org>
Cc: David Brown <david.brown@hesbynett.no>,
	 Stefan Ring <stefanrin@gmail.com>,
	 Adrian Moreno <amorenoz@redhat.com>
Subject: Re: broken code only when optimized "-O2"
Date: Wed, 22 Dec 2021 11:27:36 +0100	[thread overview]
Message-ID: <877dbx7x47.fsf@oldenburg.str.redhat.com> (raw)
In-Reply-To: <9b28799e-71f8-2ef9-1cc9-01345993cc11@redhat.com> (Adrian Moreno via Gcc-help's message of "Wed, 22 Dec 2021 10:24:28 +0100")

* Adrian Moreno via Gcc-help:

> So here I do not know what the compiler would think about "pos" if it
> happens to point to some invalid stack address.

In such cases, the compiler typically assumes that the code in question
is never executed.  This means that the comparison does not need to be
performed, among other things.

Thanks,
Florian


  reply	other threads:[~2021-12-22 10:27 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-21 15:40 Adrian Moreno
2021-12-21 16:05 ` Stefan Ring
2021-12-21 16:13   ` Adrian Moreno
2021-12-21 16:39     ` Segher Boessenkool
2021-12-21 17:05   ` David Brown
2021-12-22  9:24     ` Adrian Moreno
2021-12-22 10:27       ` Florian Weimer [this message]
2021-12-22 10:34         ` Adrian Moreno
2021-12-22 10:36           ` Xi Ruoyao
2021-12-22 16:05             ` Adrian Moreno
2021-12-22 15:32 ` LIU Hao

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=877dbx7x47.fsf@oldenburg.str.redhat.com \
    --to=fweimer@redhat.com \
    --cc=amorenoz@redhat.com \
    --cc=david.brown@hesbynett.no \
    --cc=gcc-help@gcc.gnu.org \
    --cc=stefanrin@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).