From: James E Wilson Date: Fri, 17 Sep 2004 17:56:32 +0000 (+0000) Subject: Fix linux kernel miscompile. X-Git-Tag: releases/gcc-3.3.5~19 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=72c100bc8725a92248f9312b2a44a0b8628684b2;p=thirdparty%2Fgcc.git Fix linux kernel miscompile. PR target/17455 * config/ia64/ia64.c (ia64_function_ok_for_sibcall): Return false if current_function_decl is a sibcall. From-SVN: r87659 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 05cb309f57cf..0d6e9d12f422 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2004-09-17 James E Wilson + + PR target/17455 + * config/ia64/ia64.c (ia64_function_ok_for_sibcall): Return false + if current_function_decl is a sibcall. + 2004-09-13 Richard Henderson PR inline-asm/6806 diff --git a/gcc/config/ia64/ia64.c b/gcc/config/ia64/ia64.c index b90ca308e10e..67fb535fbf0f 100644 --- a/gcc/config/ia64/ia64.c +++ b/gcc/config/ia64/ia64.c @@ -7394,6 +7394,12 @@ bool ia64_function_ok_for_sibcall (decl) tree decl; { + /* We can't perform a sibcall if the current function has the syscall_linkage + attribute. */ + if (lookup_attribute ("syscall_linkage", + TYPE_ATTRIBUTES (TREE_TYPE (current_function_decl)))) + return false; + /* We must always return with our current GP. This means we can only sibcall to functions defined in the current module. */ return decl && (*targetm.binds_local_p) (decl);