public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug ipa/101362] New: can_change_signature does not consider 'used' attribute
@ 2021-07-07  7:12 rguenth at gcc dot gnu.org
  2021-07-07  7:14 ` [Bug ipa/101362] " rguenth at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-07-07  7:12 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 101362
           Summary: can_change_signature does not consider 'used'
                    attribute
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: ipa
          Assignee: unassigned at gcc dot gnu.org
          Reporter: rguenth at gcc dot gnu.org
                CC: marxin at gcc dot gnu.org
  Target Milestone: ---

For

static int __attribute__((used)) fn (int x)
{
  return x;
}

int main() { return fn (0); }

compute_fn_summary will end up with ->can_change_signature = true; but I think
'used' implies the function will be used in ways not visible to GCC.

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

* [Bug ipa/101362] can_change_signature does not consider 'used' attribute
  2021-07-07  7:12 [Bug ipa/101362] New: can_change_signature does not consider 'used' attribute rguenth at gcc dot gnu.org
@ 2021-07-07  7:14 ` rguenth at gcc dot gnu.org
  2021-07-16 21:31 ` pinskia at gcc dot gnu.org
  2024-04-01  7:14 ` pinskia at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-07-07  7:14 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |hubicka at gcc dot gnu.org
             Target|                            |i?86-*-*

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
In particular can_change_signature is one of the keys for ix86_function_regparm
to use local calling conventions on i?86

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

* [Bug ipa/101362] can_change_signature does not consider 'used' attribute
  2021-07-07  7:12 [Bug ipa/101362] New: can_change_signature does not consider 'used' attribute rguenth at gcc dot gnu.org
  2021-07-07  7:14 ` [Bug ipa/101362] " rguenth at gcc dot gnu.org
@ 2021-07-16 21:31 ` pinskia at gcc dot gnu.org
  2024-04-01  7:14 ` pinskia at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-07-16 21:31 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2021-07-16

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Confirmed.

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

* [Bug ipa/101362] can_change_signature does not consider 'used' attribute
  2021-07-07  7:12 [Bug ipa/101362] New: can_change_signature does not consider 'used' attribute rguenth at gcc dot gnu.org
  2021-07-07  7:14 ` [Bug ipa/101362] " rguenth at gcc dot gnu.org
  2021-07-16 21:31 ` pinskia at gcc dot gnu.org
@ 2024-04-01  7:14 ` pinskia at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-04-01  7:14 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Richard Biener from comment #1)
> In particular can_change_signature is one of the keys for
> ix86_function_regparm to use local calling conventions on i?86

So looking through the code on i386 side we check ->local and
->can_change_signature.

But ->local is set to false for node->externally_visible which gets set via
cgraph_externally_visible_p for DECL_PRESERVE_P which gets set via
handle_used_attribute (in c-family/c-attribs.cc).

So can_change_signature might not be worried about here.

Basically as far as I understand is that can_change_signature says if we can
change the signature; though if it is not local, we can't change that version
of it because it might called else where outside of the TU.

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

end of thread, other threads:[~2024-04-01  7:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-07  7:12 [Bug ipa/101362] New: can_change_signature does not consider 'used' attribute rguenth at gcc dot gnu.org
2021-07-07  7:14 ` [Bug ipa/101362] " rguenth at gcc dot gnu.org
2021-07-16 21:31 ` pinskia at gcc dot gnu.org
2024-04-01  7:14 ` pinskia 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).