Commit f967586f by Richard Guenther Committed by Richard Biener

decl.c (start_preparsed_function): Do not promote return type.

2007-07-09  Richard Guenther  <rguenther@suse.de>

	cp/
	* decl.c (start_preparsed_function): Do not promote return type.

	* c-decl.c (start_function): Do not promote return type.

From-SVN: r126480
parent 58b9f26a
2007-07-09 Richard Guenther <rguenther@suse.de>
* c-decl.c (start_function): Do not promote return type.
2007-07-08 Daniel Franke <franke.daniel@gmail.com> 2007-07-08 Daniel Franke <franke.daniel@gmail.com>
* function.c (do_warn_unused_parameter): Do not warn if * function.c (do_warn_unused_parameter): Do not warn if
......
...@@ -6270,18 +6270,6 @@ start_function (struct c_declspecs *declspecs, struct c_declarator *declarator, ...@@ -6270,18 +6270,6 @@ start_function (struct c_declspecs *declspecs, struct c_declarator *declarator,
declare_parm_level (); declare_parm_level ();
restype = TREE_TYPE (TREE_TYPE (current_function_decl)); 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); resdecl = build_decl (RESULT_DECL, NULL_TREE, restype);
DECL_ARTIFICIAL (resdecl) = 1; DECL_ARTIFICIAL (resdecl) = 1;
DECL_IGNORED_P (resdecl) = 1; DECL_IGNORED_P (resdecl) = 1;
......
2007-07-09 Richard Guenther <rguenther@suse.de>
* decl.c (start_preparsed_function): Do not promote return type.
2007-07-08 Paolo Carlini <pcarlini@suse.de> 2007-07-08 Paolo Carlini <pcarlini@suse.de>
PR c++/30535 PR c++/30535
......
...@@ -10872,9 +10872,6 @@ start_preparsed_function (tree decl1, tree attrs, int flags) ...@@ -10872,9 +10872,6 @@ start_preparsed_function (tree decl1, tree attrs, int flags)
/* Build the return declaration for the function. */ /* Build the return declaration for the function. */
restype = TREE_TYPE (fntype); 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) if (DECL_RESULT (decl1) == NULL_TREE)
{ {
tree resdecl; tree resdecl;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment