public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug driver/114606] New: -Whardened doesn't trigger with -fcf-protection=none
@ 2024-04-05 16:09 mpolacek at gcc dot gnu.org
  2024-04-05 16:09 ` [Bug driver/114606] " mpolacek at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2024-04-05 16:09 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114606

            Bug ID: 114606
           Summary: -Whardened doesn't trigger with -fcf-protection=none
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: driver
          Assignee: unassigned at gcc dot gnu.org
          Reporter: mpolacek at gcc dot gnu.org
  Target Milestone: ---

-Whardened warns when -fhardened couldn't enable a hardening option because
that option was disabled on the command line, e.g.:

$ ./cc1plus -quiet g.C  -fhardened -O2 -fstack-protector
cc1plus: warning: ‘-fstack-protector-strong’ is not enabled by ‘-fhardened’
because it was specified on the command line [-Whardened]

but it doesn't work as expected with -fcf-protection=none:

$ ./cc1plus -quiet g.C  -fhardened -O2 -fcf-protection=none
# should warn

because we're checking == CF_NONE which doesn't distinguish between nothing and
-fcf-protection=none.  I'm hoping the fix is simply to use OPTION_SET_P.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug driver/114606] -Whardened doesn't trigger with -fcf-protection=none
  2024-04-05 16:09 [Bug driver/114606] New: -Whardened doesn't trigger with -fcf-protection=none mpolacek at gcc dot gnu.org
@ 2024-04-05 16:09 ` mpolacek at gcc dot gnu.org
  2024-04-10 21:28 ` [Bug target/114606] " cvs-commit at gcc dot gnu.org
  2024-04-10 21:28 ` mpolacek at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2024-04-05 16:09 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114606

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |mpolacek at gcc dot gnu.org
   Last reconfirmed|                            |2024-04-05
     Ever confirmed|0                           |1

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug target/114606] -Whardened doesn't trigger with -fcf-protection=none
  2024-04-05 16:09 [Bug driver/114606] New: -Whardened doesn't trigger with -fcf-protection=none mpolacek at gcc dot gnu.org
  2024-04-05 16:09 ` [Bug driver/114606] " mpolacek at gcc dot gnu.org
@ 2024-04-10 21:28 ` cvs-commit at gcc dot gnu.org
  2024-04-10 21:28 ` mpolacek at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-04-10 21:28 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114606

--- Comment #1 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The trunk branch has been updated by Marek Polacek <mpolacek@gcc.gnu.org>:

https://gcc.gnu.org/g:b8b148bc22673689fda19711b428b544462be2e4

commit r14-9903-gb8b148bc22673689fda19711b428b544462be2e4
Author: Marek Polacek <polacek@redhat.com>
Date:   Fri Apr 5 12:37:19 2024 -0400

    target: missing -Whardened with -fcf-protection=none [PR114606]

    -Whardened warns when -fhardened couldn't enable a hardening option
    because that option was disabled on the command line, e.g.:

    $ ./cc1plus -quiet g.C -fhardened -O2 -fstack-protector
    cc1plus: warning: '-fstack-protector-strong' is not enabled by '-fhardened'
because it was specified on the command line [-Whardened]

    but it doesn't work as expected with -fcf-protection=none:

    $ ./cc1plus -quiet g.C -fhardened -O2 -fcf-protection=none

    because we're checking == CF_NONE which doesn't distinguish between nothing
    and -fcf-protection=none.  I should have used opts_set, like below.

            PR target/114606

    gcc/ChangeLog:

            * config/i386/i386-options.cc (ix86_option_override_internal): Use
            opts_set rather than checking == CF_NONE.

    gcc/testsuite/ChangeLog:

            * gcc.target/i386/fhardened-1.c: New test.
            * gcc.target/i386/fhardened-2.c: New test.

    Reviewed-by: Jakub Jelinek <jakub@redhat.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug target/114606] -Whardened doesn't trigger with -fcf-protection=none
  2024-04-05 16:09 [Bug driver/114606] New: -Whardened doesn't trigger with -fcf-protection=none mpolacek at gcc dot gnu.org
  2024-04-05 16:09 ` [Bug driver/114606] " mpolacek at gcc dot gnu.org
  2024-04-10 21:28 ` [Bug target/114606] " cvs-commit at gcc dot gnu.org
@ 2024-04-10 21:28 ` mpolacek at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2024-04-10 21:28 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114606

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|ASSIGNED                    |RESOLVED

--- Comment #2 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Fixed.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-04-10 21:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-05 16:09 [Bug driver/114606] New: -Whardened doesn't trigger with -fcf-protection=none mpolacek at gcc dot gnu.org
2024-04-05 16:09 ` [Bug driver/114606] " mpolacek at gcc dot gnu.org
2024-04-10 21:28 ` [Bug target/114606] " cvs-commit at gcc dot gnu.org
2024-04-10 21:28 ` mpolacek at gcc dot gnu.org

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).