[Bug ipa/93385] [10 Regression] wrong code with u128 modulo at -O2 -fno-dce -fno-ipa-cp -fno-tree-dce

jamborm at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Jan 23 15:28:00 GMT 2020


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

--- Comment #14 from Martin Jambor <jamborm at gcc dot gnu.org> ---
Another option, which does not create an inter-pass dependency and
does not clutter tree-inline any more, but which pessimizes IPA-SRA
(put perhaps just alittle bit?), is making sure that the statements
which might be left behind are harmless:

diff --git a/gcc/ipa-sra.c b/gcc/ipa-sra.c
index 31de527d111..df54b98759c 100644
--- a/gcc/ipa-sra.c
+++ b/gcc/ipa-sra.c
@@ -859,7 +859,8 @@ isra_track_scalar_value_uses (cgraph_node *node, tree name,
int parm_num,
            }
          res += all_uses;
        }
-      else if ((is_gimple_assign (stmt) && !gimple_has_volatile_ops (stmt))
+      else if ((is_gimple_assign (stmt) && !gimple_has_volatile_ops (stmt)
+               && !gimple_could_trap_p (stmt))
               || gimple_code (stmt) == GIMPLE_PHI)
        {
          tree lhs;

I'll see what a tree-inline.c solution would look like and then decide
which of these I'll propose.


More information about the Gcc-bugs mailing list