Fix PR middle-end/98082
authorEric Botcazou <ebotcazou@adacore.com>
Thu, 3 Dec 2020 14:52:15 +0000 (15:52 +0100)
committerEric Botcazou <ebotcazou@adacore.com>
Thu, 3 Dec 2020 14:56:33 +0000 (15:56 +0100)
commit5d103763b9bc6a998dd4a453861663b229d7a24a
tree7f4a3acf42b2db48df4669313ff31cc03e5e1b49
parent896048cf43d5eb21ab7c16553bb9d13b0f890b81
Fix PR middle-end/98082

this fixes an ICE introduced by the fix for PR middle-end/97078 where
use_register_for_decl was changed to return true at -O0 for a parameter
of a thunk.  It turns out that we need to do the same for a result in
this case.

gcc/ChangeLog:
PR middle-end/98082
* function.c (use_register_for_decl): Also return true for a result
if cfun->tail_call_marked is true.

gcc/testsuite/ChangeLog:
* g++.dg/cpp2a/pr98082.C: New test.
gcc/function.c
gcc/testsuite/g++.dg/cpp2a/pr98082.C [new file with mode: 0644]