Allow CAST_RESTRICT folding
authorTom de Vries <tom@codesourcery.com>
Thu, 29 Oct 2015 16:12:52 +0000 (16:12 +0000)
committerTom de Vries <vries@gcc.gnu.org>
Thu, 29 Oct 2015 16:12:52 +0000 (16:12 +0000)
2015-10-29  Tom de Vries  <tom@codesourcery.com>

* fold-const.c (fold_unary_loc): Remove folding inhibition for restrict
types.

From-SVN: r229537

gcc/ChangeLog
gcc/fold-const.c

index 8229fa39c88fc909fb5849ba13d7bc2c337218ef..2d42512389cd247945cbedf3b184f23fac6f79b1 100644 (file)
@@ -1,3 +1,8 @@
+2015-10-29  Tom de Vries  <tom@codesourcery.com>
+
+       * fold-const.c (fold_unary_loc): Remove folding inhibition for restrict
+       types.
+
 2015-10-29  Nathan Sidwell  <nathan@codesourcery.com>
 
        * omp-low.c (lower_omp_target): Remove unreachable code & merge
index 26fd735339991190d93b9beaea3be9854f410d1d..47ed60923f87568fcbd4e2f17f294452e1ce1e5a 100644 (file)
@@ -7770,7 +7770,6 @@ fold_unary_loc (location_t loc, enum tree_code code, tree type, tree op0)
         that this happens when X or Y is NOP_EXPR or Y is INTEGER_CST. */
       if (POINTER_TYPE_P (type)
          && TREE_CODE (arg0) == POINTER_PLUS_EXPR
-         && (!TYPE_RESTRICT (type) || TYPE_RESTRICT (TREE_TYPE (arg0)))
          && (TREE_CODE (TREE_OPERAND (arg0, 1)) == INTEGER_CST
              || TREE_CODE (TREE_OPERAND (arg0, 0)) == NOP_EXPR
              || TREE_CODE (TREE_OPERAND (arg0, 1)) == NOP_EXPR))