From 123ccad620d8e02bd925996b1843f1bf0e28fdb6 Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Wed, 22 Feb 2006 19:59:31 +0000 Subject: [PATCH] 2006-02-22 Roland McGrath * ppc64_retval.c (SVR4_STRUCT_RETURN): New macro. (ppc64_return_value_location): Use registers for aggregate conditional on that. * ppc_retval.c (SVR4_STRUCT_RETURN): New macro. (ppc_return_value_location): Use registers for aggregate conditional on that. --- backends/ChangeLog | 9 +++++++++ backends/ppc64_retval.c | 8 ++++++-- backends/ppc_retval.c | 10 ++++++++-- 3 files changed, 23 insertions(+), 4 deletions(-) diff --git a/backends/ChangeLog b/backends/ChangeLog index 84515e51d..33d52a2f8 100644 --- a/backends/ChangeLog +++ b/backends/ChangeLog @@ -1,3 +1,12 @@ +2006-02-22 Roland McGrath + + * ppc64_retval.c (SVR4_STRUCT_RETURN): New macro. + (ppc64_return_value_location): Use registers for aggregate conditional + on that. + * ppc_retval.c (SVR4_STRUCT_RETURN): New macro. + (ppc_return_value_location): Use registers for aggregate conditional + on that. + 2006-01-12 Roland McGrath * s390_retval.c: New file. diff --git a/backends/ppc64_retval.c b/backends/ppc64_retval.c index 818529157..797b22a25 100644 --- a/backends/ppc64_retval.c +++ b/backends/ppc64_retval.c @@ -1,5 +1,5 @@ /* Function return value location for Linux/PPC64 ABI. - Copyright (C) 2005 Red Hat, Inc. + Copyright (C) 2005, 2006 Red Hat, Inc. This program is Open Source software; you can redistribute it and/or modify it under the terms of the Open Software License version 1.0 as @@ -22,6 +22,10 @@ #include "libebl_CPU.h" +/* This is the SVR4 ELF ABI convention, but AIX and Linux do not use it. */ +#define SVR4_STRUCT_RETURN 0 + + /* r3. */ static const Dwarf_Op loc_intreg[] = { @@ -121,7 +125,7 @@ ppc64_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp) return nloc_fp4regs; } } - if (size <= 8) + if (size <= 8 && SVR4_STRUCT_RETURN) { intreg: *locp = loc_intreg; diff --git a/backends/ppc_retval.c b/backends/ppc_retval.c index 369c5997a..99458eb52 100644 --- a/backends/ppc_retval.c +++ b/backends/ppc_retval.c @@ -1,5 +1,5 @@ /* Function return value location for Linux/PPC ABI. - Copyright (C) 2005 Red Hat, Inc. + Copyright (C) 2005, 2006 Red Hat, Inc. This program is Open Source software; you can redistribute it and/or modify it under the terms of the Open Software License version 1.0 as @@ -22,6 +22,10 @@ #include "libebl_CPU.h" +/* This is the SVR4 ELF ABI convention, but AIX and Linux do not use it. */ +#define SVR4_STRUCT_RETURN 0 + + /* r3, or pair r3, r4. */ static const Dwarf_Op loc_intreg[] = { @@ -47,6 +51,7 @@ static const Dwarf_Op loc_aggregate[] = }; #define nloc_aggregate 1 + int ppc_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp) { @@ -127,7 +132,8 @@ ppc_return_value_location (Dwarf_Die *functypedie, const Dwarf_Op **locp) case DW_TAG_class_type: case DW_TAG_union_type: case DW_TAG_array_type: - if (dwarf_formudata (dwarf_attr (typedie, DW_AT_byte_size, + if (SVR4_STRUCT_RETURN + && dwarf_formudata (dwarf_attr (typedie, DW_AT_byte_size, &attr_mem), &size) == 0 && size > 0 && size <= 8) goto intreg; -- 2.47.2