public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/28831] [4.3/4.4/4.5/4.6/4.7 Regression] Aggregate copy not elided when using a return value as a pass-by-value parameter
       [not found] <bug-28831-4@http.gcc.gnu.org/bugzilla/>
@ 2011-06-27 13:15 ` rguenth at gcc dot gnu.org
  2012-01-12 12:06 ` [Bug middle-end/28831] [4.4/4.5/4.6/4.7 " rguenth at gcc dot gnu.org
                   ` (22 subsequent siblings)
  23 siblings, 0 replies; 24+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-06-27 13:15 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28831

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.3.6                       |4.4.7

--- Comment #11 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-06-27 12:12:43 UTC ---
4.3 branch is being closed, moving to 4.4.7 target.


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

* [Bug middle-end/28831] [4.4/4.5/4.6/4.7 Regression] Aggregate copy not elided when using a return value as a pass-by-value parameter
       [not found] <bug-28831-4@http.gcc.gnu.org/bugzilla/>
  2011-06-27 13:15 ` [Bug middle-end/28831] [4.3/4.4/4.5/4.6/4.7 Regression] Aggregate copy not elided when using a return value as a pass-by-value parameter rguenth at gcc dot gnu.org
@ 2012-01-12 12:06 ` rguenth at gcc dot gnu.org
  2012-03-13 13:14 ` [Bug middle-end/28831] [4.5/4.6/4.7/4.8 " jakub at gcc dot gnu.org
                   ` (21 subsequent siblings)
  23 siblings, 0 replies; 24+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-01-12 12:06 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28831

--- Comment #12 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-01-12 12:05:26 UTC ---
(In reply to comment #5)
> Here's another example:
> 
> struct A { int i[100]; };
> void f(struct A);
> int main()
> {
>   f((struct A){1});
> }
> 
> Here we build up the compound literal on the stack and then copy it into the
> argument slot.
> 
> This seems to be a problem with GIMPLE, as there's no way to represent that we
> want a particular temporary object to live in the argument slot.
> 
> This is both more and less of a problem for C++, as it has many more temporary
> struct objects, but also has pass-by-reference (and the ABI does transparent
> pass-by-reference for non-POD structs).

I suppose it would be easy to add a decl flag DECL_ARGUMENT_SLOT, but of course
defering its allocation until we expand the call (if the argument is passed
by value) is going to be interesting, as we basically have the argument
setup visible in gimple.  For your testcase it's passed by reference it
seems so that would be ok and we can simply avoid the argument slot
allocation and copying at expansion time.


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

* [Bug middle-end/28831] [4.5/4.6/4.7/4.8 Regression] Aggregate copy not elided when using a return value as a pass-by-value parameter
       [not found] <bug-28831-4@http.gcc.gnu.org/bugzilla/>
  2011-06-27 13:15 ` [Bug middle-end/28831] [4.3/4.4/4.5/4.6/4.7 Regression] Aggregate copy not elided when using a return value as a pass-by-value parameter rguenth at gcc dot gnu.org
  2012-01-12 12:06 ` [Bug middle-end/28831] [4.4/4.5/4.6/4.7 " rguenth at gcc dot gnu.org
@ 2012-03-13 13:14 ` jakub at gcc dot gnu.org
  2012-07-02 11:24 ` rguenth at gcc dot gnu.org
                   ` (20 subsequent siblings)
  23 siblings, 0 replies; 24+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-03-13 13:14 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28831

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.4.7                       |4.5.4

--- Comment #13 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-03-13 12:45:24 UTC ---
4.4 branch is being closed, moving to 4.5.4 target.


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

* [Bug middle-end/28831] [4.5/4.6/4.7/4.8 Regression] Aggregate copy not elided when using a return value as a pass-by-value parameter
       [not found] <bug-28831-4@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2012-03-13 13:14 ` [Bug middle-end/28831] [4.5/4.6/4.7/4.8 " jakub at gcc dot gnu.org
@ 2012-07-02 11:24 ` rguenth at gcc dot gnu.org
  2012-08-06  0:39 ` [Bug middle-end/28831] [4.6/4.7/4.8 " chip at pobox dot com
                   ` (19 subsequent siblings)
  23 siblings, 0 replies; 24+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-07-02 11:24 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28831

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.5.4                       |4.6.4

--- Comment #14 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-07-02 11:23:15 UTC ---
The 4.5 branch is being closed, adjusting target milestone.


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

* [Bug middle-end/28831] [4.6/4.7/4.8 Regression] Aggregate copy not elided when using a return value as a pass-by-value parameter
       [not found] <bug-28831-4@http.gcc.gnu.org/bugzilla/>
                   ` (3 preceding siblings ...)
  2012-07-02 11:24 ` rguenth at gcc dot gnu.org
@ 2012-08-06  0:39 ` chip at pobox dot com
  2012-08-06  0:58 ` chip at pobox dot com
                   ` (18 subsequent siblings)
  23 siblings, 0 replies; 24+ messages in thread
From: chip at pobox dot com @ 2012-08-06  0:39 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28831

Chip Salzenberg <chip at pobox dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |chip at pobox dot com

--- Comment #15 from Chip Salzenberg <chip at pobox dot com> 2012-08-06 00:37:36 UTC ---
Ping.  I've just run into this with the tip of the gcc 4.7.1 branch.  Is there
a workaround?  Some way to label the struct as not needing to be stored? 
Something like __attribute__((noaddress));

We want to pass and return structs by value as current C++ style recommends,
but the extra register spills are dragging down performance.  For small key
classes we've switched to using big integers with masking functions, but for
larger ones there is no workaround that we know of.

Given this code:

extern val_t foo();
extern int bar(val_t);
int main() {
    return bar(foo());
}

When val_t is a struct of two int64_t on x86_64, the code has two extra stores:
>       movq    %rax, (%rsp)
>       movq    %rdx, 8(%rsp)
and the stack frame is larger and there is no tail call optimization.

When val_t is __int128 on x86_64, the code is optimal: tail call, no extra
stores, smaller stack frame (because there is no need to store the value).


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

* [Bug middle-end/28831] [4.6/4.7/4.8 Regression] Aggregate copy not elided when using a return value as a pass-by-value parameter
       [not found] <bug-28831-4@http.gcc.gnu.org/bugzilla/>
                   ` (4 preceding siblings ...)
  2012-08-06  0:39 ` [Bug middle-end/28831] [4.6/4.7/4.8 " chip at pobox dot com
@ 2012-08-06  0:58 ` chip at pobox dot com
  2012-08-14 22:51 ` chip at pobox dot com
                   ` (17 subsequent siblings)
  23 siblings, 0 replies; 24+ messages in thread
From: chip at pobox dot com @ 2012-08-06  0:58 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28831

--- Comment #16 from Chip Salzenberg <chip at pobox dot com> 2012-08-06 00:57:13 UTC ---
Addendum: In cut down test cases where I only pass by value or only return by
value, but not both, I find no extra stores, which is good; but I still find a
lot of unnecessary frame allocation (either $24 or $40, depending), and tail
call is still missing.


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

* [Bug middle-end/28831] [4.6/4.7/4.8 Regression] Aggregate copy not elided when using a return value as a pass-by-value parameter
       [not found] <bug-28831-4@http.gcc.gnu.org/bugzilla/>
                   ` (5 preceding siblings ...)
  2012-08-06  0:58 ` chip at pobox dot com
@ 2012-08-14 22:51 ` chip at pobox dot com
  2012-08-15 18:02 ` chip at pobox dot com
                   ` (16 subsequent siblings)
  23 siblings, 0 replies; 24+ messages in thread
From: chip at pobox dot com @ 2012-08-14 22:51 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28831

--- Comment #17 from Chip Salzenberg <chip at pobox dot com> 2012-08-14 22:50:01 UTC ---
The patch posted in Bug 20020 prevents missed optimization for 128-bit
structures on x86_64.  So this bug does seem to be all about the BLKmode.


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

* [Bug middle-end/28831] [4.6/4.7/4.8 Regression] Aggregate copy not elided when using a return value as a pass-by-value parameter
       [not found] <bug-28831-4@http.gcc.gnu.org/bugzilla/>
                   ` (6 preceding siblings ...)
  2012-08-14 22:51 ` chip at pobox dot com
@ 2012-08-15 18:02 ` chip at pobox dot com
  2012-08-18 15:34 ` hjl.tools at gmail dot com
                   ` (15 subsequent siblings)
  23 siblings, 0 replies; 24+ messages in thread
From: chip at pobox dot com @ 2012-08-15 18:02 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28831

--- Comment #18 from Chip Salzenberg <chip at pobox dot com> 2012-08-15 18:00:39 UTC ---
What will it take to get this fixed?  Pass by value is Big in C++11 style, with
move semantics designed to tie right into the optimization that's being missed
here.

This is sucking a lot for C++.


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

* [Bug middle-end/28831] [4.6/4.7/4.8 Regression] Aggregate copy not elided when using a return value as a pass-by-value parameter
       [not found] <bug-28831-4@http.gcc.gnu.org/bugzilla/>
                   ` (7 preceding siblings ...)
  2012-08-15 18:02 ` chip at pobox dot com
@ 2012-08-18 15:34 ` hjl.tools at gmail dot com
  2012-08-18 16:12 ` hjl.tools at gmail dot com
                   ` (14 subsequent siblings)
  23 siblings, 0 replies; 24+ messages in thread
From: hjl.tools at gmail dot com @ 2012-08-18 15:34 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28831

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |hjl.tools at gmail dot com,
                   |                            |ubizjak at gmail dot com

--- Comment #19 from H.J. Lu <hjl.tools at gmail dot com> 2012-08-18 15:32:41 UTC ---
With GCC 3.4, -march=i686 will allocate stack and copy f() return
to g().  With newer GCC, the same thing also happens with -march=i386.


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

* [Bug middle-end/28831] [4.6/4.7/4.8 Regression] Aggregate copy not elided when using a return value as a pass-by-value parameter
       [not found] <bug-28831-4@http.gcc.gnu.org/bugzilla/>
                   ` (8 preceding siblings ...)
  2012-08-18 15:34 ` hjl.tools at gmail dot com
@ 2012-08-18 16:12 ` hjl.tools at gmail dot com
  2013-04-12 15:16 ` [Bug middle-end/28831] [4.7/4.8/4.9 " jakub at gcc dot gnu.org
                   ` (13 subsequent siblings)
  23 siblings, 0 replies; 24+ messages in thread
From: hjl.tools at gmail dot com @ 2012-08-18 16:12 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28831

--- Comment #20 from H.J. Lu <hjl.tools at gmail dot com> 2012-08-18 16:10:43 UTC ---
With -maccumulate-outgoing-args, GCC 3.4 will also make
a copy.


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

* [Bug middle-end/28831] [4.7/4.8/4.9 Regression] Aggregate copy not elided when using a return value as a pass-by-value parameter
       [not found] <bug-28831-4@http.gcc.gnu.org/bugzilla/>
                   ` (9 preceding siblings ...)
  2012-08-18 16:12 ` hjl.tools at gmail dot com
@ 2013-04-12 15:16 ` jakub at gcc dot gnu.org
  2013-09-05 20:04 ` chip at pobox dot com
                   ` (12 subsequent siblings)
  23 siblings, 0 replies; 24+ messages in thread
From: jakub at gcc dot gnu.org @ 2013-04-12 15:16 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28831

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.6.4                       |4.7.4

--- Comment #21 from Jakub Jelinek <jakub at gcc dot gnu.org> 2013-04-12 15:16:00 UTC ---
GCC 4.6.4 has been released and the branch has been closed.


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

* [Bug middle-end/28831] [4.7/4.8/4.9 Regression] Aggregate copy not elided when using a return value as a pass-by-value parameter
       [not found] <bug-28831-4@http.gcc.gnu.org/bugzilla/>
                   ` (10 preceding siblings ...)
  2013-04-12 15:16 ` [Bug middle-end/28831] [4.7/4.8/4.9 " jakub at gcc dot gnu.org
@ 2013-09-05 20:04 ` chip at pobox dot com
  2014-06-12 13:43 ` [Bug middle-end/28831] [4.7/4.8/4.9/4.10 " rguenth at gcc dot gnu.org
                   ` (11 subsequent siblings)
  23 siblings, 0 replies; 24+ messages in thread
From: chip at pobox dot com @ 2013-09-05 20:04 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28831

--- Comment #22 from Chip Salzenberg <chip at pobox dot com> ---
Anyone?  Bueller?


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

* [Bug middle-end/28831] [4.7/4.8/4.9/4.10 Regression] Aggregate copy not elided when using a return value as a pass-by-value parameter
       [not found] <bug-28831-4@http.gcc.gnu.org/bugzilla/>
                   ` (11 preceding siblings ...)
  2013-09-05 20:04 ` chip at pobox dot com
@ 2014-06-12 13:43 ` rguenth at gcc dot gnu.org
  2014-06-12 17:09 ` [Bug middle-end/28831] [4.8/4.9/4.10 " chip at pobox dot com
                   ` (10 subsequent siblings)
  23 siblings, 0 replies; 24+ messages in thread
From: rguenth at gcc dot gnu.org @ 2014-06-12 13:43 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.7.4                       |4.8.4

--- Comment #23 from Richard Biener <rguenth at gcc dot gnu.org> ---
The 4.7 branch is being closed, moving target milestone to 4.8.4.


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

* [Bug middle-end/28831] [4.8/4.9/4.10 Regression] Aggregate copy not elided when using a return value as a pass-by-value parameter
       [not found] <bug-28831-4@http.gcc.gnu.org/bugzilla/>
                   ` (12 preceding siblings ...)
  2014-06-12 13:43 ` [Bug middle-end/28831] [4.7/4.8/4.9/4.10 " rguenth at gcc dot gnu.org
@ 2014-06-12 17:09 ` chip at pobox dot com
  2014-12-19 13:26 ` [Bug middle-end/28831] [4.8/4.9/5 " jakub at gcc dot gnu.org
                   ` (9 subsequent siblings)
  23 siblings, 0 replies; 24+ messages in thread
From: chip at pobox dot com @ 2014-06-12 17:09 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #24 from Chip Salzenberg <chip at pobox dot com> ---
In 4.8.2 (Ubuntu trusty), the copy is finally elided.  Good job!  But stack
space is still allocated for the copy that is not made.  So it's not all fixed.


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

* [Bug middle-end/28831] [4.8/4.9/5 Regression] Aggregate copy not elided when using a return value as a pass-by-value parameter
       [not found] <bug-28831-4@http.gcc.gnu.org/bugzilla/>
                   ` (13 preceding siblings ...)
  2014-06-12 17:09 ` [Bug middle-end/28831] [4.8/4.9/4.10 " chip at pobox dot com
@ 2014-12-19 13:26 ` jakub at gcc dot gnu.org
  2015-06-23  8:18 ` [Bug middle-end/28831] [4.8/4.9/5/6 " rguenth at gcc dot gnu.org
                   ` (8 subsequent siblings)
  23 siblings, 0 replies; 24+ messages in thread
From: jakub at gcc dot gnu.org @ 2014-12-19 13:26 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.8.4                       |4.8.5

--- Comment #25 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
GCC 4.8.4 has been released.


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

* [Bug middle-end/28831] [4.8/4.9/5/6 Regression] Aggregate copy not elided when using a return value as a pass-by-value parameter
       [not found] <bug-28831-4@http.gcc.gnu.org/bugzilla/>
                   ` (14 preceding siblings ...)
  2014-12-19 13:26 ` [Bug middle-end/28831] [4.8/4.9/5 " jakub at gcc dot gnu.org
@ 2015-06-23  8:18 ` rguenth at gcc dot gnu.org
  2015-06-26 19:53 ` [Bug middle-end/28831] [4.9/5/6 " jakub at gcc dot gnu.org
                   ` (7 subsequent siblings)
  23 siblings, 0 replies; 24+ messages in thread
From: rguenth at gcc dot gnu.org @ 2015-06-23  8:18 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.8.5                       |4.9.3

--- Comment #26 from Richard Biener <rguenth at gcc dot gnu.org> ---
The gcc-4_8-branch is being closed, re-targeting regressions to 4.9.3.


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

* [Bug middle-end/28831] [4.9/5/6 Regression] Aggregate copy not elided when using a return value as a pass-by-value parameter
       [not found] <bug-28831-4@http.gcc.gnu.org/bugzilla/>
                   ` (15 preceding siblings ...)
  2015-06-23  8:18 ` [Bug middle-end/28831] [4.8/4.9/5/6 " rguenth at gcc dot gnu.org
@ 2015-06-26 19:53 ` jakub at gcc dot gnu.org
  2015-06-26 20:27 ` jakub at gcc dot gnu.org
                   ` (6 subsequent siblings)
  23 siblings, 0 replies; 24+ messages in thread
From: jakub at gcc dot gnu.org @ 2015-06-26 19:53 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #27 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
GCC 4.9.3 has been released.


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

* [Bug middle-end/28831] [4.9/5/6 Regression] Aggregate copy not elided when using a return value as a pass-by-value parameter
       [not found] <bug-28831-4@http.gcc.gnu.org/bugzilla/>
                   ` (16 preceding siblings ...)
  2015-06-26 19:53 ` [Bug middle-end/28831] [4.9/5/6 " jakub at gcc dot gnu.org
@ 2015-06-26 20:27 ` jakub at gcc dot gnu.org
  2021-03-22 11:05 ` [Bug middle-end/28831] [8/9/10/11 " rguenth at gcc dot gnu.org
                   ` (5 subsequent siblings)
  23 siblings, 0 replies; 24+ messages in thread
From: jakub at gcc dot gnu.org @ 2015-06-26 20:27 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.9.3                       |4.9.4


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

* [Bug middle-end/28831] [8/9/10/11 Regression] Aggregate copy not elided when using a return value as a pass-by-value parameter
       [not found] <bug-28831-4@http.gcc.gnu.org/bugzilla/>
                   ` (17 preceding siblings ...)
  2015-06-26 20:27 ` jakub at gcc dot gnu.org
@ 2021-03-22 11:05 ` rguenth at gcc dot gnu.org
  2021-05-14  9:45 ` [Bug middle-end/28831] [9/10/11/12 " jakub at gcc dot gnu.org
                   ` (4 subsequent siblings)
  23 siblings, 0 replies; 24+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-03-22 11:05 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #36 from Richard Biener <rguenth at gcc dot gnu.org> ---
Note that if we'd want to "preallocate" (or re-use) variables for argument
slots we have to properly arrange them according to the ABI.  Consider
a function taking more than just a single argument [passed on stack] which
we might still able to handle optimally [with greater difficulty].

Jasons C++ example expands from

  D.2368 = {};
  D.2368.i[0] = 1;
  f (D.2368);

if you modify that to

struct A { int i[100]; };
void f(int i, struct A, int j);
int main()
{
  f(0, (struct A){1}, 2);
}

then on i?86 both extra arguments are passed on the stack as well but
RTL expansion sees again

  D.2370 = {};
  D.2370.i[0] = 1;
  f (0, D.2370, 2);

but clearly we cannot just allocate D.2370 in a random place if it is
passed on the stack (on i?86 it's passed by reference).  For example

struct A { int i[2]; };
void f(struct A);
int main()
{
  f((struct A){1});
}

expanded as

  MEM <char[4]> [(struct A *)&D.1960 + 4B] = {};
  D.1960.i[0] = 1;
  f (D.1960);

is passed on the stack though.  So if we want to expose anything on GIMPLE
then we have to make the argument space on the stack distinct from random
stack variables.

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

* [Bug middle-end/28831] [9/10/11/12 Regression] Aggregate copy not elided when using a return value as a pass-by-value parameter
       [not found] <bug-28831-4@http.gcc.gnu.org/bugzilla/>
                   ` (18 preceding siblings ...)
  2021-03-22 11:05 ` [Bug middle-end/28831] [8/9/10/11 " rguenth at gcc dot gnu.org
@ 2021-05-14  9:45 ` jakub at gcc dot gnu.org
  2021-06-01  8:04 ` rguenth at gcc dot gnu.org
                   ` (3 subsequent siblings)
  23 siblings, 0 replies; 24+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-05-14  9:45 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #37 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
GCC 8 branch is being closed.

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

* [Bug middle-end/28831] [9/10/11/12 Regression] Aggregate copy not elided when using a return value as a pass-by-value parameter
       [not found] <bug-28831-4@http.gcc.gnu.org/bugzilla/>
                   ` (19 preceding siblings ...)
  2021-05-14  9:45 ` [Bug middle-end/28831] [9/10/11/12 " jakub at gcc dot gnu.org
@ 2021-06-01  8:04 ` rguenth at gcc dot gnu.org
  2022-05-27  9:33 ` [Bug middle-end/28831] [10/11/12/13 " rguenth at gcc dot gnu.org
                   ` (2 subsequent siblings)
  23 siblings, 0 replies; 24+ messages in thread
From: rguenth at gcc dot gnu.org @ 2021-06-01  8:04 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #38 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] 24+ messages in thread

* [Bug middle-end/28831] [10/11/12/13 Regression] Aggregate copy not elided when using a return value as a pass-by-value parameter
       [not found] <bug-28831-4@http.gcc.gnu.org/bugzilla/>
                   ` (20 preceding siblings ...)
  2021-06-01  8:04 ` rguenth at gcc dot gnu.org
@ 2022-05-27  9:33 ` rguenth at gcc dot gnu.org
  2022-06-28 10:29 ` jakub at gcc dot gnu.org
  2023-07-07 10:28 ` [Bug middle-end/28831] [11/12/13/14 " rguenth at gcc dot gnu.org
  23 siblings, 0 replies; 24+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-05-27  9:33 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #39 from Richard Biener <rguenth at gcc dot gnu.org> ---
GCC 9 branch is being closed

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

* [Bug middle-end/28831] [10/11/12/13 Regression] Aggregate copy not elided when using a return value as a pass-by-value parameter
       [not found] <bug-28831-4@http.gcc.gnu.org/bugzilla/>
                   ` (21 preceding siblings ...)
  2022-05-27  9:33 ` [Bug middle-end/28831] [10/11/12/13 " rguenth at gcc dot gnu.org
@ 2022-06-28 10:29 ` jakub at gcc dot gnu.org
  2023-07-07 10:28 ` [Bug middle-end/28831] [11/12/13/14 " rguenth at gcc dot gnu.org
  23 siblings, 0 replies; 24+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-06-28 10:29 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|10.4                        |10.5

--- Comment #40 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
GCC 10.4 is being released, retargeting bugs to GCC 10.5.

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

* [Bug middle-end/28831] [11/12/13/14 Regression] Aggregate copy not elided when using a return value as a pass-by-value parameter
       [not found] <bug-28831-4@http.gcc.gnu.org/bugzilla/>
                   ` (22 preceding siblings ...)
  2022-06-28 10:29 ` jakub at gcc dot gnu.org
@ 2023-07-07 10:28 ` rguenth at gcc dot gnu.org
  23 siblings, 0 replies; 24+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-07-07 10:28 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|10.5                        |11.5

--- Comment #41 from Richard Biener <rguenth at gcc dot gnu.org> ---
GCC 10 branch is being closed.

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

end of thread, other threads:[~2023-07-07 10:28 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-28831-4@http.gcc.gnu.org/bugzilla/>
2011-06-27 13:15 ` [Bug middle-end/28831] [4.3/4.4/4.5/4.6/4.7 Regression] Aggregate copy not elided when using a return value as a pass-by-value parameter rguenth at gcc dot gnu.org
2012-01-12 12:06 ` [Bug middle-end/28831] [4.4/4.5/4.6/4.7 " rguenth at gcc dot gnu.org
2012-03-13 13:14 ` [Bug middle-end/28831] [4.5/4.6/4.7/4.8 " jakub at gcc dot gnu.org
2012-07-02 11:24 ` rguenth at gcc dot gnu.org
2012-08-06  0:39 ` [Bug middle-end/28831] [4.6/4.7/4.8 " chip at pobox dot com
2012-08-06  0:58 ` chip at pobox dot com
2012-08-14 22:51 ` chip at pobox dot com
2012-08-15 18:02 ` chip at pobox dot com
2012-08-18 15:34 ` hjl.tools at gmail dot com
2012-08-18 16:12 ` hjl.tools at gmail dot com
2013-04-12 15:16 ` [Bug middle-end/28831] [4.7/4.8/4.9 " jakub at gcc dot gnu.org
2013-09-05 20:04 ` chip at pobox dot com
2014-06-12 13:43 ` [Bug middle-end/28831] [4.7/4.8/4.9/4.10 " rguenth at gcc dot gnu.org
2014-06-12 17:09 ` [Bug middle-end/28831] [4.8/4.9/4.10 " chip at pobox dot com
2014-12-19 13:26 ` [Bug middle-end/28831] [4.8/4.9/5 " jakub at gcc dot gnu.org
2015-06-23  8:18 ` [Bug middle-end/28831] [4.8/4.9/5/6 " rguenth at gcc dot gnu.org
2015-06-26 19:53 ` [Bug middle-end/28831] [4.9/5/6 " jakub at gcc dot gnu.org
2015-06-26 20:27 ` jakub at gcc dot gnu.org
2021-03-22 11:05 ` [Bug middle-end/28831] [8/9/10/11 " rguenth at gcc dot gnu.org
2021-05-14  9:45 ` [Bug middle-end/28831] [9/10/11/12 " jakub at gcc dot gnu.org
2021-06-01  8:04 ` rguenth at gcc dot gnu.org
2022-05-27  9:33 ` [Bug middle-end/28831] [10/11/12/13 " rguenth at gcc dot gnu.org
2022-06-28 10:29 ` jakub at gcc dot gnu.org
2023-07-07 10:28 ` [Bug middle-end/28831] [11/12/13/14 " 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).