public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/101543] New: extra zeroing of empty struct argument/return value
@ 2021-07-21  5:37 pinskia at gcc dot gnu.org
  2021-07-21  5:38 ` [Bug target/101543] " pinskia at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-07-21  5:37 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 101543
           Summary: extra zeroing of empty struct argument/return value
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: enhancement
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: pinskia at gcc dot gnu.org
  Target Milestone: ---
            Target: aarch64-linux-gnu

Take:
struct Tag {
    friend Tag make_tag();
private:
    Tag() {}
};

Tag make_tag() { 
    return Tag{}; 
};

void needs_tag(Tag);

void foo1(void) {
    Tag t = make_tag();
    needs_tag(t);
}


struct Tag1 {};
struct Tag2 {};
struct Tag3 {};
struct Tag4 {};
struct Tag5 {};

void needs_tags(int x, Tag1 t1, Tag2 t2, Tag3 t3, Tag4 t4, Tag5 t5, int y);

void foo2(Tag1 t1, Tag2 t2, Tag3 t3, Tag4 t4, Tag5 t5)
{
needs_tags(12345, t1, t2, t3, t4, t5, t6, t7,t8, 200);
}

---- CUT ---
In make_tag the return register does not need to be zerod.
In foo1, the argument x0 does not need to be zeroed before passing to
needs_tag.
In foo2, argument registers x1-x5 don't need to have been zeroed before passing
to needs_tags.

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

* [Bug target/101543] extra zeroing of empty struct argument/return value
  2021-07-21  5:37 [Bug target/101543] New: extra zeroing of empty struct argument/return value pinskia at gcc dot gnu.org
@ 2021-07-21  5:38 ` pinskia at gcc dot gnu.org
  2021-07-27 18:45 ` pinskia at gcc dot gnu.org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-07-21  5:38 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           See Also|                            |https://gcc.gnu.org/bugzill
                   |                            |a/show_bug.cgi?id=98884

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
This is similar to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98884 but with
still not skipping the register part.

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

* [Bug target/101543] extra zeroing of empty struct argument/return value
  2021-07-21  5:37 [Bug target/101543] New: extra zeroing of empty struct argument/return value pinskia at gcc dot gnu.org
  2021-07-21  5:38 ` [Bug target/101543] " pinskia at gcc dot gnu.org
@ 2021-07-27 18:45 ` pinskia at gcc dot gnu.org
  2021-07-29 14:11 ` belagod at gcc dot gnu.org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-07-27 18:45 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Note RTL optimizers don't like registers being uninitilized but maybe there is
way to do it ...

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

* [Bug target/101543] extra zeroing of empty struct argument/return value
  2021-07-21  5:37 [Bug target/101543] New: extra zeroing of empty struct argument/return value pinskia at gcc dot gnu.org
  2021-07-21  5:38 ` [Bug target/101543] " pinskia at gcc dot gnu.org
  2021-07-27 18:45 ` pinskia at gcc dot gnu.org
@ 2021-07-29 14:11 ` belagod at gcc dot gnu.org
  2021-07-29 14:12 ` belagod at gcc dot gnu.org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: belagod at gcc dot gnu.org @ 2021-07-29 14:11 UTC (permalink / raw)
  To: gcc-bugs

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

Tejas Belagod <belagod at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2021-07-29
                 CC|                            |belagod at gcc dot gnu.org

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

* [Bug target/101543] extra zeroing of empty struct argument/return value
  2021-07-21  5:37 [Bug target/101543] New: extra zeroing of empty struct argument/return value pinskia at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2021-07-29 14:11 ` belagod at gcc dot gnu.org
@ 2021-07-29 14:12 ` belagod at gcc dot gnu.org
  2021-09-22 20:35 ` gabravier at gmail dot com
  2021-09-22 20:36 ` gabravier at gmail dot com
  5 siblings, 0 replies; 7+ messages in thread
From: belagod at gcc dot gnu.org @ 2021-07-29 14:12 UTC (permalink / raw)
  To: gcc-bugs

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

Tejas Belagod <belagod at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |UNCONFIRMED
     Ever confirmed|1                           |0

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

* [Bug target/101543] extra zeroing of empty struct argument/return value
  2021-07-21  5:37 [Bug target/101543] New: extra zeroing of empty struct argument/return value pinskia at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2021-07-29 14:12 ` belagod at gcc dot gnu.org
@ 2021-09-22 20:35 ` gabravier at gmail dot com
  2021-09-22 20:36 ` gabravier at gmail dot com
  5 siblings, 0 replies; 7+ messages in thread
From: gabravier at gmail dot com @ 2021-09-22 20:35 UTC (permalink / raw)
  To: gcc-bugs

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

Gabriel Ravier <gabravier at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |gabravier at gmail dot com

--- Comment #3 from Gabriel Ravier <gabravier at gmail dot com> ---
Seems to be fixed on trunk.

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

* [Bug target/101543] extra zeroing of empty struct argument/return value
  2021-07-21  5:37 [Bug target/101543] New: extra zeroing of empty struct argument/return value pinskia at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2021-09-22 20:35 ` gabravier at gmail dot com
@ 2021-09-22 20:36 ` gabravier at gmail dot com
  5 siblings, 0 replies; 7+ messages in thread
From: gabravier at gmail dot com @ 2021-09-22 20:36 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Gabriel Ravier <gabravier at gmail dot com> ---
Nevermind, didn't see this was an aarch64 bug

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

end of thread, other threads:[~2021-09-22 20:36 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-21  5:37 [Bug target/101543] New: extra zeroing of empty struct argument/return value pinskia at gcc dot gnu.org
2021-07-21  5:38 ` [Bug target/101543] " pinskia at gcc dot gnu.org
2021-07-27 18:45 ` pinskia at gcc dot gnu.org
2021-07-29 14:11 ` belagod at gcc dot gnu.org
2021-07-29 14:12 ` belagod at gcc dot gnu.org
2021-09-22 20:35 ` gabravier at gmail dot com
2021-09-22 20:36 ` gabravier at gmail dot com

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