diff options
author | Richard Sandiford <richard.sandiford@arm.com> | 2016-11-21 15:52:09 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@gcc.gnu.org> | 2016-11-21 15:52:09 +0000 |
commit | 9713daa015b807a9ffd349f3698cee7acbbaed23 (patch) | |
tree | e99ef73d3ba4d9ddf7188f90a7bc54817d66c427 /gcc/tree-ssa-loop-prefetch.c | |
parent | 67b5d0b2fe8cdb72dfc56644e42c28f453cb2f76 (diff) | |
download | gcc-9713daa015b807a9ffd349f3698cee7acbbaed23.zip gcc-9713daa015b807a9ffd349f3698cee7acbbaed23.tar.gz gcc-9713daa015b807a9ffd349f3698cee7acbbaed23.tar.bz2 |
Handle sibcalls with aggregate returns
We treated this g as a sibling call to f:
int f (int);
int g (void) { return f (1); }
but not this one:
struct s { int i; };
struct s f (int);
struct s g (void) { return f (1); }
We treated them both as sibcalls on x86 before the first patch for PR36326,
so I suppose this is a regression of sorts from 4.3.
The patch allows function returns to be local aggregate variables as well
as gimple registers.
gcc/
* tree-tailcall.c (process_assignment): Simplify the check for
a valid copy, allowing the source to be a local variable as
well as an SSA name.
(find_tail_calls): Allow copies between local variables to follow
the call. Allow the result to be stored in any local variable,
even if it's an aggregate.
(eliminate_tail_call): Check whether the result is an SSA name
before updating its SSA_NAME_DEF_STMT.
gcc/testsuite/
* gcc.dg/tree-ssa/tailcall-7.c: New test.
From-SVN: r242668
Diffstat (limited to 'gcc/tree-ssa-loop-prefetch.c')
0 files changed, 0 insertions, 0 deletions