aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1993-12-22 14:18:06 -0500
committerRichard Kenner <kenner@gcc.gnu.org>1993-12-22 14:18:06 -0500
commit1810c3fa48bfd1071b9a53d6eab3969f45b77c8f (patch)
tree0792eb0f1ff434df89ac3263b4691b78d0ea0624 /gcc
parentb60e974d7996651fa29d62214cc3f99890b82c2b (diff)
downloadgcc-1810c3fa48bfd1071b9a53d6eab3969f45b77c8f.zip
gcc-1810c3fa48bfd1071b9a53d6eab3969f45b77c8f.tar.gz
gcc-1810c3fa48bfd1071b9a53d6eab3969f45b77c8f.tar.bz2
(chainon): Detect more circularities.
From-SVN: r6266
Diffstat (limited to 'gcc')
-rw-r--r--gcc/tree.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/gcc/tree.c b/gcc/tree.c
index ed6411d..8324ba1 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -1571,14 +1571,18 @@ tree
chainon (op1, op2)
tree op1, op2;
{
- tree t;
if (op1)
{
- for (t = op1; TREE_CHAIN (t); t = TREE_CHAIN (t))
- if (t == op2) abort (); /* Circularity being created */
- if (t == op2) abort (); /* Circularity being created */
- TREE_CHAIN (t) = op2;
+ register tree t1;
+ register tree t2;
+
+ for (t1 = op1; TREE_CHAIN (t1); t1 = TREE_CHAIN (t1))
+ ;
+ TREE_CHAIN (t1) = op2;
+ for (t2 = op2; t2; t2 = TREE_CHAIN (t2))
+ if (t2 == t1)
+ abort (); /* Circularity created. */
return op1;
}
else return op2;