https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107209

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|tree-optimization           |target

--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
_24 = 4.34763122374727917218706352286972105503082275390625e+0;

aarch64_general_gimple_fold_builtin builds

_24 = 3.14159265359000006156975359772332012653350830078125e+0 *
1.3838939999999999574953335468308068811893463134765625e+0;

and then rvrp_folder::fold_stmt folds this further.

Now, aarch64_general_gimple_fold_builtin uses gsi_replace with (..., true)
and so that moves EH info to the new stmt, but then

      /* Now cleanup.  */
      if (did_replace)
        {
...
          /* If we cleaned up EH information from the statement,
             remove EH edges.  */
          if (maybe_clean_or_replace_eh_stmt (old_stmt, stmt))
            bitmap_set_bit (need_eh_cleanup, bb->index);

no longer triggers.  So this is a target bug, aarch64 folding should _not_
update EH info, folding shouldn't update any of the on-the-side info.

diff --git a/gcc/config/aarch64/aarch64.cc b/gcc/config/aarch64/aarch64.cc
index 1d0f994f281..890062d359b 100644
--- a/gcc/config/aarch64/aarch64.cc
+++ b/gcc/config/aarch64/aarch64.cc
@@ -15157,7 +15157,7 @@ aarch64_gimple_fold_builtin (gimple_stmt_iterator *gsi)
   if (!new_stmt)
     return false;

-  gsi_replace (gsi, new_stmt, true);
+  gsi_replace (gsi, new_stmt, false);
   return true;
 }


fixes this.  aarch64 folks please test&push.

Reply via email to