This is the mail archive of the gcc-patches@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]

[PATCH, committed] Correct gcc.dg/doloop-1.c test


	After the recent changes to GCC's doloop optimization, the PowerPC
dooloop-1.c began to fail not because the doloop instruction was missing,
but because a non-doloop branch instruction was present, generated by
other BB optimizations, such as basic-block reordering.

	I tried experimenting with other GCC options to return to the
original test, butI could not find a reliable set of options that only
would produce the "wrong" branch instruction when the doloop
transformation failed.

	The only reliable test is that the doloop "bdnz" instruction is
generated.

	I updated the comment at the top of the testcase to reflect the
various other forms that could be produced and removed the spurious
failure. 

David

        * gcc.dg/doloop-1.c: Do not check for lack of "blt".

Index: doloop-1.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/gcc.dg/doloop-1.c,v
retrieving revision 1.1
diff -c -p -r1.1 doloop-1.c
*** doloop-1.c	17 Sep 2002 21:25:13 -0000	1.1
--- doloop-1.c	28 Mar 2004 20:31:32 -0000
***************
*** 1,6 ****
  /* Make sure both loops are recognized as doloops.
     If so, "bdnz" will be generated on ppc; if not,
!    you will get "ble". */
  
  /* { dg-do compile { target powerpc-*-* } } */
  /* { dg-options "-O2" } */
--- 1,6 ----
  /* Make sure both loops are recognized as doloops.
     If so, "bdnz" will be generated on ppc; if not,
!    you will get "ble" or "blt" or "bge".  */
  
  /* { dg-do compile { target powerpc-*-* } } */
  /* { dg-options "-O2" } */
*************** void foo (int count, char* pca, char* pc
*** 15,18 ****
      *pca = *pcb;
  }
  /* { dg-final { scan-assembler "bdnz" } } */
- /* { dg-final { scan-assembler-not "blt" } } */
--- 15,17 ----


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