From patchwork Wed Sep 19 10:08:25 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Jansa X-Patchwork-Id: 29464 Received: (qmail 39263 invoked by alias); 19 Sep 2018 10:08:34 -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 39135 invoked by uid 89); 19 Sep 2018 10:08:33 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, FREEMAIL_FROM, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mail-wm1-f66.google.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=DV6i+Itp901f0SS+BgE/LmDbPMpOEv3AcwjGewP/gwk=; b=TwaF6edCIBTkBHG4yM7cFA5DkZbHxIi/9uF32yZ1jT1trtTGGyyStbLAzU9Grp2OFh Fs2rb/CYQuiIcLbPYpUdC4dmVm9xlLb2mULdhFZZDX5YZrE7lbGbGuZXAlyEoA//BUto mbOh1BInxYGx0pUSiZxbgwWL3lBr6Zi6axgDJtqdnZT17FM8TfeXzeew6xmMqLsVM+pV 5mZMSftBL8nstxVdtgwt/O4R9aJPjjRf9Vx+gA+oofQDKoFQVNeLmrj37xbEOzoLYNX8 BNCtdVlb5xIWaTbyYS++CyghYLs71EQ2cwGRJo3P8p9wgHVf3G4nHFre9FplgrM3IOCZ 63uw== Return-Path: From: Martin Jansa To: libc-alpha@sourceware.org Cc: Martin Jansa Subject: [PATCH 2/2] soft-fp: ignore maybe-uninitialized Date: Wed, 19 Sep 2018 10:08:25 +0000 Message-Id: <20180919100825.22999-2-Martin.Jansa@gmail.com> In-Reply-To: <20180919100825.22999-1-Martin.Jansa@gmail.com> References: <20180919100825.22999-1-Martin.Jansa@gmail.com> * with -O it fails with: In file included from ../soft-fp/soft-fp.h:318, from ../sysdeps/ieee754/soft-fp/s_fdiv.c:28: ../sysdeps/ieee754/soft-fp/s_fdiv.c: In function '__fdiv': ../soft-fp/op-2.h:98:25: error: 'R_f1' may be used uninitialized in this function [-Werror=maybe-uninitialized] X##_f0 = (X##_f1 << (_FP_W_TYPE_SIZE - (N)) | X##_f0 >> (N) \ ^~ ../sysdeps/ieee754/soft-fp/s_fdiv.c:38:14: note: 'R_f1' was declared here FP_DECL_D (R); ^ ../soft-fp/op-2.h:37:36: note: in definition of macro '_FP_FRAC_DECL_2' _FP_W_TYPE X##_f0 _FP_ZERO_INIT, X##_f1 _FP_ZERO_INIT ^ ../soft-fp/double.h:95:24: note: in expansion of macro '_FP_DECL' # define FP_DECL_D(X) _FP_DECL (2, X) ^~~~~~~~ ../sysdeps/ieee754/soft-fp/s_fdiv.c:38:3: note: in expansion of macro 'FP_DECL_D' FP_DECL_D (R); ^~~~~~~~~ ../soft-fp/op-2.h:101:17: error: 'R_f0' may be used uninitialized in this function [-Werror=maybe-uninitialized] : (X##_f0 << (_FP_W_TYPE_SIZE - (N))) != 0)); \ ^~ ../sysdeps/ieee754/soft-fp/s_fdiv.c:38:14: note: 'R_f0' was declared here FP_DECL_D (R); ^ ../soft-fp/op-2.h:37:14: note: in definition of macro '_FP_FRAC_DECL_2' _FP_W_TYPE X##_f0 _FP_ZERO_INIT, X##_f1 _FP_ZERO_INIT ^ ../soft-fp/double.h:95:24: note: in expansion of macro '_FP_DECL' # define FP_DECL_D(X) _FP_DECL (2, X) ^~~~~~~~ ../sysdeps/ieee754/soft-fp/s_fdiv.c:38:3: note: in expansion of macro 'FP_DECL_D' FP_DECL_D (R); ^~~~~~~~~ Signed-off-by: Martin Jansa --- soft-fp/op-2.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/soft-fp/op-2.h b/soft-fp/op-2.h index 6020d663d4..6672337949 100644 --- a/soft-fp/op-2.h +++ b/soft-fp/op-2.h @@ -92,6 +92,8 @@ X##_f1 = 0; \ })) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wmaybe-uninitialized" #define _FP_FRAC_SRS_2(X, N, sz) \ (void) (((N) < _FP_W_TYPE_SIZE) \ ? ({ \ @@ -109,6 +111,7 @@ | X##_f0) != 0)); \ X##_f1 = 0; \ })) +#pragma GCC diagnostic pop #define _FP_FRAC_ADDI_2(X, I) \ __FP_FRAC_ADDI_2 (X##_f1, X##_f0, I)