FAIL: gcc.c-torture/execute/950628-1.c execution, -O1

Richard Henderson rth@redhat.com
Tue Jan 23 18:09:00 GMT 2001


On Tue, Jan 23, 2001 at 07:23:17PM -0500, John David Anglin wrote:
> > Poking at this quickly, the *real* problem is that we've got
> > multiple stores to unchanging memory.  This is wildly illegal.
> 
> I only see one store for each location.

Oh, duh.  The second "store" is the init_propagate_block_info
optimization.  Fix for that appended.

> It should be relatively straight forward to find where the /u bit is set.

Answering my own question, it's caused by 

2150          tgtblk = assign_temp (build_qualified_type (type,
2151                                                      (TYPE_QUALS (type)
2152                                                       | TYPE_QUAL_CONST)),
2153                                0, 1, 1);

from expr.c.

> I think the problem was introduced at the end of December.  The regstack-1
> test on the sparc-sun-solaris2.7 started failing at all opts above O0
> on Dec. 31.  There is a good chance that it is suffering from the same
> problem.

And indeed, we find 

2000-12-30  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>

        * calls.c (expand_call): Use assign_temp as much as possible, use
        readonly variant if assigned once, and don't set memory attributes.
        (emit_library_call_value_1, store_one_arg): Likewise.
        * integrate.c (expand_inline_function): Likewise.
        * stmt.c (expand_asm_operands, expand_return): Likewise.
        * expr.c (copy_blkmode_from_reg, store_constructor): Likewise.

which isn't actively wrong, but I wonder about how much extra
stack is required because of it.



r~


	* flow.c (init_propagate_block_info): Don't consider unchanging
	memories for dead frame store elimination.

Index: flow.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/flow.c,v
retrieving revision 1.372
diff -c -p -d -r1.372 flow.c
*** flow.c	2001/01/19 18:28:58	1.372
--- flow.c	2001/01/24 01:59:22
*************** init_propagate_block_info (bb, live, loc
*** 4100,4105 ****
--- 4100,4112 ----
  	  {
  	    rtx mem = SET_DEST (PATTERN (insn));
  
+ 	    /* This optimization is performed by faking a store to the
+ 	       memory at the end of the block.  This doesn't work for
+ 	       unchanging memories because multiple stores to unchanging
+ 	       memory is illegal and alias analysis doesn't consider it.  */
+ 	    if (RTX_UNCHANGING_P (mem))
+ 	      continue;
+ 
  	    if (XEXP (mem, 0) == frame_pointer_rtx
  		|| (GET_CODE (XEXP (mem, 0)) == PLUS
  		    && XEXP (XEXP (mem, 0), 0) == frame_pointer_rtx


More information about the Gcc-bugs mailing list