diff options
author | Stuart Hastings <stuart@apple.com> | 2006-04-26 23:02:35 +0000 |
---|---|---|
committer | Stuart Hastings <stuart@apple.com> | 2006-04-26 23:02:35 +0000 |
commit | c423b7209d0f7da550c01fc1d1af714439ea0954 (patch) | |
tree | 053d65a10159d3ab6dd4e5c97ee6ed78bacfac9b | |
parent | e6d1dd18d84a23b7dac1d09953d54b7d3d9f2d77 (diff) |
Radar 4314956
Import from mainline:
2005-08-31 Richard Henderson <rth@redhat.com>
* config/i386/i386.c (ix86_function_ok_for_sibcall): Fix test for
fp return matching.
* g++.dg/sibcall-opt.C: New.
git-svn-id: https://gcc.gnu.org/svn/gcc/branches/apple-local-200502-branch@113285 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/ChangeLog.apple-ppc | 8 | ||||
-rw-r--r-- | gcc/config/i386/i386.c | 13 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog.apple-ppc | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/sibcall-opt.C | 19 |
4 files changed, 42 insertions, 3 deletions
diff --git a/gcc/ChangeLog.apple-ppc b/gcc/ChangeLog.apple-ppc index 2e595bb3026..5aff700f0cc 100644 --- a/gcc/ChangeLog.apple-ppc +++ b/gcc/ChangeLog.apple-ppc @@ -1,3 +1,11 @@ +2006-04-26 Hui-May Chang <hm.chang@apple.com> + + Radar 4314956 + Import from mainline: + 2005-08-31 Richard Henderson <rth@redhat.com> + * config/i386/i386.c (ix86_function_ok_for_sibcall): Fix test for + fp return matching. + 2006-04-26 Mike Stump <mrs@apple.com> Radar 4505697 diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 7cf00a31731..21572963b2a 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -1844,7 +1844,7 @@ const struct attribute_spec ix86_attribute_table[] = static bool ix86_function_ok_for_sibcall (tree decl, tree exp) { - /* APPLE LOCAL begin mainline 2005-09-20 4205103 */ + /* APPLE LOCAL begin mainline 2006-04-16 4205103, 4314956 */ tree func; rtx a, b; @@ -1876,9 +1876,16 @@ ix86_function_ok_for_sibcall (tree decl, tree exp) a = ix86_function_value (TREE_TYPE (exp), func, false); b = ix86_function_value (TREE_TYPE (DECL_RESULT (cfun->decl)), cfun->decl, false); - if (! rtx_equal_p (a, b)) + if (STACK_REG_P (a) || STACK_REG_P (b)) + { + if (!rtx_equal_p (a, b)) + return false; + } + else if (VOID_TYPE_P (TREE_TYPE (DECL_RESULT (cfun->decl)))) + ; + else if (! rtx_equal_p (a, b)) return false; - /* APPLE LOCAL end mainline 2005-09-20 4205103 */ + /* APPLE LOCAL end mainline 2006-04-16 4205103, 4314956 */ /* If this call is indirect, we'll need to be able to use a call-clobbered register for the address of the target function. Make sure that all diff --git a/gcc/testsuite/ChangeLog.apple-ppc b/gcc/testsuite/ChangeLog.apple-ppc index d40c98ade2b..8e1eed0a040 100644 --- a/gcc/testsuite/ChangeLog.apple-ppc +++ b/gcc/testsuite/ChangeLog.apple-ppc @@ -1,3 +1,8 @@ +2006-04-26 Hui-May Chang <hm.chang@apple.com> + + Radar 4314956 + * g++.dg/sibcall-opt.C: New. + 2006-04-26 Mike Stump <mrs@apple.com> Radar 4505697 diff --git a/gcc/testsuite/g++.dg/sibcall-opt.C b/gcc/testsuite/g++.dg/sibcall-opt.C new file mode 100644 index 00000000000..a2ec43563dd --- /dev/null +++ b/gcc/testsuite/g++.dg/sibcall-opt.C @@ -0,0 +1,19 @@ +/* APPLE LOCAL file mainline 2006-04-19 4314956 */ +/* { dg-do compile { target i?86*-*-* } }*/ +/* { dg-options "-O3" } */ +/* { dg-final { scan-assembler "\tjmp\t.*memset*" } } */ +typedef __SIZE_TYPE__ size_t; +extern "C" void memset(void *, int, size_t); +class SIMDProcessor { +public: + virtual void Memset(void *, const int, const int) = 0; +}; + +class SIMDGeneric : public SIMDProcessor { +public: + virtual void Memset(void *, const int, const int); +}; + +void SIMDGeneric::Memset(void *dst, const int val, const int count) { + memset(dst, val, count); +} |