This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
PATCH to avoid peeking at TREE_OPERAND for non-expressions
- To: egcs-patches at cygnus dot com
- Subject: PATCH to avoid peeking at TREE_OPERAND for non-expressions
- From: Mark Mitchell <mark at markmitchell dot com>
- Date: Thu, 25 Jun 1998 13:09:04 -0700
- Cc: Jeff Law <law at cygnus dot com>
- Reply-to: mark at markmitchell dot com
Here's a patch that avoids looking at TREE_OPERAND for things that
aren't expressions in make_range. We were looking at the TREE_OPERAND
of PARM_DECLs.
Jeff, OK?
--
Mark Mitchell mark@markmitchell.com
Mark Mitchell Consulting http://www.markmitchell.com
Thu Jun 25 12:47:41 1998 Mark Mitchell <mark@markmitchell.com>
* fold-const.c (make_range): Don't go looking at TREE_OPERANDs of
nodes that are not expressions.
Index: fold-const.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/fold-const.c,v
retrieving revision 1.40
diff -c -p -r1.40 fold-const.c
*** fold-const.c 1998/06/19 01:46:50 1.40
--- fold-const.c 1998/06/25 19:46:01
*************** make_range (exp, pin_p, plow, phigh)
*** 2836,2845 ****
while (1)
{
code = TREE_CODE (exp);
! arg0 = TREE_OPERAND (exp, 0), arg1 = TREE_OPERAND (exp, 1);
if (TREE_CODE_CLASS (code) == '<' || TREE_CODE_CLASS (code) == '1'
|| TREE_CODE_CLASS (code) == '2')
! type = TREE_TYPE (arg0);
switch (code)
{
--- 2836,2851 ----
while (1)
{
code = TREE_CODE (exp);
!
if (TREE_CODE_CLASS (code) == '<' || TREE_CODE_CLASS (code) == '1'
|| TREE_CODE_CLASS (code) == '2')
! {
! arg0 = TREE_OPERAND (exp, 0);
! type = TREE_TYPE (arg0);
! if (TREE_CODE_CLASS (code) == '2'
! || TREE_CODE_CLASS (code) == '<')
! arg1 = TREE_OPERAND (exp, 1);
! }
switch (code)
{