From: wilson Date: Wed, 15 Sep 2004 23:26:33 +0000 (+0000) Subject: Fix linux kernel miscompilation. X-Git-Url: http://git.sourceforge.jp/view?p=pf3gnuchains%2Fgcc-fork.git;a=commitdiff_plain;h=d9137ad4cfcf48b65e1a775c3d7d7db85962d58e Fix linux kernel miscompilation. PR target/17455 * config/ia64/ia64.c (ia64_function_ok_for_sibcall): Return false if current_function_decl is a sibcall. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@87574 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d9620165672..39238769771 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2004-09-15 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-15 Mark Mitchell * varasm.c (default_function_rdodata_section): Make sure to pass diff --git a/gcc/config/ia64/ia64.c b/gcc/config/ia64/ia64.c index b85e1c2be11..871c52de502 100644 --- a/gcc/config/ia64/ia64.c +++ b/gcc/config/ia64/ia64.c @@ -3367,6 +3367,12 @@ ia64_pass_by_reference (CUMULATIVE_ARGS *cum ATTRIBUTE_UNUSED, static bool ia64_function_ok_for_sibcall (tree decl, tree exp ATTRIBUTE_UNUSED) { + /* 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);