public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: law@redhat.com
To: Diego Novillo <dnovillo@redhat.com>
Cc: Zack Weinberg <zack@codesourcery.com>,
	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:38:00 -0000	[thread overview]
Message-ID: <200305131738.h4DHclpA012395@speedy.slc.redhat.com> (raw)
In-Reply-To: Your message of "Tue, 13 May 2003 13:07:22 EDT." <20030513170722.GA7112@tornado.toronto.redhat.com>

In message <20030513170722.GA7112@tornado.toronto.redhat.com>, Diego Novillo wr
ites:
 >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).
Does this look better? :-)

test1 ()
{       
  int retval.6;
  int T.1;
  char[37] * T.2;
  char * T.3;
  const char * T.4;
  struct S <UVda10>;
  struct S * T.5;
        
  { 
    int <UVdee0>;
        
    <ULde70>:;
  };  
  return;
}
    
    
;; Function test2 (test2)
    
test2 ()
{ 
  int retval.11;
  char[40] * T.7;
  char * T.8;
  int T.9;
  struct S * S.10;
  const char * str;
  struct S S;
  const complex double cplx;
  
  {
    int <UVc230>;
  
    <ULc1c0>:;
  };
  return;
} 
  

;; Function returns_23 (returns_23)

returns_23 ()
{ 
  return 23; 
} 


Note the GOTOs are gone :-)

The problem was the code didn't match the toplevel comments in regards
to when the pass should be repeated.  Basically we want to repeat if
we eliminated a control structure as that can in turn expose more
GOTOs that we know how to eliminate.

Testing of the fix is in progress.

jeff

  parent reply	other threads:[~2003-05-13 17:38 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
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 [this message]
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=200305131738.h4DHclpA012395@speedy.slc.redhat.com \
    --to=law@redhat.com \
    --cc=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).