This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] pass C++ decimal classes same as scalars


On Mon, Nov 23, 2009 at 3:34 PM, Janis Johnson <janis187@us.ibm.com> wrote:
> This patch causes G++ to pass std::decimal::decimal32/64/128 the same
> as their corresponding scalar types; a longer rationale is in:
>
> ?http://gcc.gnu.org/ml/gcc-patches/2009-10/msg00866.html
>
> Jason said here:
>
> ?http://gcc.gnu.org/ml/gcc-patches/2009-11/msg00110.html
>
> that the original patch looks good except for a change that I've made
> to the new one, to use a single macro for both the old
> TYPE_TRANSPARENT_UNION and the new use for record types that are
> passed the same as the single scalar member. ?I call the new macro
> TYPE_PASS_AS_TRANSPARENT but am certainly open to suggestions. ?Jason
> also said he'd like this change in 4.5.
>
> Tested on powerpc64-linux for -m32/-m64. ?OK for trunk after the
> C++ ABI patch is accepted? ?I pinged that last week but so far Jason
> is the only one who has commented on it.
>
> 2009-11-23 ?Janis Johnson ?<janis187@us.ibm.com>
>
> ? ? ? ?* tree.h (TYPE_TRANSPARENT_UNION): Replace with ...
> ? ? ? ?(TYPE_PASS_AS_TRANSPARENT): this, for union and record.
> ? ? ? ?* calls.c (initialize argument_information): Handle it.
> ? ? ? ?* c-common.c (handle_transparent_union_attribute): Use new name.
> ? ? ? ?* c-decl.c (finish_struct): Ditto.
> ? ? ? ?* c-typeck.c (type_lists_compatible_p): Ditto.
> ? ? ? ?(convert_for_assignment): Use new name and also handle record.
> ? ? ? ?* function.c (aggregate_value_p): Handle it.
> ? ? ? ?(pass_by_reference): Ditto.
> ? ? ? ?(assign_parm_data_types): Ditto.
> ? ? ? ?* print-tree.c (print_node): Ditto.
> ? ? ? ?* lto-streamer-in.c (unpack_ts_type_value_fields): Ditto.
> ? ? ? ?* lto-streamer-out.c (pack_ts_type_value_fields): Ditto.
>
> gcc/cp/
> ? ? ? ?* mangle.c (write_type): Mangle transparent record as member type.
> ? ? ? ?* semantics.c (begin_class_definition): Recognize decimal classes
> ? ? ? ?and set TYPE__ASS_AS_TRANSPARENT.
>
> gcc/testsuite/
> ? ? ? ?* g++.dg/compat/decimal/compat-common.h: New file.
> ? ? ? ?* g++.dg/compat/decimal/decimal-dummy.h: New file.
> ? ? ? ?* g++.dg/compat/decimal/pass_x.h: New file.
> ? ? ? ?* g++.dg/compat/decimal/pass_y.h: New file.
> ? ? ? ?* g++.dg/compat/decimal/pass-1_main.C: New file.
> ? ? ? ?* g++.dg/compat/decimal/pass-1_x.C: New file.
> ? ? ? ?* g++.dg/compat/decimal/pass-1_y.C: New file.
> ? ? ? ?* g++.dg/compat/decimal/pass-2_main.C: New file.
> ? ? ? ?* g++.dg/compat/decimal/pass-2_x.C: New file.
> ? ? ? ?* g++.dg/compat/decimal/pass-2_y.C: New file.
> ? ? ? ?* g++.dg/compat/decimal/pass-3_main.C: New file.
> ? ? ? ?* g++.dg/compat/decimal/pass-3_x.C: New file.
> ? ? ? ?* g++.dg/compat/decimal/pass-3_y.C: New file.
> ? ? ? ?* g++.dg/compat/decimal/pass-4_main.C: New file.
> ? ? ? ?* g++.dg/compat/decimal/pass-4_x.C: New file.
> ? ? ? ?* g++.dg/compat/decimal/pass-4_y.C: New file.
> ? ? ? ?* g++.dg/compat/decimal/pass-5_main.C: New file.
> ? ? ? ?* g++.dg/compat/decimal/pass-5_x.C: New file.
> ? ? ? ?* g++.dg/compat/decimal/pass-5_y.C: New file.
> ? ? ? ?* g++.dg/compat/decimal/pass-6_main.C: New file.
> ? ? ? ?* g++.dg/compat/decimal/pass-6_x.C: New file.
> ? ? ? ?* g++.dg/compat/decimal/pass-6_y.C: New file.
> ? ? ? ?* g++.dg/compat/decimal/return_x.h: New file.
> ? ? ? ?* g++.dg/compat/decimal/return_y.h: New file.
> ? ? ? ?* g++.dg/compat/decimal/return-1_main.C: New file.
> ? ? ? ?* g++.dg/compat/decimal/return-1_x.C: New file.
> ? ? ? ?* g++.dg/compat/decimal/return-1_y.C: New file.
> ? ? ? ?* g++.dg/compat/decimal/return-2_main.C: New file.
> ? ? ? ?* g++.dg/compat/decimal/return-2_x.C: New file.
> ? ? ? ?* g++.dg/compat/decimal/return-2_y.C: New file.
> ? ? ? ?* g++.dg/compat/decimal/return-3_main.C: New file.
> ? ? ? ?* g++.dg/compat/decimal/return-3_x.C: New file.
> ? ? ? ?* g++.dg/compat/decimal/return-3_y.C: New file.
> ? ? ? ?* g++.dg/compat/decimal/return-4_main.C: New file.
> ? ? ? ?* g++.dg/compat/decimal/return-4_x.C: New file.
> ? ? ? ?* g++.dg/compat/decimal/return-4_y.C: New file.
> ? ? ? ?* g++.dg/compat/decimal/return-5_main.C: New file.
> ? ? ? ?* g++.dg/compat/decimal/return-5_x.C: New file.
> ? ? ? ?* g++.dg/compat/decimal/return-5_y.C: New file.
> ? ? ? ?* g++.dg/compat/decimal/return-6_main.C: New file.
> ? ? ? ?* g++.dg/compat/decimal/return-6_x.C: New file.
> ? ? ? ?* g++.dg/compat/decimal/return-6_y.C: New file.
>

This caused:

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42880

-- 
H.J.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]