This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Patch to simple_cst_equal
- To: egcs-patches at cygnus dot com
- Subject: Patch to simple_cst_equal
- From: Jason Merrill <jason at cygnus dot com>
- Date: Mon, 27 Jul 1998 01:02:08 -0700
This is necessary to support a fix for a serious C++ bug; a "function-style
cast" A() is supposed to create a temporary A initialized to 0. I've
implemented this by initializing it with an empty CONSTRUCTOR, but if that
gets back to simple_cst_equal, we have a problem.
This fix is pretty simplistic, but it gets the job done.
Mon Jul 27 00:54:41 1998 Jason Merrill <jason@yorick.cygnus.com>
* tree.c (simple_cst_equal, case CONSTRUCTOR): OK if the elts are
identical.
Index: tree.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/tree.c,v
retrieving revision 1.37
diff -c -p -r1.37 tree.c
*** tree.c 1998/07/17 03:34:34 1.37
--- tree.c 1998/07/27 07:55:32
*************** simple_cst_equal (t1, t2)
*** 3984,3990 ****
TREE_STRING_LENGTH (t1));
case CONSTRUCTOR:
! abort ();
case SAVE_EXPR:
return simple_cst_equal (TREE_OPERAND (t1, 0), TREE_OPERAND (t2, 0));
--- 3987,3996 ----
TREE_STRING_LENGTH (t1));
case CONSTRUCTOR:
! if (CONSTRUCTOR_ELTS (t1) == CONSTRUCTOR_ELTS (t2))
! return 1;
! else
! abort ();
case SAVE_EXPR:
return simple_cst_equal (TREE_OPERAND (t1, 0), TREE_OPERAND (t2, 0));