aboutsummaryrefslogtreecommitdiff
path: root/gcc/ch
diff options
context:
space:
mode:
authorJeffrey A Law <law@cygnus.com>1999-11-01 05:35:03 +0000
committerJeff Law <law@gcc.gnu.org>1999-10-31 22:35:03 -0700
commit64b6368a9ae1bb20ec5d3cae80e4f7ccbfa2b174 (patch)
treeee9457fc83605716affa67d7bbb80e32c098fbe7 /gcc/ch
parent7b6cbff4caee3e4cc7e5d180f8b34a64c4e7bff4 (diff)
downloadgcc-64b6368a9ae1bb20ec5d3cae80e4f7ccbfa2b174.zip
gcc-64b6368a9ae1bb20ec5d3cae80e4f7ccbfa2b174.tar.gz
gcc-64b6368a9ae1bb20ec5d3cae80e4f7ccbfa2b174.tar.bz2
Makefile.in (convert.o, typeck.o): Depend on output.h
* Makefile.in (convert.o, typeck.o): Depend on output.h * convert.c: Include output.h. * typeck.c: Include output.h. (initializer_constant_valid_p): Delete fucntion. * ch-tree.h (initializer_constant_valid_p): Delete prototype. From-SVN: r30311
Diffstat (limited to 'gcc/ch')
-rw-r--r--gcc/ch/ChangeLog8
-rw-r--r--gcc/ch/Makefile.in5
-rw-r--r--gcc/ch/ch-tree.h1
-rw-r--r--gcc/ch/convert.c1
-rw-r--r--gcc/ch/typeck.c132
5 files changed, 13 insertions, 134 deletions
diff --git a/gcc/ch/ChangeLog b/gcc/ch/ChangeLog
index 5343848..5044fe1 100644
--- a/gcc/ch/ChangeLog
+++ b/gcc/ch/ChangeLog
@@ -1,3 +1,11 @@
+Sun Oct 31 22:33:33 1999 Jeffrey A Law (law@cygnus.com)
+
+ * Makefile.in (convert.o, typeck.o): Depend on output.h
+ * convert.c: Include output.h.
+ * typeck.c: Include output.h.
+ (initializer_constant_valid_p): Delete fucntion.
+ * ch-tree.h (initializer_constant_valid_p): Delete prototype.
+
1999-10-26 Mark Mitchell <mark@codesourcery.com>
* ch-tree.h (remember_end_note): Remove prototype.
diff --git a/gcc/ch/Makefile.in b/gcc/ch/Makefile.in
index 3ff898d..57c1ebb 100644
--- a/gcc/ch/Makefile.in
+++ b/gcc/ch/Makefile.in
@@ -265,7 +265,8 @@ actions.o : actions.c $(CONFIG_H) $(CHILL_TREE_H) actions.h $(RTL_H) \
$(srcdir)/../expr.h ../insn-codes.h $(srcdir)/../system.h \
$(srcdir)/../toplev.h
convert.o : convert.c $(CONFIG_H) $(CHILL_TREE_H) $(srcdir)/../flags.h \
- $(srcdir)/../tree.h $(srcdir)/../system.h $(srcdir)/../toplev.h
+ $(srcdir)/../tree.h $(srcdir)/../system.h $(srcdir)/../toplev.h \
+ $(srcdir)/../convert.h
decl.o : decl.c $(CONFIG_H) $(CHILL_TREE_H) $(srcdir)/../flags.h lex.h \
$(srcdir)/../system.h $(srcdir)/../toplev.h
except.o : except.c $(CONFIG_H) $(srcdir)/../tree.h $(RTL_H) $(CHILL_TREE_H) \
@@ -299,7 +300,7 @@ tree.o : tree.c $(CONFIG_H) $(CHILL_TREE_H) $(srcdir)/../system.h \
$(srcdir)/../toplev.h
typeck.o : typeck.c $(CONFIG_H) $(CHILL_TREE_H) ../insn-codes.h \
$(srcdir)/../expr.h ../insn-codes.h $(srcdir)/../flags.h lex.h \
- $(srcdir)/../system.h $(srcdir)/../toplev.h
+ $(srcdir)/../system.h $(srcdir)/../toplev.h $(srcdir)/../output.h
ch-version.o : ch-version.c
ch-version.c : Makefile
echo 'const char * const gnuchill_version = "$(GNUCHILL_VERSION)";' > $@
diff --git a/gcc/ch/ch-tree.h b/gcc/ch/ch-tree.h
index effa886..956dcb2 100644
--- a/gcc/ch/ch-tree.h
+++ b/gcc/ch/ch-tree.h
@@ -1101,7 +1101,6 @@ extern ch_class chill_resulting_class PROTO((ch_class, ch_class));
extern tree chill_resulting_mode PROTO((tree, tree));
extern int chill_similar PROTO((tree, tree, struct mode_chain*));
extern int discrete_type_p PROTO((tree));
-extern tree initializer_constant_valid_p PROTO((tree, tree));
extern tree convert_to_discrete PROTO((tree));
extern tree smash_dummy_type PROTO((tree));
extern tree string_assignment_condition PROTO((tree, tree));
diff --git a/gcc/ch/convert.c b/gcc/ch/convert.c
index 84093b8..137a2d5 100644
--- a/gcc/ch/convert.c
+++ b/gcc/ch/convert.c
@@ -32,6 +32,7 @@ Boston, MA 02111-1307, USA. */
#include "convert.h"
#include "lex.h"
#include "toplev.h"
+#include "output.h"
extern tree bit_one_node, bit_zero_node;
extern tree string_one_type_node;
diff --git a/gcc/ch/typeck.c b/gcc/ch/typeck.c
index a1bc17b..8628c95 100644
--- a/gcc/ch/typeck.c
+++ b/gcc/ch/typeck.c
@@ -37,6 +37,7 @@ Boston, MA 02111-1307, USA. */
#include "expr.h"
#include "lex.h"
#include "toplev.h"
+#include "output.h"
/* forward declarations */
static int chill_l_equivalent PROTO((tree, tree, struct mode_chain*));
@@ -3668,137 +3669,6 @@ mark_addressable (exp)
}
}
-/* Return nonzero if VALUE is a valid constant-valued expression
- for use in initializing a static variable; one that can be an
- element of a "constant" initializer.
-
- Return null_pointer_node if the value is absolute;
- if it is relocatable, return the variable that determines the relocation.
- We assume that VALUE has been folded as much as possible;
- therefore, we do not need to check for such things as
- arithmetic-combinations of integers. */
-
-tree
-initializer_constant_valid_p (value, endtype)
- tree value;
- tree endtype;
-{
- switch (TREE_CODE (value))
- {
- case CONSTRUCTOR:
- if (TREE_CODE (TREE_TYPE (value)) == UNION_TYPE
- && TREE_CONSTANT (value))
- return
- initializer_constant_valid_p (TREE_VALUE (CONSTRUCTOR_ELTS (value)),
- endtype);
-
- return TREE_STATIC (value) ? null_pointer_node : 0;
-
- case INTEGER_CST:
- case REAL_CST:
- case STRING_CST:
- case COMPLEX_CST:
- return null_pointer_node;
-
- case ADDR_EXPR:
- return TREE_OPERAND (value, 0);
-
- case NON_LVALUE_EXPR:
- return initializer_constant_valid_p (TREE_OPERAND (value, 0), endtype);
-
- case CONVERT_EXPR:
- case NOP_EXPR:
- /* Allow conversions between pointer types. */
- if (TREE_CODE (TREE_TYPE (value)) == POINTER_TYPE
- && TREE_CODE (TREE_TYPE (TREE_OPERAND (value, 0))) == POINTER_TYPE)
- return initializer_constant_valid_p (TREE_OPERAND (value, 0), endtype);
-
- /* Allow conversions between real types. */
- if (TREE_CODE (TREE_TYPE (value)) == REAL_TYPE
- && TREE_CODE (TREE_TYPE (TREE_OPERAND (value, 0))) == REAL_TYPE)
- return initializer_constant_valid_p (TREE_OPERAND (value, 0), endtype);
-
- /* Allow length-preserving conversions between integer types. */
- if (TREE_CODE (TREE_TYPE (value)) == INTEGER_TYPE
- && TREE_CODE (TREE_TYPE (TREE_OPERAND (value, 0))) == INTEGER_TYPE
- && (TYPE_PRECISION (TREE_TYPE (value))
- == TYPE_PRECISION (TREE_TYPE (TREE_OPERAND (value, 0)))))
- return initializer_constant_valid_p (TREE_OPERAND (value, 0), endtype);
-
- /* Allow conversions between other integer types only if
- explicit value. */
- if (TREE_CODE (TREE_TYPE (value)) == INTEGER_TYPE
- && TREE_CODE (TREE_TYPE (TREE_OPERAND (value, 0))) == INTEGER_TYPE)
- {
- tree inner = initializer_constant_valid_p (TREE_OPERAND (value, 0),
- endtype);
- if (inner == null_pointer_node)
- return null_pointer_node;
- return 0;
- }
-
- /* Allow (int) &foo provided int is as wide as a pointer. */
- if (TREE_CODE (TREE_TYPE (value)) == INTEGER_TYPE
- && TREE_CODE (TREE_TYPE (TREE_OPERAND (value, 0))) == POINTER_TYPE
- && (TYPE_PRECISION (TREE_TYPE (value))
- >= TYPE_PRECISION (TREE_TYPE (TREE_OPERAND (value, 0)))))
- return initializer_constant_valid_p (TREE_OPERAND (value, 0),
- endtype);
-
- /* Likewise conversions from int to pointers. */
- if (TREE_CODE (TREE_TYPE (value)) == POINTER_TYPE
- && TREE_CODE (TREE_TYPE (TREE_OPERAND (value, 0))) == INTEGER_TYPE
- && (TYPE_PRECISION (TREE_TYPE (value))
- <= TYPE_PRECISION (TREE_TYPE (TREE_OPERAND (value, 0)))))
- return initializer_constant_valid_p (TREE_OPERAND (value, 0),
- endtype);
-
- /* Allow conversions to union types if the value inside is okay. */
- if (TREE_CODE (TREE_TYPE (value)) == UNION_TYPE)
- return initializer_constant_valid_p (TREE_OPERAND (value, 0),
- endtype);
- return 0;
-
- case PLUS_EXPR:
- if (TREE_CODE (endtype) == INTEGER_TYPE
- && TYPE_PRECISION (endtype) < POINTER_SIZE)
- return 0;
- {
- tree valid0 = initializer_constant_valid_p (TREE_OPERAND (value, 0),
- endtype);
- tree valid1 = initializer_constant_valid_p (TREE_OPERAND (value, 1),
- endtype);
- /* If either term is absolute, use the other terms relocation. */
- if (valid0 == null_pointer_node)
- return valid1;
- if (valid1 == null_pointer_node)
- return valid0;
- return 0;
- }
-
- case MINUS_EXPR:
- if (TREE_CODE (endtype) == INTEGER_TYPE
- && TYPE_PRECISION (endtype) < POINTER_SIZE)
- return 0;
- {
- tree valid0 = initializer_constant_valid_p (TREE_OPERAND (value, 0),
- endtype);
- tree valid1 = initializer_constant_valid_p (TREE_OPERAND (value, 1),
- endtype);
- /* Win if second argument is absolute. */
- if (valid1 == null_pointer_node)
- return valid0;
- /* Win if both arguments have the same relocation.
- Then the value is absolute. */
- if (valid0 == valid1)
- return null_pointer_node;
- return 0;
- }
- default:
- return 0;
- }
-}
-
/* Return an integer type with BITS bits of precision,
that is unsigned if UNSIGNEDP is nonzero, otherwise signed. */