This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/55935] [OOP] Fortran fronted has ADDR_EXPRs of FUNCTION_DECLs with bogus BLOCK
- From: "rguenth at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 11 Jan 2013 14:53:20 +0000
- Subject: [Bug fortran/55935] [OOP] Fortran fronted has ADDR_EXPRs of FUNCTION_DECLs with bogus BLOCK
- Auto-submitted: auto-generated
- References: <bug-55935-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55935
--- Comment #14 from Richard Biener <rguenth at gcc dot gnu.org> 2013-01-11 14:53:20 UTC ---
(In reply to comment #13)
> Created attachment 29148 [details]
> gimple-fold
>
> Alternative to alternative canonicalize_constructor_val fix which I'm afraid
> could sometimes unshare up to 3 times.
>
> Or we could just tree orig_cval = cval = unshare_expr (cval); as the first
> thing in the function (and drop the unshare_expr in fold_gimple_assign of
> course).
I think I prefer the latter.
Another one, hits gcc.c-torture/execute/20000910-1.c at -O3 -g
Index: tree-ssa.c
===================================================================
--- tree-ssa.c (revision 195103)
+++ tree-ssa.c (working copy)
@@ -427,7 +427,7 @@ insert_debug_temp_for_var_def (gimple_st
&& (!gimple_assign_single_p (def_stmt)
|| is_gimple_min_invariant (value)))
|| is_gimple_reg (value))
- value = unshare_expr (value);
+ ;
else
{
gimple def_temp;
@@ -469,7 +469,7 @@ insert_debug_temp_for_var_def (gimple_st
that was unshared when we found it had a single debug
use, or a DEBUG_EXPR_DECL, that can be safely
shared. */
- SET_USE (use_p, value);
+ SET_USE (use_p, unshare_expr (value));
/* If we didn't replace uses with a debug decl fold the
resulting expression. Otherwise we end up with invalid IL. */
if (TREE_CODE (value) != DEBUG_EXPR_DECL)