Commit c477e13b by Jakub Jelinek Committed by Jakub Jelinek

re PR tree-optimization/21610 (ICE in make_decl_rtl)

	PR tree-optimization/21610
	* c-typeck.c (decl_constant_value_for_broken_optimization): If not
	returning DECL, call unshare_expr.

	* gcc.c-torture/compile/20050516-1.c: New test.

From-SVN: r99815
parent 22c3c091
2005-05-17 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/21610
* c-typeck.c (decl_constant_value_for_broken_optimization): If not
returning DECL, call unshare_expr.
2005-05-17 Hans-Peter Nilsson <hp@axis.com> 2005-05-17 Hans-Peter Nilsson <hp@axis.com>
* config/cris/cris.md: Unquote preparation and output statements. * config/cris/cris.md: Unquote preparation and output statements.
......
...@@ -1249,10 +1249,18 @@ decl_constant_value (tree decl) ...@@ -1249,10 +1249,18 @@ decl_constant_value (tree decl)
static tree static tree
decl_constant_value_for_broken_optimization (tree decl) decl_constant_value_for_broken_optimization (tree decl)
{ {
tree ret;
if (pedantic || DECL_MODE (decl) == BLKmode) if (pedantic || DECL_MODE (decl) == BLKmode)
return decl; return decl;
else
return decl_constant_value (decl); ret = decl_constant_value (decl);
/* Avoid unwanted tree sharing between the initializer and current
function's body where the tree can be modified e.g. by the
gimplifier. */
if (ret != decl && TREE_STATIC (decl))
ret = unshare_expr (ret);
return ret;
} }
......
2005-05-17 Jakub Jelinek <jakub@redhat.com> 2005-05-17 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/21610
* gcc.c-torture/compile/20050516-1.c: New test.
PR fortran/15080 PR fortran/15080
* gfortran.fortran-torture/execute/forall_3.f90: Remove comment * gfortran.fortran-torture/execute/forall_3.f90: Remove comment
about the test failing. about the test failing.
......
/* PR tree-optimization/21610 */
struct S { char s; };
struct T { struct S t; };
struct S *const p = &((struct T * const) (0x4000))->t;
void
foo (void)
{
p->s = 0;
}
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