]> gcc.gnu.org Git - gcc.git/commitdiff
fold-const (fold_unary_loc): New case.
authorEric Botcazou <ebotcazou@adacore.com>
Fri, 16 May 2014 16:59:38 +0000 (16:59 +0000)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Fri, 16 May 2014 16:59:38 +0000 (16:59 +0000)
* fold-const (fold_unary_loc) <NON_LVALUE_EXPR>: New case.
<CASE_CONVERT>: Pass arg0 instead of op0 to fold_convert_const.

From-SVN: r210518

gcc/ChangeLog
gcc/fold-const.c

index f2d0508336d2f4997338902fc4487d71f9dde042..e8960026d5d466b03e3b67b334ee1e69d229ab06 100644 (file)
@@ -1,3 +1,8 @@
+2014-05-16  Eric Botcazou  <ebotcazou@adacore.com>
+
+       * fold-const (fold_unary_loc) <NON_LVALUE_EXPR>: New case.
+       <CASE_CONVERT>: Pass arg0 instead of op0 to fold_convert_const.
+
 2014-05-16  Richard Biener  <rguenther@suse.de>
 
        PR tree-optimization/61194
index 8f659db76a210e9860416629cf2df7345800f456..188b179bb7876561f0185d721163855648357e0c 100644 (file)
@@ -7850,6 +7850,11 @@ fold_unary_loc (location_t loc, enum tree_code code, tree type, tree op0)
        return fold_convert_loc (loc, type, op0);
       return NULL_TREE;
 
+    case NON_LVALUE_EXPR:
+      if (!maybe_lvalue_p (op0))
+       return fold_convert_loc (loc, type, op0);
+      return NULL_TREE;
+
     CASE_CONVERT:
     case FLOAT_EXPR:
     case FIX_TRUNC_EXPR:
@@ -8113,7 +8118,7 @@ fold_unary_loc (location_t loc, enum tree_code code, tree type, tree op0)
            }
        }
 
-      tem = fold_convert_const (code, type, op0);
+      tem = fold_convert_const (code, type, arg0);
       return tem ? tem : NULL_TREE;
 
     case ADDR_SPACE_CONVERT_EXPR:
This page took 0.085883 seconds and 5 git commands to generate.