From: Richard Kenner Date: Wed, 3 Mar 1993 00:01:48 +0000 (-0500) Subject: (collect_iterators): Handle simple expressions quickly. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=03407c75274a50c1d131dbd9522bd9cdf0f6fab6;p=gcc.git (collect_iterators): Handle simple expressions quickly. Don't try to interpret operands that are RTL as if they were trees. From-SVN: r3616 --- diff --git a/gcc/c-iterate.c b/gcc/c-iterate.c index 04d4b7073ff..91d9c3598f7 100644 --- a/gcc/c-iterate.c +++ b/gcc/c-iterate.c @@ -212,14 +212,37 @@ collect_iterators (exp, list) switch (TREE_CODE_CLASS (TREE_CODE (exp))) { case '1': + return collect_iterators (TREE_OPERAND (exp, 0), list); + case '2': case '<': + return collect_iterators (TREE_OPERAND (exp, 0), + collect_iterators (TREE_OPERAND (exp, 1), + list)); + case 'e': case 'r': { int num_args = tree_code_length[TREE_CODE (exp)]; int i; + /* Some tree codes have RTL, not trees, as operands. */ + switch (TREE_CODE (exp)) + { + case SAVE_EXPR: + case CALL_EXPR: + num_args = 2; + break; + case METHOD_CALL_EXPR: + num_args = 3; + break; + case WITH_CLEANUP_EXPR: + num_args = 1; + break; + case RTL_EXPR: + return list; + } + for (i = 0; i < num_args; i++) list = collect_iterators (TREE_OPERAND (exp, i), list); return list;