OSDN Git Service

PR 49214 fd_gets should return NULL if nothing was read
[pf3gnuchains/gcc-fork.git] / gcc / tree-ssa-ccp.c
index 4775a2a..2caec4c 100644 (file)
@@ -1702,7 +1702,6 @@ ccp_fold_stmt (gimple_stmt_iterator *gsi)
        tree lhs = gimple_call_lhs (stmt);
        tree val;
        tree argt;
-       tree callee;
        bool changed = false;
        unsigned i;
 
@@ -1723,6 +1722,11 @@ ccp_fold_stmt (gimple_stmt_iterator *gsi)
            return true;
          }
 
+       /* Internal calls provide no argument types, so the extra laxity
+          for normal calls does not apply.  */
+       if (gimple_call_internal_p (stmt))
+         return false;
+
        /* Propagate into the call arguments.  Compared to replace_uses_in
           this can use the argument slot types for type verification
           instead of the current argument type.  We also can safely
@@ -1743,17 +1747,6 @@ ccp_fold_stmt (gimple_stmt_iterator *gsi)
              }
          }
 
-       callee = gimple_call_fn (stmt);
-       if (TREE_CODE (callee) == OBJ_TYPE_REF
-           && TREE_CODE (OBJ_TYPE_REF_EXPR (callee)) == SSA_NAME)
-         {
-           tree expr = OBJ_TYPE_REF_EXPR (callee);
-           OBJ_TYPE_REF_EXPR (callee) = valueize_op (expr);
-           if (gimple_fold_call (gsi, false))
-             changed = true;
-           OBJ_TYPE_REF_EXPR (callee) = expr;
-         }
-
        return changed;
       }