From patchwork Tue Oct 4 21:06:54 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 117694 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 91E241007D1 for ; Wed, 5 Oct 2011 08:07:10 +1100 (EST) Received: (qmail 21558 invoked by alias); 4 Oct 2011 21:07:08 -0000 Received: (qmail 21550 invoked by uid 22791); 4 Oct 2011 21:07:08 -0000 X-SWARE-Spam-Status: No, hits=-6.6 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 04 Oct 2011 21:06:55 +0000 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p94L6tkT001598 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 4 Oct 2011 17:06:55 -0400 Received: from anchor.twiddle.net (vpn-235-162.phx2.redhat.com [10.3.235.162]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p94L6sdA012834 for ; Tue, 4 Oct 2011 17:06:54 -0400 Message-ID: <4E8B756E.8080909@redhat.com> Date: Tue, 04 Oct 2011 14:06:54 -0700 From: Richard Henderson User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:6.0.2) Gecko/20110906 Thunderbird/6.0.2 MIME-Version: 1.0 To: GCC Patches Subject: vect_shuffle fixups: c parser X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Most three-argument tests failed due, in part, to the two_arguments variable being uninitialized. Committed. r~ * c-typeck.c (c_build_vec_shuffle_expr): Fix uninitialized variable. Avoid save_expr unless two_arguments. diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c index 96ef4a3..e7528a7 100644 --- a/gcc/c-typeck.c +++ b/gcc/c-typeck.c @@ -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;