From owner-freebsd-bugs@freebsd.org Sat Jul 23 00:53:20 2016 Return-Path: Delivered-To: freebsd-bugs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1A721BA28E2 for ; Sat, 23 Jul 2016 00:53:20 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 00F031226 for ; Sat, 23 Jul 2016 00:53:20 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id u6N0rJPg089618 for ; Sat, 23 Jul 2016 00:53:19 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-bugs@FreeBSD.org Subject: [Bug 211304] 11.0 -r303168 buildkernel via devel/amd64-gcc fails for: dev/cxgbe/common/t4_hw.c warning: overflow in implicit constant conversion; more Date: Sat, 23 Jul 2016 00:53:20 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 11.0-STABLE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: markmi@dsl-only.net X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Jul 2016 00:53:20 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D211304 --- Comment #3 from Mark Millard --- (In reply to Mark Millard from comment #0) The code in question for the overflow in an implicit constant conversion is for: c.err_to_clearinit =3D cpu_to_be32( V_FW_HELLO_CMD_MASTERDIS(master =3D=3D MASTER_CANT) | V_FW_HELLO_CMD_MASTERFORCE(master =3D=3D MASTER_MUST) | V_FW_HELLO_CMD_MBMASTER(master =3D=3D MASTER_MUST ? mbox : M_FW_HELLO_CMD_MBMASTER) | V_FW_HELLO_CMD_MBASYNCNOT(evt_mbox) | V_FW_HELLO_CMD_STAGE(FW_HELLO_CMD_STAGE_OS) | F_FW_HELLO_CMD_CLEARINIT); V_FW_HELLO_CMD_MASTERDIS uses S_FW_HELLO_CMD_MASTERDIS: # grep V_FW_HELLO_CMD_MASTERDIS /usr/src/sys/modules/cxgbe/if_cxgbe/../../../dev/cxgbe/*/* /usr/src/sys/modules/cxgbe/if_cxgbe/../../../dev/cxgbe/common/t4_hw.c:=20= =20=20=20=20=20=20=20=20 V_FW_HELLO_CMD_MASTERDIS(master =3D=3D MASTER_CANT) | /usr/src/sys/modules/cxgbe/if_cxgbe/../../../dev/cxgbe/firmware/t4fw_interf= ace.h:#define V_FW_HELLO_CMD_MASTERDIS(x) ((x) << S_FW_HELLO_CMD_MASTERDIS) /usr/src/sys/modules/cxgbe/if_cxgbe/../../../dev/cxgbe/firmware/t4fw_interf= ace.h:#define F_FW_HELLO_CMD_MASTERDIS V_FW_HELLO_CMD_MASTERDIS(1U) S_FW_HELLO_CMD_MASTERDIS is 29: # grep S_FW_HELLO_CMD_MASTERDIS /usr/src/sys/modules/cxgbe/if_cxgbe/../../../dev/cxgbe/*/* /usr/src/sys/modules/cxgbe/if_cxgbe/../../../dev/cxgbe/firmware/t4fw_interf= ace.h:#define S_FW_HELLO_CMD_MASTERDIS 29 /usr/src/sys/modules/cxgbe/if_cxgbe/../../../dev/cxgbe/firmware/t4fw_interf= ace.h:#define V_FW_HELLO_CMD_MASTERDIS(x) ((x) << S_FW_HELLO_CMD_MASTERDIS) /usr/src/sys/modules/cxgbe/if_cxgbe/../../../dev/cxgbe/firmware/t4fw_interf= ace.h: (((x) >> S_FW_HELLO_CMD_MASTERDIS) & M_FW_HELLO_CMD_MASTERDIS) S_FW_HELLO_CMD_MASTERDIS being 29 means that V_FW_HELLO_CMD_MASTERDIS(x)'s ((x) << S_FW_HELLO_CMD_MASTERDIS) is far more than 16 bits wide. (I'll not list the other example bits.) For: ./x86/endian.h:75:53: note: in definition of macro '__bswap16' __bswap16_gen((__uint16_t)(x)) : __bswap16_var(x))) ^ the __bswap16_var is (from x86/endian.h ): static __inline __uint16_t __bswap16_var(__uint16_t _x) { return (__bswap16_gen(_x)); } and so there is an implicit truncation to 16 bits before __bswap16_gen(_x) = and its & 0xffff masking is involved. And that is what the compiler is complain= ing about: the implicit status of the truncation. The truncated value appears to be fine for the code's purpose. --=20 You are receiving this mail because: You are the assignee for the bug.=