From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11953 invoked by alias); 13 May 2003 17:07:28 -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 11917 invoked from network); 13 May 2003 17:07:28 -0000 Received: from unknown (HELO lacrosse.corp.redhat.com) (66.187.233.200) by sources.redhat.com with SMTP; 13 May 2003 17:07:28 -0000 Received: from tornado.toronto.redhat.com (IDENT:kMeUOeKqgXK4DqcfvSAMKkACiTN83S4D@tornado.toronto.redhat.com [172.16.14.228]) by lacrosse.corp.redhat.com (8.11.6/8.9.3) with ESMTP id h4DH7OK20099; Tue, 13 May 2003 13:07:24 -0400 Received: from tornado.toronto.redhat.com (localhost [127.0.0.1]) by tornado.toronto.redhat.com (8.12.8/8.12.8) with ESMTP id h4DH7Nas007172; Tue, 13 May 2003 13:07:23 -0400 Received: (from dnovillo@localhost) by tornado.toronto.redhat.com (8.12.8/8.12.8/Submit) id h4DH7MGu007170; Tue, 13 May 2003 13:07:22 -0400 Date: Tue, 13 May 2003 17:07:00 -0000 From: Diego Novillo To: Zack Weinberg Cc: Michael Matz , "gcc@gcc.gnu.org" Subject: Re: Dead-code elimination can't remove string copy insns? Message-ID: <20030513170722.GA7112@tornado.toronto.redhat.com> References: <87el32om7e.fsf@egil.codesourcery.com> <1052843397.27232.380.camel@frodo.toronto.redhat.com> <871xz2ol4u.fsf@egil.codesourcery.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <871xz2ol4u.fsf@egil.codesourcery.com> User-Agent: Mutt/1.4.1i Organization: Red Hat Canada X-SW-Source: 2003-05/txt/msg01330.txt.bz2 On Tue, May 13, 2003 at 09:40:33AM -0700, Zack Weinberg wrote: > gcc.dg/const-elim-1.c. On an x86, compile it with -march=i386 -O2; > rs6000-ibm-aix5 and arm-elf also show the problem. > Yup, tree-ssa handles it. The original program in GIMPLE form is on the left. The optimized version is on the right (we still don't linearize GOTO_EXPRs). Diego. ----------------------------------------------------------------------------- ;; Function test1 (test1) ;; Function test1 (test1) test1 () test1 () { { int retval.6; int retval.6; int T.1; int T.1; char[37] * T.2; char[37] * T.2; char * T.3; char * T.3; const char * T.4; const char * T.4; struct S ; struct S ; struct S * T.5; struct S * T.5; { { { | int ; int ; < { | goto ;; { | :; = 23; < goto ; < } < }; < :;; < retval.6 = < }; < T.1 = retval.6; < if (T.1 == 23) < { < { < return; < } < } < }; }; T.2 = "waltz, nymph, for quick jigs | return;; T.3 = (char *)T.2; | (void)0 T.4 = (const char *)T.3; < use_str (T.4); < = {}; < .a = 12; < .b = {}; < .b[0] = 3.141500000000000181 < .b[1] = 2.182799999999999851 < .c = 0B; < T.5 = &; < use_S (T.5); < use_cplx (__complex__ (3.1415000000 < } } ;; Function test2 (test2) ;; Function test2 (test2) test2 () test2 () { { int retval.11; int retval.11; char[40] * T.7; char[40] * T.7; char * T.8; char * T.8; int T.9; int T.9; struct S * S.10; struct S * S.10; const char * str; const char * str; struct S S; struct S S; const complex double cplx; const complex double cplx; T.7 = "pack my box with five dozen < T.8 = (char *)T.7; < str = (const char *)T.8; < S = {}; < S.a = 23; < S.b = {}; < S.b[0] = 1.413999999999999923616655 < S.b[1] = 1.618000000000000104805053 < S.c = 0B; < cplx = __complex__ (1.4139999999999 < { { { | int ; int ; < { | goto ;; { | :; = 23; < goto ; < } < }; < :;; < retval.11 = < }; < T.9 = retval.11; < if (T.9 == 23) < { < { < return; < } < } < else < { < (void)0 < } < }; }; use_str (str); | return;; S.10 = &S; | (void)0 use_S (S.10); < use_cplx (__complex__ (1.4139999999 < } } ;; Function returns_23 (returns_23) ;; Function returns_23 (returns_23) returns_23 () returns_23 () { { return 23; return 23; } }