This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Mark variables addressable if they are copied using libcall in RTL expander


> I fear this isn't enough considering pass-by-value aggregates that
> are callee copied.

It's indeed not sufficient for arguments passed by reference but callee-copied.

This is PR target/49454.  For gcc.c-torture/execute/20000717-1.c:

typedef struct trio { int a, b, c; } trio;

int
foo (trio t, int i)
{
  return bar (i, t);
}

yiedls in the .optimized dump:

foo (struct trio t, int i)
{
  int D.1968;
  struct trio t.0;

<bb 2>:
  t.0 = t;
  D.1968_2 = bar (i_1(D), t.0);
  return D.1968_2;
}

and the aggregate copy is elided by DSE because t.0 isn't may_be_aliased.  This 
seems to be a pre-existing bug though: its address is passed to bar in RTL.

-- 
Eric Botcazou


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]