aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Mitchell <mark@markmitchell.com>1998-06-25 17:28:11 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>1998-06-25 17:28:11 +0000
commit30d68b865b6705ced98cc185941647335c633cf5 (patch)
tree2afaeed43dec179058618d5852bc3509765c4dec
parent65e92a6066d267787c88fb5beb09bd8d823144e7 (diff)
downloadgcc-30d68b865b6705ced98cc185941647335c633cf5.zip
gcc-30d68b865b6705ced98cc185941647335c633cf5.tar.gz
gcc-30d68b865b6705ced98cc185941647335c633cf5.tar.bz2
fold-const.c (make_range): Don't go looking at TREE_OPERANDs of nodes that are not expressions.
* fold-const.c (make_range): Don't go looking at TREE_OPERANDs of nodes that are not expressions. From-SVN: r20728
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/fold-const.c18
2 files changed, 19 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index b9ada6d..9ecab59 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+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.
+
Thu Jun 25 15:08:16 1998 Mark Mitchell <mark@markmitchell.com>
* invoke.texi (-fstrict-aliasing): Document.
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index 30499a1..7544f8b 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -2836,10 +2836,20 @@ make_range (exp, pin_p, plow, phigh)
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);
+
+ if (IS_EXPR_CODE_CLASS (TREE_CODE_CLASS (code)))
+ {
+ arg0 = TREE_OPERAND (exp, 0);
+ if (TREE_CODE_CLASS (code) == '<'
+ || TREE_CODE_CLASS (code) == '1'
+ || TREE_CODE_CLASS (code) == '2')
+ 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)
{