This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Dead-code elimination can't remove string copy insns?


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;
}					}


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]