public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Adrian Moreno <amorenoz@redhat.com>
To: Florian Weimer <fweimer@redhat.com>,
	Adrian Moreno via Gcc-help <gcc-help@gcc.gnu.org>
Cc: David Brown <david.brown@hesbynett.no>,
	Stefan Ring <stefanrin@gmail.com>
Subject: Re: broken code only when optimized "-O2"
Date: Wed, 22 Dec 2021 11:34:51 +0100	[thread overview]
Message-ID: <c4813434-f4ba-bbf8-7d1e-71b9a5215315@redhat.com> (raw)
In-Reply-To: <877dbx7x47.fsf@oldenburg.str.redhat.com>



On 12/22/21 11:27, Florian Weimer wrote:
> * 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.
> 

So it wouldn't cause undefined behavior?

Thanks.
-- 
Adrián Moreno


  reply	other threads:[~2021-12-22 10:34 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
2021-12-22 10:34         ` Adrian Moreno [this message]
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=c4813434-f4ba-bbf8-7d1e-71b9a5215315@redhat.com \
    --to=amorenoz@redhat.com \
    --cc=david.brown@hesbynett.no \
    --cc=fweimer@redhat.com \
    --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).