From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 913 invoked by alias); 4 Jan 2008 15:36:42 -0000 Received: (qmail 772 invoked by uid 48); 4 Jan 2008 15:35:59 -0000 Date: Fri, 04 Jan 2008 15:54:00 -0000 Message-ID: <20080104153559.771.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug tree-optimization/34043] Missed optimization causing extra loads and stores when using x86_64 builtin function together with aggregate types. In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "rguenth at gcc dot gnu dot org" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2008-01/txt/msg00359.txt.bz2 ------- Comment #10 from rguenth at gcc dot gnu dot org 2008-01-04 15:35 ------- We can 'abuse' PREs inserting of fake stores machinery to handle the case in PR33989, where for union a { int i; float f; }; void f (float *a, int *b) { union a c; c.f = *a; *b = c.i; } we then get (PRE) : # VUSE D.1549_2 = *a_1(D); # SFT.0_8 = VDEF # SFT.1_9 = VDEF c.f = D.1549_2; uniontmp.12_13 = VIEW_CONVERT_EXPR(D.1549_2); D.1550_3 = uniontmp.12_13; # SMT.7_11 = VDEF *b_4(D) = D.1550_3; return; and before expand: : # SMT.7_11 = VDEF *b = VIEW_CONVERT_EXPR(*a); return; and finally f: .LFB2: movl (%rdi), %eax movl %eax, (%rsi) ret but we need to make sure VN processes the inserted conversions (which do not have uses) and we need to enhance PREs poolification of trees to handle COMPONENT_REFs (and possibly more). -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34043