re PR rtl-optimization/69291 (wrong code at -O1 for ruby-2.3.0/regcomp.c:985:compile_...
authorRichard Biener <rguenther@suse.de>
Thu, 11 Feb 2016 08:11:52 +0000 (08:11 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Thu, 11 Feb 2016 08:11:52 +0000 (08:11 +0000)
2016-02-11  Richard Biener  <rguenther@suse.de>

PR rtl-optimization/69291
* ifcvt.c (noce_try_store_flag_constants): Do not allow
subexpressions affected by changing the result.

From-SVN: r233316

gcc/ChangeLog
gcc/ifcvt.c

index b4495d868c2f02471ba3e1dbf28fa6e137e2ff63..6037782465c16303a8dc96f3fa68fbed4095d80b 100644 (file)
@@ -1,3 +1,9 @@
+2016-02-11  Richard Biener  <rguenther@suse.de>
+
+       PR rtl-optimization/69291
+       * ifcvt.c (noce_try_store_flag_constants): Do not allow
+       subexpressions affected by changing the result.
+
 2016-02-10  Vladimir Makarov  <vmakarov@redhat.com>
 
        PR target/69148
index a50e33dc66ccc194d39bd5662df8fb25e976a424..205590938a5e434abdc85048367dd541d1d66f2d 100644 (file)
@@ -1274,7 +1274,10 @@ noce_try_store_flag_constants (struct noce_if_info *if_info)
       && CONST_INT_P (XEXP (a, 1))
       && CONST_INT_P (XEXP (b, 1))
       && rtx_equal_p (XEXP (a, 0), XEXP (b, 0))
-      && noce_operand_ok (XEXP (a, 0))
+      /* Allow expressions that are not using the result or plain
+         registers where we handle overlap below.  */
+      && (REG_P (XEXP (a, 0))
+         || ! reg_overlap_mentioned_p (if_info->x, XEXP (a, 0)))
       && if_info->branch_cost >= 2)
     {
       common = XEXP (a, 0);