From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 8892B385DC1B; Fri, 17 Apr 2020 08:09:58 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8892B385DC1B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1587110998; bh=EC53ReEx2rjHJWe4nEctptMH4jv/4oNvtZivLoX88b8=; h=From:To:Subject:Date:In-Reply-To:References:From; b=n/Z8l3LpomH5ouJm9m+vNSh0CabaEq0HD+FJNI4+EWMisSwmKK9QxtkEb7GrWQ3cQ PttoZUawb/a2pDerAzyU7qiqwZOgNAHwJPi8sTiDvgd+5Xagv1UVlNAO+4HSx0Cczb i/XywGQpXwqsroBqXZX1DhrVYXoFUJSv8rUMM5JE= From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/94631] Wrong codegen for arithmetic on bitfields Date: Fri, 17 Apr 2020 08:09:58 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Version: unknown X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: INVALID 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: Message-ID: In-Reply-To: References: 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Apr 2020 08:09:58 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D94631 --- Comment #4 from Richard Biener --- (In reply to Andrew Pinski from comment #3) > (In reply to Rich Felker from comment #2) > > So basically the outcome of DR120 was allowing the GCC behavior? It sti= ll > > seems like a bad thing, not required, and likely to produce exploitable= bugs > > (due to truncation of arithmetic) as well as very poor-performance code= (due > > to constant masking). >=20 > Note this only matters when the size of the bit-field is less than the si= ze > of int. bigger than the size of int (due to default integer promotions still applyi= ng).=