]> gcc.gnu.org Git - gcc.git/commitdiff
re PR rtl-optimization/42522 ((zero_extract:SI (mem:QI) ...) misoptimized)
authorJeff Law <law@redhat.com>
Wed, 15 Apr 2015 12:24:28 +0000 (06:24 -0600)
committerJeff Law <law@gcc.gnu.org>
Wed, 15 Apr 2015 12:24:28 +0000 (06:24 -0600)
        PR rtl-optimization/42522
        * cse.c (fold_rtx): Try to simplify a ZERO_EXTRACT or
        SIGN_EXTRACT as a whole object rather than simplifying
        its operand.

From-SVN: r222125

gcc/ChangeLog
gcc/cse.c

index f1a96f270b5d1354212881a3aef9b0f3838fd6db..a0f2fe7e2b9b75d7c46c04f0851e1e0e9842b6f4 100644 (file)
@@ -1,3 +1,10 @@
+2015-04-15  Jeff Law  <law@redhat.com>
+
+       PR rtl-optimization/42522
+       * cse.c (fold_rtx): Try to simplify a ZERO_EXTRACT or
+       SIGN_EXTRACT as a whole object rather than simplifying
+       its operand.
+
 2015-04-15  Jakub Jelinek  <jakub@redhat.com>
 
        PR ipa/65765
index 2a33827a61c9f3d28afde01296c1161b3463805a..d7638f051f337818dad1c5ab2e1adba2847bf3ed 100644 (file)
--- a/gcc/cse.c
+++ b/gcc/cse.c
@@ -3150,6 +3150,15 @@ fold_rtx (rtx x, rtx_insn *insn)
     {
     case MEM:
     case SUBREG:
+    /* The first operand of a SIGN/ZERO_EXTRACT has a different meaning
+       than it would in other contexts.  Basically its mode does not
+       signify the size of the object read.  That information is carried
+       by size operand.    If we happen to have a MEM of the appropriate
+       mode in our tables with a constant value we could simplify the
+       extraction incorrectly if we allowed substitution of that value
+       for the MEM.   */
+    case ZERO_EXTRACT:
+    case SIGN_EXTRACT:
       if ((new_rtx = equiv_constant (x)) != NULL_RTX)
         return new_rtx;
       return x;
This page took 0.078574 seconds and 5 git commands to generate.