public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Patrick Herbst <paherbst@gmail.com>
To: gcc-help <gcc-help@gcc.gnu.org>
Subject: Optimization auto-setting _FORTIFY_SOURCE ??
Date: Sun, 29 Jan 2023 18:05:14 -0500	[thread overview]
Message-ID: <CACMdL5JQAf07dknwFq9DrQn_7rw-i-Z7PnOJ1H59fURe+jQnGw@mail.gmail.com> (raw)

Using GCC 9.4, I've noticed setting -O1 will set
_FORTIFY_SOURCE=2

I'm able to see this by running
gcc -c -E -dM -O1 - < /dev/null | grep FORTIFY_SOURCE

But running the same command without -O1 doesn't set it.

Is this documented?  is this expected behavior?  I could not find any
reference to how optimization leads to setting this macro.

Any tips on where I can look, or what i'm missing to see this connection?

Thanks!

             reply	other threads:[~2023-01-29 23:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-29 23:05 Patrick Herbst [this message]
2023-01-30  4:23 ` Xi Ruoyao
2023-01-30  4:57   ` 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=CACMdL5JQAf07dknwFq9DrQn_7rw-i-Z7PnOJ1H59fURe+jQnGw@mail.gmail.com \
    --to=paherbst@gmail.com \
    --cc=gcc-help@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).