From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id CCAE3385B518; Fri, 5 May 2023 17:27:48 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CCAE3385B518 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1683307668; bh=Zterif5SfCWKZRPBqyfPpR2Ai55OTvqxK7ET0vOQnhQ=; h=From:To:Subject:Date:From; b=TNogOZyx6ZIWN9UvDQsFoV16oIqF90AE8VADWpHDQTPOkAlg0Ji/AzK1yr/bOC63Q zfL0o1LrcroRCXOZ+kR2q0zwT5iEM2qI5Q597dehcESK443p0mSWyq4smVCPPrTNid M8cl4STrcnP4PeowuSMqI+0CMQFkUa0a1R1PrSL4= From: "jim.gray at atos dot net" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/109750] New: Incorrect code generated for shifted bit field Date: Fri, 05 May 2023 17:27:48 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 9.4.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jim.gray at atos dot net X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D109750 Bug ID: 109750 Summary: Incorrect code generated for shifted bit field Product: gcc Version: 9.4.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: jim.gray at atos dot net Target Milestone: --- Created attachment 55008 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D55008&action=3Dedit Tar file with source, assembly listing, compile script, executable Attached is a simple program that shows the problem encountered. Bad output when compiling with GCC compiler on Ubuntu ~/gcc-bug$ ./gccbug Source =3D 000000020000 Target =3D 000000000200 Target =3D 1777777777760000000200 Good output when compiling with MS C++ compiler on Windows: >gccbug Source =3D 000000020000 Target =3D 000000000200 Target =3D 020000000200=