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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@130441
138bc75d-0d04-0410-961f-
82ee72b054a4
+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
+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.
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);
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);
gnat_poplevel ();
- allocate_struct_function (gnu_stub_decl);
+ allocate_struct_function (gnu_stub_decl, false);
end_subprog_body (gnu_body);
}
\f
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 ();
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;
+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.
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
struct function *p;
if (cfun == 0)
- allocate_struct_function (NULL);
+ allocate_struct_function (NULL, false);
p = cfun;
p->outer = outer_function_chain;
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;
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;
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
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,
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;
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
+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
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
+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
--- /dev/null
+// { 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;
+};
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. */
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);
+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.
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. */