re PR c++/41275 (ICE: expand_expr_real_1, at expr.c:8416)

PR middle-end/41275
	* tree-inline.c (remap_decls): Don't put DECL_EXTERNAL decls
	on the local_decls list.

testsuite/
	* g++.dg/tree-ssa/pr41275.C: New test.

From-SVN: r151631
This commit is contained in:
Michael Matz 2009-09-11 11:08:38 +00:00 committed by Michael Matz
parent 0b7e34d7dd
commit 5c3ec539b7
4 changed files with 28 additions and 0 deletions

View File

@ -1,3 +1,9 @@
2009-09-11 Michael Matz <matz@suse.de>
PR middle-end/41275
* tree-inline.c (remap_decls): Don't put DECL_EXTERNAL decls
on the local_decls list.
2009-09-11 Alexandre Oliva <aoliva@redhat.com>
PR debug/41276

View File

@ -1,3 +1,8 @@
2009-09-11 Michael Matz <matz@suse.de>
PR middle-end/41275
* g++.dg/tree-ssa/pr41275.C: New test.
2009-09-11 Janus Weil <janus@gcc.gnu.org>
PR fortran/41242

View File

@ -0,0 +1,16 @@
// PR middle-end/41275
// { dg-do compile }
// { dg-options "-O2" }
// this used to ICE
struct ErrmsgWindow
{
virtual ~ErrmsgWindow()
{
extern int _switch_mode_errorstr;
_switch_mode_errorstr = 42;
}
};
void ShowErrorMessage(void)
{
ErrmsgWindow w;
}

View File

@ -536,6 +536,7 @@ remap_decls (tree decls, VEC(tree,gc) **nonlocalized_list, copy_body_data *id)
if (can_be_nonlocal (old_var, id))
{
if (TREE_CODE (old_var) == VAR_DECL
&& ! DECL_EXTERNAL (old_var)
&& (var_ann (old_var) || !gimple_in_ssa_p (cfun)))
cfun->local_decls = tree_cons (NULL_TREE, old_var,
cfun->local_decls);