From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30377 invoked by alias); 18 Mar 2004 18:23:08 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 30314 invoked from network); 18 Mar 2004 18:23:07 -0000 Received: from unknown (HELO mail.libertysurf.net) (213.36.80.91) by sources.redhat.com with SMTP; 18 Mar 2004 18:23:07 -0000 Received: from localhost.localdomain (213.36.134.117) by mail.libertysurf.net (6.5.036) id 4059CC450003D068; Thu, 18 Mar 2004 19:23:05 +0100 From: Eric Botcazou To: Mark Mitchell Subject: Re: GCC Status Report (2004-03-09) Date: Thu, 18 Mar 2004 18:31:00 -0000 User-Agent: KMail/1.4.3 Cc: gcc@gcc.gnu.org, gcc-patches@gcc.gnu.org References: <200403091809.i29I9P04020607@sirius.codesourcery.com> <405874AD.2010709@codesourcery.com> <200403180924.19533.ebotcazou@libertysurf.fr> In-Reply-To: <200403180924.19533.ebotcazou@libertysurf.fr> MIME-Version: 1.0 Message-Id: <200403181927.00513.ebotcazou@libertysurf.fr> Content-Type: Multipart/Mixed; boundary="------------Boundary-00=_LEBSMD5S4F428ZZZ2IJE" X-SW-Source: 2004-03/txt/msg01072.txt.bz2 --------------Boundary-00=_LEBSMD5S4F428ZZZ2IJE Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit Content-length: 805 > 2004-03-18 Eric Botcazou > Mark Mitchell > > PR optimization/13424 > * expr.c (store_constructor): Emit a blockage after clearing the > aggregate because of an incomplete or mostly zero constructor. Well, this pessimizes way too much. We can emit the blockage only in the unsafe cases: 2004-03-18 Eric Botcazou Mark Mitchell PR optimization/13424 * expr.c (store_constructor): Emit a blockage after clearing the aggregate because of an incomplete or mostly zero constructor if the aggregate contains read-only fields. But this would still pessimize a lot, because life analysis would not be able to delete the redundant writes anymore. -- Eric Botcazou --------------Boundary-00=_LEBSMD5S4F428ZZZ2IJE Content-Type: text/x-diff; charset="iso-8859-1"; name="pr13424-3.diff" Content-Transfer-Encoding: 8bit Content-Disposition: attachment; filename="pr13424-3.diff" Content-length: 1463 Index: expr.c =================================================================== RCS file: /cvs/gcc/gcc/gcc/expr.c,v retrieving revision 1.615.4.9 diff -u -p -r1.615.4.9 expr.c --- expr.c 13 Mar 2004 18:26:23 -0000 1.615.4.9 +++ expr.c 18 Mar 2004 18:14:18 -0000 @@ -4551,8 +4551,9 @@ store_constructor (tree exp, rtx target, == size))) { rtx xtarget = target; + bool partly_readonly_p = readonly_fields_p (type); - if (readonly_fields_p (type)) + if (partly_readonly_p) { xtarget = copy_rtx (xtarget); RTX_UNCHANGING_P (xtarget) = 1; @@ -4560,6 +4561,19 @@ store_constructor (tree exp, rtx target, clear_storage (xtarget, GEN_INT (size)); cleared = 1; + + /* ??? Emit a blockage to prevent the scheduler from swapping the + memory write issued just above and the memory write that may be + issued below to initialize each field. This is needed for a + read-write field because the former write may carry the /u + flag and not the latter, so they will not conflict. Note that + the clearing cannot be simply disabled in the unsafe cases + because the C front-end relies on it to implement the semantics + of constructors for automatic objects. + However, not all machine descriptions define a blockage insn, + so emit an ASM_INPUT to act as one.  */ + if (partly_readonly_p) + emit_insn (gen_rtx_ASM_INPUT (VOIDmode, "")); } if (! cleared) --------------Boundary-00=_LEBSMD5S4F428ZZZ2IJE--