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]

const-elim-1.c


Zack --

gcc.dg/const-elim-1.c is a test that you added back in May.

It fails on arm-none-elf, and also on i686-pc-linux-gnu, unless you
use -mtune=pentiumpro.

The issue in both cases relates to this code:

	const struct S S = { 23, { 1.414, 1.618 }, 0 };

If the compiler chooses to do a block copy from a read-only data into
"S", then the compiler is unable to eliminate the block copy, and is
therefore unable to eliminate the constant pool.  The compiler is
unable to eliminate the block copy because the code at the end of
init_propagate_block_info that handles SETs to MEMs doesn't fire for
these block copies.  Ideally, that code would be made smarter, but
really the elimination should really happen in tree-ssa code, not in
RTL code anyhow.

Anyhow, this test has never passed on arm-none-elf.  Therefore, I've
XFAILed it on the csl-arm-branch and the mainline with the attached
patch.  I didn't try to deal with the case of an x86 without
-mtune=pentiumpro because I'm not sure exactly what criteria to use to
XFAIL the test.

--
Mark Mitchell
CodeSourcery, LLC
mark@codesourcery.com

2003-12-28  Mark Mitchell  <mark@codesourcery.com>

	* gcc.dg/const-elim-1.c: XFAIL on arm-*-*.

Index: const-elim-1.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/gcc.dg/const-elim-1.c,v
retrieving revision 1.3
diff -c -5 -p -r1.3 const-elim-1.c
*** const-elim-1.c	9 Jul 2003 06:19:44 -0000	1.3
--- const-elim-1.c	29 Dec 2003 02:30:54 -0000
***************
*** 5,15 ****
     warning but doesn't.  (Hard to fix -- the lexer is not aware of
     the parser's state.)  */
  
  /* { dg-do compile } */
  /* { dg-options "-O2 -std=c99" } */
! /* { dg-final { scan-assembler-not "L\\\$?C\[^A-Z\]" } } */
  
  #define I (__extension__ 1.0iF)
  
  struct S { int a; double b[2]; void *c; };
  
--- 5,18 ----
     warning but doesn't.  (Hard to fix -- the lexer is not aware of
     the parser's state.)  */
  
  /* { dg-do compile } */
  /* { dg-options "-O2 -std=c99" } */
! /* This test fails on ARM cores because we use a block move to
!    initialize "S" in test2, and GCC is not clever enough to eliminate
!    the block move.  */
! /* { dg-final { scan-assembler-not "L\\\$?C\[^A-Z\]" { xfail arm-*-* } } } */
  
  #define I (__extension__ 1.0iF)
  
  struct S { int a; double b[2]; void *c; };
  


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