public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/89355] Unnecessary ENDBR
       [not found] <bug-89355-4@http.gcc.gnu.org/bugzilla/>
@ 2020-03-12 11:58 ` jakub at gcc dot gnu.org
  2020-04-17 22:24 ` cvs-commit at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 5+ messages in thread
From: jakub at gcc dot gnu.org @ 2020-03-12 11:58 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|9.3                         |9.4

--- Comment #8 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
GCC 9.3.0 has been released, adjusting target milestone.

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

* [Bug target/89355] Unnecessary ENDBR
       [not found] <bug-89355-4@http.gcc.gnu.org/bugzilla/>
  2020-03-12 11:58 ` [Bug target/89355] Unnecessary ENDBR jakub at gcc dot gnu.org
@ 2020-04-17 22:24 ` cvs-commit at gcc dot gnu.org
  2020-04-17 22:33 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 5+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-04-17 22:24 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #9 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-9 branch has been updated by H.J. Lu <hjl@gcc.gnu.org>:

https://gcc.gnu.org/g:4a745938b56da04ed01055d5bcb520dc1c760414

commit r9-8508-g4a745938b56da04ed01055d5bcb520dc1c760414
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Fri Apr 17 15:23:27 2020 -0700

    x86: Insert ENDBR if function will be called indirectly

    Since constant_call_address_operand has

    ;; Test for a pc-relative call operand
    (define_predicate "constant_call_address_operand"
      (match_code "symbol_ref")
    {
      if (ix86_cmodel == CM_LARGE || ix86_cmodel == CM_LARGE_PIC
          || flag_force_indirect_call)
        return false;
      if (TARGET_DLLIMPORT_DECL_ATTRIBUTES && SYMBOL_REF_DLLIMPORT_P (op))
        return false;
      return true;
    })

    even if cgraph_node::get (cfun->decl)->only_called_directly_p () returns
    false, the fuction may still be called indirectly.  Copy the logic from
    constant_call_address_operand to rest_of_insert_endbranch to insert ENDBR
    at function entry if function will be called indirectly.

    NB: gcc.target/i386/pr94417-2.c is updated to expect 4 ENDBRs, instead
    of 2, since only GCC 10 has the fix for PR target/89355 not to insert
    ENDBR after NOTE_INSN_DELETED_LABEL.

    gcc/

            Backport from master
            PR target/94417
            * config/i386/i386.c (rest_of_insert_endbranch): Insert ENDBR at
            function entry if function will be called indirectly.

    gcc/testsuite/

            Backport from master
            PR target/94417
            * gcc.target/i386/pr94417-1.c: New test.
            * gcc.target/i386/pr94417-2.c: Likewise.
            * gcc.target/i386/pr94417-3.c: Likewise.

    (cherry picked from commit c5f379653964a1d2c7037b2de3e947a48370a198)

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

* [Bug target/89355] Unnecessary ENDBR
       [not found] <bug-89355-4@http.gcc.gnu.org/bugzilla/>
  2020-03-12 11:58 ` [Bug target/89355] Unnecessary ENDBR jakub at gcc dot gnu.org
  2020-04-17 22:24 ` cvs-commit at gcc dot gnu.org
@ 2020-04-17 22:33 ` cvs-commit at gcc dot gnu.org
  2021-06-01  8:13 ` rguenth at gcc dot gnu.org
  2022-05-27  8:26 ` rguenth at gcc dot gnu.org
  4 siblings, 0 replies; 5+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-04-17 22:33 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #10 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-8 branch has been updated by H.J. Lu <hjl@gcc.gnu.org>:

https://gcc.gnu.org/g:99ddb11c0840f68466a14fd583dd4d3a558d4961

commit r8-10186-g99ddb11c0840f68466a14fd583dd4d3a558d4961
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Fri Apr 17 15:23:27 2020 -0700

    x86: Insert ENDBR if function will be called indirectly

    Since constant_call_address_operand has

    ;; Test for a pc-relative call operand
    (define_predicate "constant_call_address_operand"
      (match_code "symbol_ref")
    {
      if (ix86_cmodel == CM_LARGE || ix86_cmodel == CM_LARGE_PIC
          || flag_force_indirect_call)
        return false;
      if (TARGET_DLLIMPORT_DECL_ATTRIBUTES && SYMBOL_REF_DLLIMPORT_P (op))
        return false;
      return true;
    })

    even if cgraph_node::get (cfun->decl)->only_called_directly_p () returns
    false, the fuction may still be called indirectly.  Copy the logic from
    constant_call_address_operand to rest_of_insert_endbranch to insert ENDBR
    at function entry if function will be called indirectly.

    NB: gcc.target/i386/pr94417-2.c is updated to expect 4 ENDBRs, instead
    of 2, since only GCC 10 has the fix for PR target/89355 not to insert
    ENDBR after NOTE_INSN_DELETED_LABEL.

    gcc/

            Backport from master
            PR target/94417
            * config/i386/i386.c (rest_of_insert_endbranch): Insert ENDBR at
            function entry if function will be called indirectly.

    gcc/testsuite/

            Backport from master
            PR target/94417
            * gcc.target/i386/pr94417-1.c: New test.
            * gcc.target/i386/pr94417-2.c: Likewise.
            * gcc.target/i386/pr94417-3.c: Likewise.

    (cherry picked from commit c5f379653964a1d2c7037b2de3e947a48370a198)

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

* [Bug target/89355] Unnecessary ENDBR
       [not found] <bug-89355-4@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2020-04-17 22:33 ` cvs-commit at gcc dot gnu.org
@ 2021-06-01  8:13 ` rguenth at gcc dot gnu.org
  2022-05-27  8:26 ` rguenth at gcc dot gnu.org
  4 siblings, 0 replies; 5+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-06-01  8:13 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|9.4                         |9.5

--- Comment #11 from Richard Biener <rguenth at gcc dot gnu.org> ---
GCC 9.4 is being released, retargeting bugs to GCC 9.5.

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

* [Bug target/89355] Unnecessary ENDBR
       [not found] <bug-89355-4@http.gcc.gnu.org/bugzilla/>
                   ` (3 preceding siblings ...)
  2021-06-01  8:13 ` rguenth at gcc dot gnu.org
@ 2022-05-27  8:26 ` rguenth at gcc dot gnu.org
  4 siblings, 0 replies; 5+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-05-27  8:26 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|9.5                         |8.4
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #12 from Richard Biener <rguenth at gcc dot gnu.org> ---
Fixed in GCC 8.4.

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

end of thread, other threads:[~2022-05-27  8:26 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-89355-4@http.gcc.gnu.org/bugzilla/>
2020-03-12 11:58 ` [Bug target/89355] Unnecessary ENDBR jakub at gcc dot gnu.org
2020-04-17 22:24 ` cvs-commit at gcc dot gnu.org
2020-04-17 22:33 ` cvs-commit at gcc dot gnu.org
2021-06-01  8:13 ` rguenth at gcc dot gnu.org
2022-05-27  8:26 ` rguenth 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).