This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
PATCH for fold-const.c: take 2
- To: egcs-patches at cygnus dot com
- Subject: PATCH for fold-const.c: take 2
- From: Mark Mitchell <mark at markmitchell dot com>
- Date: Thu, 25 Jun 1998 13:36:35 -0700
- Cc: Jeff Law <law at cygnus dot com>
- Reply-to: mark at markmitchell dot com
The patch I just sent was written while I was under an evil influence,
and is total garbage.
Here's a better version.
--
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 20:29:51
*************** 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,2852 ----
while (1)
{
code = TREE_CODE (exp);
!
! if (IS_EXPR_CODE_CLASS (TREE_CODE_CLASS (code)))
! {
! arg0 = TREE_OPERAND (exp, 0);
! type = TREE_TYPE (arg0);
! if (TREE_CODE_CLASS (code) == '2'
! || TREE_CODE_CLASS (code) == '<'
! || (TREE_CODE_CLASS (code) == 'e'
! && tree_code_length[(int) code] > 1))
! arg1 = TREE_OPERAND (exp, 1);
! }
switch (code)
{