From nobody Wed Jul 13 03:33:44 2022 X-Original-To: toolchain@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 1B4DA1D0ED99 for ; Wed, 13 Jul 2022 03:33:45 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4LjNWX4scnz406F for ; Wed, 13 Jul 2022 03:33:44 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4LjNWX3wcrz180v for ; Wed, 13 Jul 2022 03:33:44 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 26D3Xil0093354 for ; Wed, 13 Jul 2022 03:33:44 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 26D3Xi9R093353 for toolchain@FreeBSD.org; Wed, 13 Jul 2022 03:33:44 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: toolchain@FreeBSD.org Subject: [Bug 265181] Strange C++ error on armv6: it can't implicitly convert integer to float Date: Wed, 13 Jul 2022 03:33:44 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: misc X-Bugzilla-Version: 13.0-RELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: marklmi26-fbsd@yahoo.com X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: toolchain@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc 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 List-Id: Maintenance of FreeBSD s integrated toolchain List-Archive: https://lists.freebsd.org/archives/freebsd-toolchain List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-toolchain@freebsd.org X-BeenThere: freebsd-toolchain@freebsd.org MIME-Version: 1.0 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1657683224; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=l6PwzzZjWB8hr0O7YfnNe8l11GbBBcY1ADwV/PNV4LI=; b=EfAKHv5JVY+nodt2oOYr7aLa0j5J/7vNXfImZYcRxvjChAtZMQEGLbhrIGoJt8w0a3/j1u 3XprBAy8Ge/EEqg2Pz/HtKp6bG19Gl6N5yrk6p5O2iQNWCjNC1uZrkCeG+Du3K+RJAIl/6 5myr65HJQk1p5xKybCMwUCxI9D6B3wnFMOdZUH5xDDQxD3eEVyac0iAkHYuzA4eTM40WxK XXVRuC9YxlvLGpHWjy9PjU4i9i9Ro+qXBkOIm84SdR/YRXr0d90fgIdGgd2+3XOdKy1EZJ WvkNJEW/Cg9z2SEQ/HNG3C71EQcdqiAUJNrtABOldciFq9P06feMkqj/BsEhkw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1657683224; a=rsa-sha256; cv=none; b=Jk4fpU2j4ayHZZ/B1q8MBnu5U+1vb+ZgjLuUaX7GnfWb2ISlgwtUl9H8vcrTpsQBdNduwj iIhvVDCnJcgHZi26vTrfDKAoCXpo8h2tnpxKl8SoYkL0uFc+WlvFDKbyuQ41ZvTPbFsw9U h2hamkq8L+RBl0uJeqpaWjJmURmIb2y4Q8INbcN4Hoql6/GZi3kkAXNLu5VLJvJoTrrzMi FKOu0AjnSpnJDu8oEHEMjBlArZsm8UgQmkVLC3sXO8rc9DF1wbFHqmqBeCEQUD4a92UyX8 CpcILj5y+2jI20pgRqHhzc8JW2fZ8tVRGiZZJHjjQRlFstYV+Tc7964kQjEhow== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D265181 Mark Millard changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |marklmi26-fbsd@yahoo.com --- Comment #1 from Mark Millard --- (In reply to Yuri Victorovich from comment #0) The port does a patch that involves: @@ -983,7 +991,7 @@ char *Alsa_pcmi::play_floatre (const float *src, char while (nfrm--) { d =3D *src; - *((float *) dst) =3D __bswap_32 (d); + *((float *) dst) =3D bswap_32 (d); dst +=3D _play_step; src +=3D step; } @@ -1105,7 +1113,7 @@ const char *Alsa_pcmi::capt_floatre (const char *src, while (nfrm--) { d =3D *((float *) src); - *dst =3D __bswap_32 (d); + *dst =3D bswap_32 (d); dst +=3D step; src +=3D _capt_step; } I'll use Alsa_pcmi::play_floatre as the example to carry my points. The complaint is about (after expansion but with some text replaced by "MORE_NOT_SHOWN"): *((float *) dst) =3D ((((d) & 0xff000000U) >> 24) | MORE_NOT_SHOWN via: zita-alsa-pcmi.cc:994:28: error: invalid operands to binary expression ('fl= oat' and 'unsigned int') *((float *) dst) =3D bswap_32 (d); ^~~~~~~~~~~~ /usr/include/infiniband/byteswap.h:39:25: note: expanded from macro 'bswap_= 32' #define bswap_32 bswap32 ^ /usr/include/sys/endian.h:62:20: note: expanded from macro 'bswap32' #define bswap32(x) __bswap32(x) ^~~~~~~~~~~~ /usr/include/machine/endian.h:134:6: note: expanded from macro '__bswap32' __bswap32_constant(x) : \ ^~~~~~~~~~~~~~~~~~~~~ /usr/include/machine/endian.h:118:12: note: expanded from macro '__bswap32_constant' ((((x) & 0xff000000U) >> 24) | \ ~~~ ^ ~~~~~~~~~~~ But the original unpatched code is (note the type of d): char *Alsa_pcmi::play_floatre (const float *src, char *dst, int nfrm, int s= tep) { float d; while (nfrm--) { d =3D *src; *((float *) dst) =3D __bswap_32 (d); dst +=3D _play_step; src +=3D step; } return dst; } So the end result after patching and expanding looks like: char *Alsa_pcmi::play_floatre (const float *src, char *dst, int nfrm, int s= tep) { float d; while (nfrm--) { d =3D *src; *((float *) dst) =3D ((((d) & 0xff000000U) >> 24) | MORE_NOT_SHOWN; dst +=3D _play_step; src +=3D step; } return dst; } So d is if type float. So (d) is of type float. So (d) & 0xff000000U has & taking a mix of float on the left and unsigned int on the right. This is what the complaint is about. This is not an example of integer converting to float. For & the language rules are: QUOTE The operands shall be of integral or unscoped enumeration type. The usual arithmetic conversions (7.4) are performed. END QUOTE The rule in 7.4 relative to float is: QUOTE (after scoped enumeration, long double, and double for "either operan= d"): Otherwise, if either operand is float, the other shall be converted to floa= t. END QUOTE Thus (d) & 0xff000000U turns into: (d) & static_cast(0xff000000U) And then neither operand is an "integral or unscoped enumeration type". Thus the reported error. Looks like a correct message to me. --=20 You are receiving this mail because: You are the assignee for the bug.=