PR 34081/C++

2007-11-26  Andreas Krebbel  <krebbel1@de.ibm.com>

	PR 34081/C++
	* c-decl.c (store_parm_decls): Pass 'false' for the new
	allocate_struct_function parameter.
	* cgraphunit.c (cgraph_build_static_cdtor): Likewise.
	* tree-parloops.c (create_loop_fn): Likewise.
	* function.c (push_function_context_to, push_struct_function,
	init_function_start): Likewise.
	(allocate_struct_function): Add boolean parameter.
	* tree.h (allocate_struct_function): Add boolean parameter.
	* function.h (struct function): Move returns_struct and
	returns_pcc_struct to the end of the structure definiton.

2007-11-26  Andreas Krebbel  <krebbel1@de.ibm.com>

        PR 34081/C++
        * trans.c (Subprogram_Body_to_gnu, Compilation_Unit_to_gnu):
        Pass 'false' for the new allocate_struct_function parameter.
        * utils.c (build_function_stub): Likewise.

2007-11-26  Andreas Krebbel  <krebbel1@de.ibm.com>

	PR 34081/C++
	* decl.c (finish_method): Pass 'false' for the new
	allocate_struct_function parameter.

2007-11-26  Andreas Krebbel  <krebbel1@de.ibm.com>

	PR 34081/C++
	* treetree.c (tree_code_create_function_wrapup): Pass 'false' 
	for the new allocate_struct_function parameter.

2007-11-26  Andreas Krebbel  <krebbel1@de.ibm.com>

	PR 34081/C++
	* decl.c (start_preparsed_function): Pass 
	processing_template_decl for the new allocate_struct_function
	parameter.

2007-11-26  Andreas Krebbel  <krebbel1@de.ibm.com>

	PR 34081/C++
	* g++.dg/template/dependent-expr6.C: New testcase.

From-SVN: r130441
This commit is contained in:
Andreas Krebbel 2007-11-26 17:33:23 +00:00 committed by Andreas Krebbel
parent be0c460344
commit 182e0d71f0
18 changed files with 97 additions and 24 deletions

View File

@ -1,3 +1,17 @@
2007-11-26 Andreas Krebbel <krebbel1@de.ibm.com>
PR 34081/C++
* c-decl.c (store_parm_decls): Pass 'false' for the new
allocate_struct_function parameter.
* cgraphunit.c (cgraph_build_static_cdtor): Likewise.
* tree-parloops.c (create_loop_fn): Likewise.
* function.c (push_function_context_to, push_struct_function,
init_function_start): Likewise.
(allocate_struct_function): Add boolean parameter.
* tree.h (allocate_struct_function): Add boolean parameter.
* function.h (struct function): Move returns_struct and
returns_pcc_struct to the end of the structure definiton.
2007-11-26 Uros Bizjak <ubizjak@gmail.com>
PR target/34215

View File

@ -1,3 +1,10 @@
2007-11-26 Andreas Krebbel <krebbel1@de.ibm.com>
PR 34081/C++
* trans.c (Subprogram_Body_to_gnu, Compilation_Unit_to_gnu):
Pass 'false' for the new allocate_struct_function parameter.
* utils.c (build_function_stub): Likewise.
2007-11-25 Richard Guenther <rguenther@suse.de>
utils.c (gnat_pushlevel): Use BLOCK_CHAIN.

View File

@ -1776,7 +1776,7 @@ Subprogram_Body_to_gnu (Node_Id gnat_node)
Sloc_to_locus (Sloc (gnat_node), &DECL_SOURCE_LOCATION (gnu_subprog_decl));
/* Initialize the information structure for the function. */
allocate_struct_function (gnu_subprog_decl);
allocate_struct_function (gnu_subprog_decl, false);
DECL_STRUCT_FUNCTION (gnu_subprog_decl)->language
= GGC_CNEW (struct language_function);
@ -2914,7 +2914,7 @@ Compilation_Unit_to_gnu (Node_Id gnat_node)
push_stack (&gnu_elab_proc_stack, NULL_TREE, gnu_elab_proc_decl);
DECL_ELABORATION_PROC_P (gnu_elab_proc_decl) = 1;
allocate_struct_function (gnu_elab_proc_decl);
allocate_struct_function (gnu_elab_proc_decl, false);
Sloc_to_locus (Sloc (gnat_unit_entity), &cfun->function_end_locus);
set_cfun (NULL);

View File

@ -2983,7 +2983,7 @@ build_function_stub (tree gnu_subprog, Entity_Id gnat_subprog)
gnat_poplevel ();
allocate_struct_function (gnu_stub_decl);
allocate_struct_function (gnu_stub_decl, false);
end_subprog_body (gnu_body);
}

View File

@ -6625,7 +6625,7 @@ store_parm_decls (void)
gen_aux_info_record (fndecl, 1, 0, proto);
/* Initialize the RTL code for the function. */
allocate_struct_function (fndecl);
allocate_struct_function (fndecl, false);
/* Begin the statement tree for this function. */
DECL_SAVED_TREE (fndecl) = push_stmt_list ();

View File

@ -1481,7 +1481,7 @@ cgraph_build_static_cdtor (char which, tree body, int priority)
DECL_ARTIFICIAL (resdecl) = 1;
DECL_RESULT (decl) = resdecl;
allocate_struct_function (decl);
allocate_struct_function (decl, false);
TREE_STATIC (decl) = 1;
TREE_USED (decl) = 1;

View File

@ -1,3 +1,10 @@
2007-11-26 Andreas Krebbel <krebbel1@de.ibm.com>
PR 34081/C++
* decl.c (start_preparsed_function): Pass
processing_template_decl for the new allocate_struct_function
parameter.
2007-11-25 Richard Guenther <rguenther@suse.de>
decl.c (poplevel): Use BLOCK_CHAIN.

View File

@ -11211,7 +11211,7 @@ start_preparsed_function (tree decl1, tree attrs, int flags)
CFUN set up, and our per-function variables initialized.
FIXME factor out the non-RTL stuff. */
bl = current_binding_level;
allocate_struct_function (decl1);
allocate_struct_function (decl1, processing_template_decl);
current_binding_level = bl;
/* Even though we're inside a function body, we still don't want to

View File

@ -247,7 +247,7 @@ push_function_context_to (tree context ATTRIBUTE_UNUSED)
struct function *p;
if (cfun == 0)
allocate_struct_function (NULL);
allocate_struct_function (NULL, false);
p = cfun;
p->outer = outer_function_chain;
@ -3881,10 +3881,14 @@ get_next_funcdef_no (void)
directly into cfun and invoke the back end hook explicitly at the
very end, rather than initializing a temporary and calling set_cfun
on it.
*/
ABSTRACT_P is true if this is a function that will never be seen by
the middle-end. Such functions are front-end concepts (like C++
function templates) that do not correspond directly to functions
placed in object files. */
void
allocate_struct_function (tree fndecl)
allocate_struct_function (tree fndecl, bool abstract_p)
{
tree result;
tree fntype = fndecl ? TREE_TYPE (fndecl) : NULL_TREE;
@ -3910,7 +3914,7 @@ allocate_struct_function (tree fndecl)
cfun->decl = fndecl;
result = DECL_RESULT (fndecl);
if (aggregate_value_p (result, fndecl))
if (!abstract_p && aggregate_value_p (result, fndecl))
{
#ifdef PCC_STATIC_STRUCT_RETURN
current_function_returns_pcc_struct = 1;
@ -3943,7 +3947,7 @@ push_struct_function (tree fndecl)
VEC_safe_push (function_p, heap, cfun_stack, cfun);
if (fndecl)
in_system_header = DECL_IN_SYSTEM_HEADER (fndecl);
allocate_struct_function (fndecl);
allocate_struct_function (fndecl, false);
}
/* Reset cfun, and other non-struct-function variables to defaults as
@ -3998,7 +4002,7 @@ init_function_start (tree subr)
if (subr && DECL_STRUCT_FUNCTION (subr))
set_cfun (DECL_STRUCT_FUNCTION (subr));
else
allocate_struct_function (subr);
allocate_struct_function (subr, false);
prepare_function_start ();
/* Warn if this value is an aggregate type,

View File

@ -360,14 +360,6 @@ struct function GTY(())
probabilities pass. */
ENUM_BITFIELD (function_frequency) function_frequency : 2;
/* Nonzero if function being compiled needs to be given an address
where the value should be stored. */
unsigned int returns_struct : 1;
/* Nonzero if function being compiled needs to
return the address of where it has put a structure value. */
unsigned int returns_pcc_struct : 1;
/* Nonzero if function being compiled can call setjmp. */
unsigned int calls_setjmp : 1;
@ -456,6 +448,17 @@ struct function GTY(())
function has been gimplified, so we can make sure we're not
creating non GIMPLE tuples after gimplification. */
unsigned int gimplified : 1;
/* Fields below this point are not set for abstract functions; see
allocate_struct_function. */
/* Nonzero if function being compiled needs to be given an address
where the value should be stored. */
unsigned int returns_struct : 1;
/* Nonzero if function being compiled needs to
return the address of where it has put a structure value. */
unsigned int returns_pcc_struct : 1;
};
/* If va_list_[gf]pr_size is set to this, it means we don't know how

View File

@ -1,3 +1,9 @@
2007-11-26 Andreas Krebbel <krebbel1@de.ibm.com>
PR 34081/C++
* decl.c (finish_method): Pass 'false' for the new
allocate_struct_function parameter.
2007-11-26 Alexandre Oliva <aoliva@redhat.com>
* expr.c (build_jni_stub): Use the computed jni func type for

View File

@ -1850,7 +1850,7 @@ finish_method (tree fndecl)
if (DECL_STRUCT_FUNCTION (fndecl))
set_cfun (DECL_STRUCT_FUNCTION (fndecl));
else
allocate_struct_function (fndecl);
allocate_struct_function (fndecl, false);
#ifdef USE_MAPPED_LOCATION
cfun->function_end_locus = DECL_FUNCTION_LAST_LINE (fndecl);
#else

View File

@ -1,3 +1,8 @@
2007-11-26 Andreas Krebbel <krebbel1@de.ibm.com>
PR 34081/C++
* g++.dg/template/dependent-expr6.C: New testcase.
2007-11-26 Uros Bizjak <ubizjak@gmail.com>
PR target/34215

View File

@ -0,0 +1,21 @@
// { dg-do compile }
// Copyright 2007 Free Software Foundation
// Contributed by Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
// PR C++ 34081 ICE
class Foo;
template < class Foo > class Bar
{
enum Status
{ OK, NO };
enum Status getStatus ()
{
return status;
}
Status status;
};

View File

@ -1248,7 +1248,7 @@ create_loop_fn (void)
TREE_USED (t) = 1;
DECL_ARGUMENTS (decl) = t;
allocate_struct_function (decl);
allocate_struct_function (decl, false);
/* The call to allocate_struct_function clobbers CFUN, so we need to restore
it. */

View File

@ -4936,7 +4936,7 @@ extern void expand_main_function (void);
extern void init_dummy_function_start (void);
extern void expand_dummy_function_end (void);
extern unsigned int init_function_for_compilation (void);
extern void allocate_struct_function (tree);
extern void allocate_struct_function (tree, bool);
extern void push_struct_function (tree fndecl);
extern void init_function_start (tree);
extern bool use_register_for_decl (const_tree);

View File

@ -1,3 +1,9 @@
2007-11-26 Andreas Krebbel <krebbel1@de.ibm.com>
PR 34081/C++
* treetree.c (tree_code_create_function_wrapup): Pass 'false'
for the new allocate_struct_function parameter.
2007-09-12 Jan Hubicka <jh@suse.cz>
* treetree.c (LANG_HOOKS_CALLGRAPH_EXPAND_FUNCTION): Kill.

View File

@ -457,7 +457,7 @@ tree_code_create_function_wrapup (location_t loc)
BLOCK_VARS (block),
stmts, block);
allocate_struct_function (fn_decl);
allocate_struct_function (fn_decl, false);
cfun->function_end_locus = loc;
/* Dump the original tree to a file. */