c-typeck.c (c_build_vec_shuffle_expr): Fix uninitialized variable.
authorRichard Henderson <rth@redhat.com>
Tue, 4 Oct 2011 21:04:10 +0000 (14:04 -0700)
committerRichard Henderson <rth@gcc.gnu.org>
Tue, 4 Oct 2011 21:04:10 +0000 (14:04 -0700)
* c-typeck.c (c_build_vec_shuffle_expr): Fix uninitialized variable.
Avoid save_expr unless two_arguments.

From-SVN: r179525

gcc/ChangeLog
gcc/c-typeck.c

index a4c29fb..9e3f1a7 100644 (file)
@@ -1,3 +1,8 @@
+2011-10-04  Richard Henderson  <rth@redhat.com>
+
+       * c-typeck.c (c_build_vec_shuffle_expr): Fix uninitialized variable.
+       Avoid save_expr unless two_arguments.
+
 2011-10-04  Ozkan Sezer  <sezeroz@gmail.com>
 
        * config/i386/mingw-w64.h (CPP_SPEC): Rename _REENTRANCE to
index 96ef4a3..e7528a7 100644 (file)
@@ -2859,10 +2859,10 @@ build_function_call_vec (location_t loc, tree function, VEC(tree,gc) *params,
 tree
 c_build_vec_shuffle_expr (location_t loc, tree v0, tree v1, tree mask)
 {
-  tree vec_shuffle, tmp;
+  tree vec_shuffle;
   bool wrap = true;
   bool maybe_const = false;
-  bool two_arguments;
+  bool two_arguments = false;
 
   if (v1 == NULL_TREE)
     {
@@ -2916,17 +2916,16 @@ c_build_vec_shuffle_expr (location_t loc, tree v0, tree v1, tree mask)
     }
 
   /* Avoid C_MAYBE_CONST_EXPRs inside VEC_SHUFFLE_EXPR.  */
-  tmp = c_fully_fold (v0, false, &maybe_const);
-  v0 = save_expr (tmp);
+  v0 = c_fully_fold (v0, false, &maybe_const);
   wrap &= maybe_const;
 
-  if (!two_arguments)
+  if (two_arguments)
+    v1 = v0 = save_expr (v0);
+  else
     {
       v1 = c_fully_fold (v1, false, &maybe_const);
       wrap &= maybe_const;
     }
-  else
-    v1 = v0;
 
   mask = c_fully_fold (mask, false, &maybe_const);
   wrap &= maybe_const;