public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/113039] New: [14 Regression] -fcf-protection -fcf-protection=branch doesn't work
@ 2023-12-16  2:04 hjl.tools at gmail dot com
  2023-12-16  2:14 ` [Bug target/113039] " hjl.tools at gmail dot com
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: hjl.tools at gmail dot com @ 2023-12-16  2:04 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 113039
           Summary: [14 Regression] -fcf-protection -fcf-protection=branch
                    doesn't work
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: hjl.tools at gmail dot com
                CC: crazylht at gmail dot com
  Target Milestone: ---
            Target: x86-64

[hjl@gnu-cfl-3 pr85334]$ touch x.c
[hjl@gnu-cfl-3 pr85334]$
/export/build/gnu/tools-build/gcc-gitlab-debug/release/usr/gcc-14.0.0-x86-64/bin/gcc
-c -fcf-protection -fcf-protection=branch x.c
[hjl@gnu-cfl-3 pr85334]$ readelf -n x.o

Displaying notes found in: .note.gnu.property
  Owner                Data size        Description
  GNU                  0x00000010       NT_GNU_PROPERTY_TYPE_0
      Properties: x86 feature: IBT, SHSTK
  GNU                  0x00000020       NT_GNU_PROPERTY_TYPE_0
      Properties: x86 ISA used: 
        x86 feature used: x86
[hjl@gnu-cfl-3 pr85334]$ 

-fcf-protection=branch should override -fcf-protection.

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

* [Bug target/113039] [14 Regression] -fcf-protection -fcf-protection=branch doesn't work
  2023-12-16  2:04 [Bug target/113039] New: [14 Regression] -fcf-protection -fcf-protection=branch doesn't work hjl.tools at gmail dot com
@ 2023-12-16  2:14 ` hjl.tools at gmail dot com
  2023-12-16  2:23 ` hjl.tools at gmail dot com
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: hjl.tools at gmail dot com @ 2023-12-16  2:14 UTC (permalink / raw)
  To: gcc-bugs

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

H.J. Lu <hjl.tools at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2023-12-16
     Ever confirmed|0                           |1
   Target Milestone|---                         |14.0
             Status|UNCONFIRMED                 |NEW

--- Comment #1 from H.J. Lu <hjl.tools at gmail dot com> ---
This may be caused by r14-2692-g1c6231c05bdcca

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

* [Bug target/113039] [14 Regression] -fcf-protection -fcf-protection=branch doesn't work
  2023-12-16  2:04 [Bug target/113039] New: [14 Regression] -fcf-protection -fcf-protection=branch doesn't work hjl.tools at gmail dot com
  2023-12-16  2:14 ` [Bug target/113039] " hjl.tools at gmail dot com
@ 2023-12-16  2:23 ` hjl.tools at gmail dot com
  2023-12-18  2:42 ` liuhongt at gcc dot gnu.org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: hjl.tools at gmail dot com @ 2023-12-16  2:23 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from H.J. Lu <hjl.tools at gmail dot com> ---
(In reply to H.J. Lu from comment #1)
> This may be caused by r14-2692-g1c6231c05bdcca

This commit changes the behavior of -fcf-protection -fcf-protection=branch.
Workaround is to use -fcf-protection -fcf-protection=none
-fcf-protection=branch.

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

* [Bug target/113039] [14 Regression] -fcf-protection -fcf-protection=branch doesn't work
  2023-12-16  2:04 [Bug target/113039] New: [14 Regression] -fcf-protection -fcf-protection=branch doesn't work hjl.tools at gmail dot com
  2023-12-16  2:14 ` [Bug target/113039] " hjl.tools at gmail dot com
  2023-12-16  2:23 ` hjl.tools at gmail dot com
@ 2023-12-18  2:42 ` liuhongt at gcc dot gnu.org
  2023-12-18  8:08 ` rguenth at gcc dot gnu.org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: liuhongt at gcc dot gnu.org @ 2023-12-18  2:42 UTC (permalink / raw)
  To: gcc-bugs

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

Hongtao Liu <liuhongt at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |liuhongt at gcc dot gnu.org

--- Comment #3 from Hongtao Liu <liuhongt at gcc dot gnu.org> ---
Currently it's defined as EnumSet and -fcf-protection=branch won't unset any
others bits since they're in different groups.

2000fcf-protection=
2001Common Joined RejectNegative Enum(cf_protection_level) EnumSet
Var(flag_cf_protection) Init(CF_NONE)
2002-fcf-protection=[full|branch|return|none|check] Instrument functions with
checks to verify jump/call/return control-flow transfer
2003instructions have valid targets.
2004
2005Enum
2006Name(cf_protection_level) Type(enum cf_protection_level)
UnknownError(unknown Control-Flow Protection Level %qs)
2007
2008EnumValue
2009Enum(cf_protection_level) String(full) Value(CF_FULL) Set(1)
2010
2011EnumValue
2012Enum(cf_protection_level) String(branch) Value(CF_BRANCH) Set(2)
2013
2014EnumValue
2015Enum(cf_protection_level) String(return) Value(CF_RETURN) Set(3)
2016
2017EnumValue
2018Enum(cf_protection_level) String(check) Value(CF_CHECK) Set(4)
2019
2020EnumValue
2021Enum(cf_protection_level) String(none) Value(CF_NONE) Set(1)

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

* [Bug target/113039] [14 Regression] -fcf-protection -fcf-protection=branch doesn't work
  2023-12-16  2:04 [Bug target/113039] New: [14 Regression] -fcf-protection -fcf-protection=branch doesn't work hjl.tools at gmail dot com
                   ` (2 preceding siblings ...)
  2023-12-18  2:42 ` liuhongt at gcc dot gnu.org
@ 2023-12-18  8:08 ` rguenth at gcc dot gnu.org
  2024-01-12  3:18 ` cvs-commit at gcc dot gnu.org
  2024-01-12  3:21 ` liuhongt at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-12-18  8:08 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P1

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

* [Bug target/113039] [14 Regression] -fcf-protection -fcf-protection=branch doesn't work
  2023-12-16  2:04 [Bug target/113039] New: [14 Regression] -fcf-protection -fcf-protection=branch doesn't work hjl.tools at gmail dot com
                   ` (3 preceding siblings ...)
  2023-12-18  8:08 ` rguenth at gcc dot gnu.org
@ 2024-01-12  3:18 ` cvs-commit at gcc dot gnu.org
  2024-01-12  3:21 ` liuhongt at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-01-12  3:18 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by hongtao Liu <liuhongt@gcc.gnu.org>:

https://gcc.gnu.org/g:75ed46558a2e085ba12641a47112e37f114faee0

commit r14-7164-g75ed46558a2e085ba12641a47112e37f114faee0
Author: liuhongt <hongtao.liu@intel.com>
Date:   Mon Jan 8 14:04:38 2024 +0800

    Update documents for fcf-protection=

    After r14-2692-g1c6231c05bdcca, the option is defined as EnumSet and
    -fcf-protection=branch won't unset any others bits since they're in
    different groups. So to override -fcf-protection, an explicit
    -fcf-protection=none needs to be added and then with
    -fcf-protection=XXX

    gcc/ChangeLog:

            PR target/113039
            * doc/invoke.texi (fcf-protection=): Update documents.

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

* [Bug target/113039] [14 Regression] -fcf-protection -fcf-protection=branch doesn't work
  2023-12-16  2:04 [Bug target/113039] New: [14 Regression] -fcf-protection -fcf-protection=branch doesn't work hjl.tools at gmail dot com
                   ` (4 preceding siblings ...)
  2024-01-12  3:18 ` cvs-commit at gcc dot gnu.org
@ 2024-01-12  3:21 ` liuhongt at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: liuhongt at gcc dot gnu.org @ 2024-01-12  3:21 UTC (permalink / raw)
  To: gcc-bugs

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

Hongtao Liu <liuhongt at gcc dot gnu.org> changed:

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

--- Comment #5 from Hongtao Liu <liuhongt at gcc dot gnu.org> ---
Fixed.

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

end of thread, other threads:[~2024-01-12  3:21 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-16  2:04 [Bug target/113039] New: [14 Regression] -fcf-protection -fcf-protection=branch doesn't work hjl.tools at gmail dot com
2023-12-16  2:14 ` [Bug target/113039] " hjl.tools at gmail dot com
2023-12-16  2:23 ` hjl.tools at gmail dot com
2023-12-18  2:42 ` liuhongt at gcc dot gnu.org
2023-12-18  8:08 ` rguenth at gcc dot gnu.org
2024-01-12  3:18 ` cvs-commit at gcc dot gnu.org
2024-01-12  3:21 ` liuhongt 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).