8sa1-gcc/gcc/cp
Iain Sandoe d0ce5baeb6 coroutines: Back out mandate for tail-calls at O < 2 [PR94359]
For symmetric transfers to work with C++20 coroutines, it is
currently necessary to tail call the callee coroutine from resume
method of the caller coroutine.  However there are several targets
which don't support an indirect tail call to an arbitrary callee.

Unfortunately, the target 'function_ok_for_sibcall' is not usable
from the front end in all cases.  While it is possible to add a new
hook to cover this circumstance, it is too late in the release
cycle to be sure of getting the setting correct for all targets.

So, this patch backs out the use of function_ok_for_sibcall () and
the mandate of CALL_EXPR_MUST_TAIL_CALL from the symmetric
transfer.

Targets that can make indirect tail calls to arbitrary callees will
still be able to make use of the symmetric transfer (without risking
overrunning the stack) for optimization levels >= 2.

The draft standard does not mandate unlimited symmetric transfers,
so removing this is a QOI issue (albeit an important one) rather
than a correctness one.

The test is moved and adjusted so that it can be opted into by any
target that supports the necessary tailcall.

gcc/cp/ChangeLog:

2020-04-16  Iain Sandoe  <iain@sandoe.co.uk>

	PR c++/94359
	* coroutines.cc (build_actor_fn): Back out use of
	targetm.function_ok_for_sibcall.  Do not mark the resume
	call as CALL_EXPR_MUST_TAIL_CALL.

gcc/testsuite/ChangeLog:

2020-04-16  Iain Sandoe  <iain@sandoe.co.uk>

	PR c++/94359
	* g++.dg/coroutines/torture/symmetric-transfer-00-basic.C: Move..
	* g++.dg/coroutines/symmetric-transfer-00-basic.C: ..here and
	adjust to run at O2 for targets supporting the necessary tail
	call.
2020-04-16 21:28:14 +01:00
..
call.c c++: Fix wrong paren-init of aggregates interference [PR93790] 2020-04-09 08:28:46 -04:00
cfns.gperf
cfns.h
ChangeLog c++: Error recovery with erroneous DECL_INITIAL [PR94475] 2020-04-16 08:58:40 -04:00
ChangeLog-1993
ChangeLog-1994
ChangeLog-1995
ChangeLog-1996
ChangeLog-1997
ChangeLog-1998
ChangeLog-1999
ChangeLog-2000
ChangeLog-2001
ChangeLog-2002
ChangeLog-2003
ChangeLog-2004
ChangeLog-2005
ChangeLog-2006
ChangeLog-2007
ChangeLog-2008
ChangeLog-2009
ChangeLog-2010
ChangeLog-2011
ChangeLog-2012
ChangeLog-2013
ChangeLog-2014
ChangeLog-2015
ChangeLog-2016
ChangeLog-2017
ChangeLog-2018
ChangeLog-2019
ChangeLog.ptr
ChangeLog.tree-ssa
class.c c++: Fix up user_provided_p [PR81349] 2020-03-26 09:31:15 +01:00
config-lang.in
constexpr.c c++: Stray RESULT_DECLs in result of constexpr call [PR94034] 2020-04-14 11:22:55 -04:00
constraint.cc c++: Fix invalid pointer-to-member in requires [PR67825] 2020-04-04 11:06:31 -04:00
coroutines.cc coroutines: Back out mandate for tail-calls at O < 2 [PR94359] 2020-04-16 21:28:14 +01:00
cp-gimplify.c c++: Fix further protected_set_expr_location related -fcompare-debug issues [PR94441] 2020-04-04 09:16:07 +02:00
cp-lang.c
cp-name-hint.h
cp-objcp-common.c
cp-objcp-common.h
cp-tree.def
cp-tree.h c++: Replay errors during diagnosis of constraint satisfaction failures 2020-03-28 08:43:20 -04:00
cp-ubsan.c
cvt.c c++: Error recovery with erroneous DECL_INITIAL [PR94475] 2020-04-16 08:58:40 -04:00
cxx-pretty-print.c c++: "'decltype_type' not supported" in diagnostic [PR85278] 2020-04-14 14:22:31 -04:00
cxx-pretty-print.h c++: Include the constraint parameter mapping in diagnostic constraint contexts 2020-03-20 10:19:54 -04:00
decl2.c c++: lambdas with internal linkage are different to no-linkage [PR94426] 2020-04-13 06:35:33 -07:00
decl.c c++: Fix wrong paren-init of aggregates interference [PR93790] 2020-04-09 08:28:46 -04:00
decl.h
dump.c
error.c c++: Infinite diagnostic loop with decltype([]{}) [PR94521] 2020-04-13 16:53:48 -04:00
except.c c++: Avoid a suspicious -Wnoexcept warning [PR93805] 2020-03-23 16:08:43 -04:00
expr.c c++: Fix reuse of class constants [PR94453] 2020-04-04 11:06:31 -04:00
friend.c
g++spec.c
init.c c++: Fix crash in gimplifier with paren init of aggregates [PR94155] 2020-04-06 11:23:56 -04:00
lambda.c
lang-specs.h
lex.c
logic.cc Fix up duplicated duplicated words in comments 2020-03-18 12:56:26 +01:00
Make-lang.in
mangle.c c++: Mangling of dependent conversions [PR91377] 2020-04-04 16:22:44 -04:00
method.c c++: make __is_constructible work with paren-init of aggrs [PR94149] 2020-04-10 13:54:12 -04:00
name-lookup.c c++: Improve redeclared parameter name diagnostic [PR94588] 2020-04-13 23:12:31 -04:00
name-lookup.h
NEWS
operators.def
optimize.c
parser.c c++: Fix pasto in structured binding diagnostics [PR94571] 2020-04-16 07:19:57 +02:00
parser.h
pt.c c++: lambdas with internal linkage are different to no-linkage [PR94426] 2020-04-13 06:35:33 -07:00
ptree.c
rtti.c c++: Emit DFP typeinfos even when DFP is disabled [PR92906] 2020-02-14 00:11:24 +01:00
search.c
semantics.c c++: Fix handling of internal fn calls in statement expressions [PR94385] 2020-03-30 22:55:36 +02:00
tree.c c++: Stray RESULT_DECLs in result of constexpr call [PR94034] 2020-04-14 11:22:55 -04:00
type-utils.h c++: Fix return type deduction with an abbreviated function template 2020-02-10 20:43:53 -05:00
typeck2.c c++: Fix usage of CONSTRUCTOR_PLACEHOLDER_BOUNDARY inside array initializers [PR90996] 2020-04-07 09:04:30 -04:00
typeck.c c++: Further tweak for P1937R2 - const{expr,eval} inconsistencies 2020-02-28 17:35:32 +01:00
vtable-class-hierarchy.c