summaryrefslogtreecommitdiffstats
path: root/gcc/fold-const.c
diff options
context:
space:
mode:
authormmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>1998-06-25 17:28:11 +0000
committermmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>1998-06-25 17:28:11 +0000
commit5eb945def1519f39c47a599d1f680f0e88d9d492 (patch)
tree2afaeed43dec179058618d5852bc3509765c4dec /gcc/fold-const.c
parent70fe8241cf9af8ebee773f657f4bc4c99bd14bed (diff)
downloadppe42-gcc-5eb945def1519f39c47a599d1f680f0e88d9d492.tar.gz
ppe42-gcc-5eb945def1519f39c47a599d1f680f0e88d9d492.zip
* fold-const.c (make_range): Don't go looking at TREE_OPERANDs of
nodes that are not expressions. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@20728 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fold-const.c')
-rw-r--r--gcc/fold-const.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index 30499a178de..7544f8b673a 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)
{
OpenPOWER on IntegriCloud