[PATCH] Fix PR tree-optimization/24162

Richard Guenther rguenther@suse.de
Tue Oct 4 15:47:00 GMT 2005


On Tue, 4 Oct 2005, Richard Henderson wrote:

> On Tue, Oct 04, 2005 at 03:41:13PM +0200, Richard Guenther wrote:
> > 	* fold-const.c (fold_indirect_ref_1): Make sure we fold
> > 	ARRAY_REFs of constant strings.
> 
> Not ok by itself.  Surely the tree-inline sharing bug is still present.

I had another part tested, which falls through copying the trees in
any case, which seems at least safe:

Index: tree-inline.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-inline.c,v
retrieving revision 1.210
diff -c -3 -p -r1.210 tree-inline.c
*** tree-inline.c       1 Aug 2005 15:25:28 -0000       1.210
--- tree-inline.c       4 Oct 2005 10:43:23 -0000
*************** copy_body_r (tree *tp, int *walk_subtree
*** 636,643 ****
                  else
                    *tp = build1 (INDIRECT_REF, type, (tree)n->value);
                }
!             *walk_subtrees = 0;
!             return NULL;
            }
        }

--- 636,642 ----
                  else
                    *tp = build1 (INDIRECT_REF, type, (tree)n->value);
                }
!             /* Fall through to copying the folded tree.  */
            }
        }

Ok together with that?

Richard.



More information about the Gcc-patches mailing list