Ignore empty target specific options, and if -W is also specified on the
[official-gcc.git] / libchill / ltps.c
blob03fec86a586f9198ad0dd857868b660035388fcd
1 /* Implement POWERSET runtime actions for CHILL.
2 Copyright (C) 1992,1993 Free Software Foundation, Inc.
3 Author: Wilfried Moser, et al
5 This file is part of GNU CC.
7 GNU CC is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2, or (at your option)
10 any later version.
12 GNU CC is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with GNU CC; see the file COPYING. If not, write to
19 the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
21 /* As a special exception, if you link this library with other files,
22 some of which are compiled with GCC, to produce an executable,
23 this library does not by itself cause the resulting executable
24 to be covered by the GNU General Public License.
25 This exception does not however invalidate any other reasons why
26 the executable file might be covered by the GNU General Public License. */
28 #define __CHILL_LIB__
30 #include <stdio.h>
31 #include "powerset.h"
34 * function __ltpowerset
36 * parameters:
37 * left powerset
38 * right powerset
39 * bitlength length of powerset
41 * returns:
42 * int 1 .. left is proper subset of right
43 * (excludes case where left == right)
44 * 0 .. not
46 * abstract:
47 * check if one powerset is included in another
50 int
51 __ltpowerset (left, right, bitlength)
52 SET_WORD *left;
53 SET_WORD *right;
54 unsigned long bitlength;
56 if (bitlength <= SET_CHAR_SIZE)
58 if ((*((SET_CHAR *)left) & *((SET_CHAR *)right))
59 != *((SET_CHAR *)left))
60 return 0;
61 if (*((SET_CHAR *)left) != *((SET_CHAR *)right))
62 return 1;
63 return 0;
65 else if (bitlength <= SET_SHORT_SIZE)
67 if ((*((SET_SHORT *)left) & *((SET_SHORT *)right))
68 != *((SET_SHORT *)left))
69 return 0;
70 if (*((SET_SHORT *)left) != *((SET_SHORT *)right))
71 return 1;
72 return 0;
74 else
76 SET_WORD *endp = left + BITS_TO_WORDS(bitlength);
77 int all_equal = 1; /* assume all bits are equal */
79 while (left < endp)
81 if ((*right & *left) != *left)
82 return 0;
83 if (*left != *right)
84 all_equal = 0;
85 left++;
86 right++;
88 if (left == endp && all_equal) /* exclude TRUE return for == case */
89 return 0;
90 return 1;