From f967586f51957145975ede931f0540f5af3a94fe Mon Sep 17 00:00:00 2001 From: Richard Guenther Date: Mon, 9 Jul 2007 09:53:11 +0000 Subject: [PATCH] decl.c (start_preparsed_function): Do not promote return type. 2007-07-09 Richard Guenther cp/ * decl.c (start_preparsed_function): Do not promote return type. * c-decl.c (start_function): Do not promote return type. From-SVN: r126480 --- gcc/ChangeLog | 4 ++++ gcc/c-decl.c | 12 ------------ gcc/cp/ChangeLog | 4 ++++ gcc/cp/decl.c | 3 --- 4 files changed, 8 insertions(+), 15 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 16d0b220bae..a98964b9dc1 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +2007-07-09 Richard Guenther + + * c-decl.c (start_function): Do not promote return type. + 2007-07-08 Daniel Franke * function.c (do_warn_unused_parameter): Do not warn if diff --git a/gcc/c-decl.c b/gcc/c-decl.c index bde95aa0252..012339eec62 100644 --- a/gcc/c-decl.c +++ b/gcc/c-decl.c @@ -6270,18 +6270,6 @@ start_function (struct c_declspecs *declspecs, struct c_declarator *declarator, declare_parm_level (); restype = TREE_TYPE (TREE_TYPE (current_function_decl)); - /* Promote the value to int before returning it. */ - if (c_promoting_integer_type_p (restype)) - { - /* It retains unsignedness if not really getting wider. */ - if (TYPE_UNSIGNED (restype) - && (TYPE_PRECISION (restype) - == TYPE_PRECISION (integer_type_node))) - restype = unsigned_type_node; - else - restype = integer_type_node; - } - resdecl = build_decl (RESULT_DECL, NULL_TREE, restype); DECL_ARTIFICIAL (resdecl) = 1; DECL_IGNORED_P (resdecl) = 1; diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 24a47637203..60ae1778f8c 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,7 @@ +2007-07-09 Richard Guenther + + * decl.c (start_preparsed_function): Do not promote return type. + 2007-07-08 Paolo Carlini PR c++/30535 diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index bed426bb9c4..b49bfc845a9 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -10872,9 +10872,6 @@ start_preparsed_function (tree decl1, tree attrs, int flags) /* Build the return declaration for the function. */ restype = TREE_TYPE (fntype); - /* Promote the value to int before returning it. */ - if (c_promoting_integer_type_p (restype)) - restype = type_promotes_to (restype); if (DECL_RESULT (decl1) == NULL_TREE) { tree resdecl; -- 2.30.2