From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26763 invoked by alias); 17 Jul 2013 21:17:53 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 26736 invoked by uid 89); 17 Jul 2013 21:17:53 -0000 X-Spam-SWARE-Status: No, score=-3.0 required=5.0 tests=AWL,BAYES_50,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL,RDNS_NONE autolearn=no version=3.3.1 Received: from Unknown (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Wed, 17 Jul 2013 21:17:51 +0000 Received: from svr-orw-fem-01.mgc.mentorg.com ([147.34.98.93]) by relay1.mentorg.com with esmtp id 1UzZ6W-00026d-2D from joseph_myers@mentor.com ; Wed, 17 Jul 2013 14:17:44 -0700 Received: from SVR-IES-FEM-01.mgc.mentorg.com ([137.202.0.104]) by svr-orw-fem-01.mgc.mentorg.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Wed, 17 Jul 2013 14:17:43 -0700 Received: from digraph.polyomino.org.uk (137.202.0.76) by SVR-IES-FEM-01.mgc.mentorg.com (137.202.0.104) with Microsoft SMTP Server id 14.2.247.3; Wed, 17 Jul 2013 22:17:42 +0100 Received: from jsm28 (helo=localhost) by digraph.polyomino.org.uk with local-esmtp (Exim 4.76) (envelope-from ) id 1UzZ6S-0000lO-M0; Wed, 17 Jul 2013 21:17:40 +0000 Date: Wed, 17 Jul 2013 21:19:00 -0000 From: "Joseph S. Myers" To: Zoran Jovanovic CC: "gcc-patches@gcc.gnu.org" , Petar Jovanovic Subject: Re: [PATCH] Add a new option "-ftree-bitfield-merge" (patch / doc inside) In-Reply-To: <386B40EC5E8DBF459FD11A754D868AD922E31112@BADAG02.ba.imgtec.org> Message-ID: References: <386B40EC5E8DBF459FD11A754D868AD922E31112@BADAG02.ba.imgtec.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="-1152306461-205008349-1374095860=:29715" X-Virus-Found: No X-SW-Source: 2013-07/txt/msg00674.txt.bz2 ---1152306461-205008349-1374095860=:29715 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: QUOTED-PRINTABLE Content-length: 1651 On Wed, 17 Jul 2013, Zoran Jovanovic wrote: > This patch adds new optimization pass that combines several adjacent bit= =20 > field accesses that copy values from one memory location to another into= =20 > single bit field access. Could you clarify if this works correctly in the presence of unions? That= =20 is, if the sequence of bit-fields being read from overlaps with the=20 sequence written to (but no individual store involves a write overlapping=20 with a read), whether because they are in the same structure or because=20 they are in structures appropriately overlaid with unions, the semantics=20 of the sequence of loads and stores is preserved (which may not be the=20 same as a simple copy)? There should be comprehensive testcases added to=20 the testsuite covering different variations on this issue. > +Enable bit field merge on trees "bit-field", see codingconventions.html (this applies to both --help text=20 and Texinfo documentation). > + =A0 Copyright (C) 2004, 2005, 2007, 2008, 2009, 2010, 2011 > + =A0 Free Software Foundation, Inc. -2013 (all on one line). > +tree > +field_type (const_tree decl); > + > +bool > +expressions_equal_p (tree e1, tree e2); > + > +HOST_WIDE_INT > +field_byte_offset (const_tree decl); > + > +unsigned HOST_WIDE_INT > +simple_type_size_in_bits (const_tree type); Never include such non-static declarations in a .c file; include the=20 appropriate header for the declarations instead. Try to use static=20 forward declarations only if needed because of recursion (otherwise=20 topologically sort the functions in the source file). --=20 Joseph S. Myers joseph@codesourcery.com= ---1152306461-205008349-1374095860=:29715--