diff options
author | Richard Henderson <rth@redhat.com> | 2003-07-17 09:33:22 -0700 |
---|---|---|
committer | Richard Henderson <rth@gcc.gnu.org> | 2003-07-17 09:33:22 -0700 |
commit | b23ba0b898de1ff77ea043847d7e3131f7e14336 (patch) | |
tree | 24ac6c991d36e27fb90ff4a1475694d104d4cd10 /gcc | |
parent | 2a39bedbed4ad8389a9b7421215d7cf857070e13 (diff) | |
download | gcc-b23ba0b898de1ff77ea043847d7e3131f7e14336.zip gcc-b23ba0b898de1ff77ea043847d7e3131f7e14336.tar.gz gcc-b23ba0b898de1ff77ea043847d7e3131f7e14336.tar.bz2 |
re PR target/10907 ([IA64] gcc violates the ia64 ABI)
PR target/10907
* config/ia64/ia64.c (ia64_epilogue_uses): GP is live at end
even with !TARGET_CONST_GP.
(ia64_function_ok_for_sibcall): Reject non-local functions.
From-SVN: r69515
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/config/ia64/ia64.c | 22 |
2 files changed, 15 insertions, 14 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 5cdf4b6..44832d1 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2003-07-17 Richard Henderson <rth@redhat.com> + + PR target/10907 + * config/ia64/ia64.c (ia64_epilogue_uses): GP is live at end + even with !TARGET_CONST_GP. + (ia64_function_ok_for_sibcall): Reject non-local functions. + 2003-07-17 Steven Bosscher <steven@gcc.gnu.org> * c-common.c (c_estimate_num_insns_1): Don't handle diff --git a/gcc/config/ia64/ia64.c b/gcc/config/ia64/ia64.c index 444e882..b277eb0 100644 --- a/gcc/config/ia64/ia64.c +++ b/gcc/config/ia64/ia64.c @@ -3642,14 +3642,9 @@ ia64_function_ok_for_sibcall (decl, exp) tree decl; tree exp ATTRIBUTE_UNUSED; { - /* Direct calls are always ok. */ - if (decl) - return true; - - /* If TARGET_CONST_GP is in effect, then our caller expects us to - return with our current GP. This means that we'll always have - a GP reload after an indirect call. */ - return !ia64_epilogue_uses (R_GR (1)); + /* 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); } @@ -7356,12 +7351,11 @@ ia64_epilogue_uses (regno) switch (regno) { case R_GR (1): - /* When a function makes a call through a function descriptor, we - will write a (potentially) new value to "gp". After returning - from such a call, we need to make sure the function restores the - original gp-value, even if the function itself does not use the - gp anymore. */ - return (TARGET_CONST_GP && !(TARGET_AUTO_PIC || TARGET_NO_PIC)); + /* With a call to a function in another module, we will write a new + value to "gp". After returning from such a call, we need to make + sure the function restores the original gp-value, even if the + function itself does not use the gp anymore. */ + return !(TARGET_AUTO_PIC || TARGET_NO_PIC); case IN_REG (0): case IN_REG (1): case IN_REG (2): case IN_REG (3): case IN_REG (4): case IN_REG (5): case IN_REG (6): case IN_REG (7): |