From patchwork Mon Aug 24 13:48:48 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wilco Dijkstra X-Patchwork-Id: 8401 Received: (qmail 32439 invoked by alias); 24 Aug 2015 13:49:07 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 32419 invoked by uid 89); 24 Aug 2015 13:49:05 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL, BAYES_00, SPF_PASS autolearn=ham version=3.3.2 X-HELO: eu-smtp-delivery-143.mimecast.com From: "Wilco Dijkstra" To: "'GNU C Library'" Subject: [COMMITTED][AArch64] Avoid spurious uninitialized warning Date: Mon, 24 Aug 2015 14:48:48 +0100 Message-ID: <000501d0de73$9a9bc710$cfd35530$@com> MIME-Version: 1.0 X-MC-Unique: liBa25JCTZmGNAVZyDbvGQ-1 This patch works around a spurious uninitialized warning in libc_resetround_aarch64_ctx and libc_resetround_noex_aarch64_ctx. Resulting code is either identical or avoids a redundant move. Fixes GLIBC build failure on AArch64 and passes math tests. Committed as trivial patch. ChangeLog: 2015-08-24 Wilco Dijkstra * sysdeps/aarch64/fpu/math_private.h (libc_feholdsetround_aarch64_ctx): Unconditionally set __fpcr to avoid uninialized warning. (libc_feholdsetround_noex_aarch64_ctx): Likewise. --- sysdeps/aarch64/fpu/math_private.h | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/sysdeps/aarch64/fpu/math_private.h b/sysdeps/aarch64/fpu/math_private.h index 1f02ddb..43bef1a 100644 --- a/sysdeps/aarch64/fpu/math_private.h +++ b/sysdeps/aarch64/fpu/math_private.h @@ -252,6 +252,7 @@ libc_feholdsetround_aarch64_ctx (struct rm_ctx *ctx, int r) int round; _FPU_GETCW (fpcr); + ctx->env.__fpcr = fpcr; /* Check whether rounding modes are different. */ round = (fpcr ^ r) & _FPU_FPCR_RM_MASK; @@ -259,10 +260,7 @@ libc_feholdsetround_aarch64_ctx (struct rm_ctx *ctx, int r) /* Set the rounding mode if changed. */ if (__glibc_unlikely (round != 0)) - { - ctx->env.__fpcr = fpcr; - _FPU_SETCW (fpcr ^ round); - } + _FPU_SETCW (fpcr ^ round); } #define libc_feholdsetround_ctx libc_feholdsetround_aarch64_ctx @@ -290,6 +288,7 @@ libc_feholdsetround_noex_aarch64_ctx (struct rm_ctx *ctx, int r) _FPU_GETCW (fpcr); _FPU_GETFPSR (fpsr); + ctx->env.__fpcr = fpcr; ctx->env.__fpsr = fpsr; /* Check whether rounding modes are different. */ @@ -298,10 +297,7 @@ libc_feholdsetround_noex_aarch64_ctx (struct rm_ctx *ctx, int r) /* Set the rounding mode if changed. */ if (__glibc_unlikely (round != 0)) - { - ctx->env.__fpcr = fpcr; - _FPU_SETCW (fpcr ^ round); - } + _FPU_SETCW (fpcr ^ round); } #define libc_feholdsetround_noex_ctx libc_feholdsetround_noex_aarch64_ctx