From: Diego Novillo <dnovillo@redhat.com>
To: Zack Weinberg <zack@codesourcery.com>
Cc: Michael Matz <matz@suse.de>, "gcc@gcc.gnu.org" <gcc@gcc.gnu.org>
Subject: Re: Dead-code elimination can't remove string copy insns?
Date: Tue, 13 May 2003 17:07:00 -0000 [thread overview]
Message-ID: <20030513170722.GA7112@tornado.toronto.redhat.com> (raw)
In-Reply-To: <871xz2ol4u.fsf@egil.codesourcery.com>
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 <UVd90>; struct S <UVd90>;
struct S * T.5; struct S * T.5;
{ {
{ | int <UV42a0>;
int <UV42a0>; <
{ | goto <UL4230>;;
{ | <UL4230>:;
<UV42a0> = 23; <
goto <UL4230>; <
} <
}; <
<UL4230>:;; <
retval.6 = <UV42a0> <
}; <
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); <
<UVd90> = {}; <
<UVd90>.a = 12; <
<UVd90>.b = {}; <
<UVd90>.b[0] = 3.141500000000000181 <
<UVd90>.b[1] = 2.182799999999999851 <
<UVd90>.c = 0B; <
T.5 = &<UVd90>; <
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 <UVf5b0>;
int <UVf5b0>; <
{ | goto <ULf540>;;
{ | <ULf540>:;
<UVf5b0> = 23; <
goto <ULf540>; <
} <
}; <
<ULf540>:;; <
retval.11 = <UVf5b0> <
}; <
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;
} }
next prev parent reply other threads:[~2003-05-13 17:07 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-05-13 0:26 Zack Weinberg
2003-05-13 0:48 ` Dale Johannesen
2003-05-13 1:30 ` Zack Weinberg
2003-05-13 9:30 ` Michael Matz
2003-05-13 16:17 ` Zack Weinberg
2003-05-13 16:30 ` Diego Novillo
2003-05-13 16:40 ` Zack Weinberg
2003-05-13 17:07 ` Diego Novillo [this message]
2003-05-13 17:16 ` law
2003-05-13 17:24 ` Diego Novillo
2003-05-13 17:36 ` Zack Weinberg
2003-05-13 17:38 ` law
2003-05-13 17:50 ` Diego Novillo
2003-05-13 18:02 ` law
2003-05-13 18:35 ` Joe Buck
2003-05-13 19:35 ` [tree-ssa] Improve eliminate_useless_stmts_and_vars [Was Re: Dead-code elimination can't remove string copy insns? ] law
2003-05-13 22:14 ` Dead-code elimination can't remove string copy insns? Richard Henderson
2003-05-14 9:25 ` Michael Matz
2003-05-14 11:34 Naveen Sharma, Noida
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20030513170722.GA7112@tornado.toronto.redhat.com \
--to=dnovillo@redhat.com \
--cc=gcc@gcc.gnu.org \
--cc=matz@suse.de \
--cc=zack@codesourcery.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).