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

--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Like:
--- gcc/expmed.c.jj     2018-08-26 22:42:22.526779583 +0200
+++ gcc/expmed.c        2018-08-29 14:04:32.669509929 +0200
@@ -6239,7 +6239,9 @@ canonicalize_comparison (machine_mode mo
      wrapping around in the case of unsigned values.  If any occur
      cancel the optimization.  */
   wi::overflow_type overflow = wi::OVF_NONE;
-  wide_int imm_modif = wi::add (imm_val, to_add, sgn, &overflow);
+  wide_int imm_modif
+    = (to_add > 0 ? wi::add (imm_val, 1, sgn, &overflow)
+                 : wi::sub (imm_val, 1, sgn, &overflow));
   if (overflow)
     return;

If so, please submit it as soon as possible, leaving such important wrong-code
bug for so long is highly undesirable.

Reply via email to