Commit d5d94b80 by Eric Botcazou Committed by Eric Botcazou

rs6000.c (rs6000_function_ok_for_sibcall): Return false if the call takes a static chain.

	* config/rs6000/rs6000.c (rs6000_function_ok_for_sibcall): Return false
	if the call takes a static chain.

From-SVN: r264463
parent 512cc015
2018-09-21 Eric Botcazou <ebotcazou@adacore.com>
* config/rs6000/rs6000.c (rs6000_function_ok_for_sibcall): Return false
if the call takes a static chain.
2018-09-21 Martin Liska <mliska@suse.cz> 2018-09-21 Martin Liska <mliska@suse.cz>
* auto-profile.c (autofdo_source_profile::read): Do not * auto-profile.c (autofdo_source_profile::read): Do not
......
...@@ -24331,6 +24331,12 @@ rs6000_function_ok_for_sibcall (tree decl, tree exp) ...@@ -24331,6 +24331,12 @@ rs6000_function_ok_for_sibcall (tree decl, tree exp)
{ {
tree fntype; tree fntype;
/* The sibcall epilogue may clobber the static chain register.
??? We could work harder and avoid that, but it's probably
not worth the hassle in practice. */
if (CALL_EXPR_STATIC_CHAIN (exp))
return false;
if (decl) if (decl)
fntype = TREE_TYPE (decl); fntype = TREE_TYPE (decl);
else else
2018-09-21 Eric Botcazou <ebotcazou@adacore.com> 2018-09-21 Eric Botcazou <ebotcazou@adacore.com>
* gcc.dg/nested-func-11.c: New test.
* lib/target-supports.exp (check_effective_target_tls_runtime): Make
more robust and remove target-specific handling.
2018-09-21 Eric Botcazou <ebotcazou@adacore.com>
* gcc.c-torture/execute/20180921-1.c: New test. * gcc.c-torture/execute/20180921-1.c: New test.
2018-09-20 Marek Polacek <polacek@redhat.com> 2018-09-20 Marek Polacek <polacek@redhat.com>
......
/* { dg-do run } */
/* { dg-options "-O2 -fno-omit-frame-pointer" } */
int __attribute__((noipa)) foo (int i)
{
int a;
void __attribute__((noipa)) nested2 (int i)
{
a = i;
}
void __attribute__((noipa)) nested1 (int i)
{
int b[32];
for (int j = 0; j < 32; j++)
b[j] = i + j;
nested2 (b[i]);
}
nested1 (i);
return a;
}
int main (void)
{
if (foo (4) != 8)
__builtin_abort ();
return 0;
}
...@@ -879,13 +879,8 @@ proc check_effective_target_tls_emulated {} { ...@@ -879,13 +879,8 @@ proc check_effective_target_tls_emulated {} {
# Return 1 if TLS executables can run correctly, 0 otherwise. # Return 1 if TLS executables can run correctly, 0 otherwise.
proc check_effective_target_tls_runtime {} { proc check_effective_target_tls_runtime {} {
# The runtime does not have TLS support, but just
# running the test below is insufficient to show this.
if { [istarget msp430-*-*] || [istarget visium-*-*] } {
return 0
}
return [check_runtime tls_runtime { return [check_runtime tls_runtime {
__thread int thr = 0; __thread int thr __attribute__((tls_model("global-dynamic"))) = 0;
int main (void) { return thr; } int main (void) { return thr; }
} [add_options_for_tls ""]] } [add_options_for_tls ""]]
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment