This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Question re tree-ssa-ccp.c:substitute_and_fold


On Fri, 2004-11-26 at 20:53 -0500, Richard Kenner wrote:
> This is PR18662, the failure of ACATS test c97114a.
> 
> This ICE's with
> 
> ../../test/c97114a.adb: In function 'C97114A.T':
> ../../test/c97114a.adb:132: error: Statement marked for throw, but doesn't.
> #   VUSE <S0D.926_251>;
> D.1121_112 = S0D.926.ARRAYD.924[1]{lb: 1 sz: 8}.sD.818;
> 
> Before replace_uses_in, the subscript 1 was a variable (D.1120_111).
> Since flag_non_call_exceptions is true, the former statement can trap
> but the latter cannot.
> 
> But because replaced_address is still zero, we don't call
> maybe_clean_eh_stmt and we need to.
> 
> The patch below calls it unconditionally.  That may not be correct,
> though I'm not not at all sure what the correct condition is.
> 
> Suggestions?
> 
I had to do the same thing on tree-cleanup-branch.  Similar reasons.
You also want to unconditionally call modify_stmt in here.  So you end
up with:

          if (did_replace)
            {
              bool changed = fold_stmt (bsi_stmt_ptr (i));
              stmt = bsi_stmt(i);

              /* If we folded a builtin function, we'll likely
                 need to rename VDEFs.  */
              if (replaced_address || changed)
                mark_new_vars_to_rename (stmt, vars_to_rename);

              /* If we cleaned up EH information from the statement,
                 remove EH edges.  */
              if (maybe_clean_eh_stmt (stmt))
                tree_purge_dead_eh_edges (bb);

              modify_stmt (stmt);
            }


Diego.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]