summaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorhp <hp@138bc75d-0d04-0410-961f-82ee72b054a4>2002-04-06 08:20:35 +0000
committerhp <hp@138bc75d-0d04-0410-961f-82ee72b054a4>2002-04-06 08:20:35 +0000
commitadcdc3d78a8e3aec137eaf696d5dce89877cbe8b (patch)
treea32c7853a0de25dc14823ed440a0d51757bb1da7 /gcc
parent1d3fd823f5f4a7e1a502bc288c75216104a6e607 (diff)
downloadgcc-adcdc3d78a8e3aec137eaf696d5dce89877cbe8b.tar.gz
* config/mmix/t-mmix (TARGET_LIBGCC2_CFLAGS): Don't -Dinhibit_libc
here. * config/mmix/mmix.h (INITIAL_ELIMINATION_OFFSET): Remove spurious semicolon. * config/mmix/mmix.c (mmix_expand_builtin_va_arg): Variable-size types come in by-reference. Fix typo in comment. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@51946 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog11
-rw-r--r--gcc/config/mmix/mmix.c58
-rw-r--r--gcc/config/mmix/mmix.h2
-rw-r--r--gcc/config/mmix/t-mmix2
4 files changed, 46 insertions, 27 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 51f332e04cd..98e4138d0e5 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,14 @@
+2002-04-06 Hans-Peter Nilsson <hp@bitrange.com>
+
+ * config/mmix/t-mmix (TARGET_LIBGCC2_CFLAGS): Don't -Dinhibit_libc
+ here.
+
+ * config/mmix/mmix.h (INITIAL_ELIMINATION_OFFSET): Remove spurious
+ semicolon.
+
+ * config/mmix/mmix.c (mmix_expand_builtin_va_arg): Variable-size
+ types come in by-reference. Fix typo in comment.
+
2002-04-05 David S. Miller <davem@redhat.com>
* config/sparc/freebsd.h (ENDFILE_SPEC): Add crtfastmath bits.
diff --git a/gcc/config/mmix/mmix.c b/gcc/config/mmix/mmix.c
index c59baf3f776..d1f21d69117 100644
--- a/gcc/config/mmix/mmix.c
+++ b/gcc/config/mmix/mmix.c
@@ -1273,7 +1273,7 @@ mmix_expand_builtin_va_arg (valist, type)
if (type == error_mark_node
|| (type_size = TYPE_SIZE_UNIT (TYPE_MAIN_VARIANT (type))) == NULL
|| TREE_OVERFLOW (type_size))
- /* Presumable an error; the size isn't computable. A message has
+ /* Presumably an error; the size isn't computable. A message has
supposedly been emitted elsewhere. */
rounded_size = size_zero_node;
else
@@ -1302,30 +1302,38 @@ mmix_expand_builtin_va_arg (valist, type)
}
else if (!integer_zerop (rounded_size))
{
- /* If the size is less than a register, the we need to pad the
- address by adding the difference. */
- tree addend
- = fold (build (COND_EXPR, sizetype,
- fold (build (GT_EXPR, sizetype,
- rounded_size,
- align)),
- size_zero_node,
- fold (build (MINUS_EXPR, sizetype,
- rounded_size,
- type_size))));
- tree addr_tree1
- = fold (build (PLUS_EXPR, TREE_TYPE (addr_tree), addr_tree, addend));
-
- /* If this type is larger than what fits in a register, then it is
- passed by reference. */
- addr_tree
- = fold (build (COND_EXPR, TREE_TYPE (addr_tree1),
- fold (build (GT_EXPR, sizetype,
- rounded_size,
- ptr_size)),
- build1 (INDIRECT_REF, build_pointer_type (type),
- addr_tree1),
- addr_tree1));
+ if (!really_constant_p (type_size))
+ /* Varying-size types come in by reference. */
+ addr_tree
+ = build1 (INDIRECT_REF, build_pointer_type (type), addr_tree);
+ else
+ {
+ /* If the size is less than a register, then we need to pad the
+ address by adding the difference. */
+ tree addend
+ = fold (build (COND_EXPR, sizetype,
+ fold (build (GT_EXPR, sizetype,
+ rounded_size,
+ align)),
+ size_zero_node,
+ fold (build (MINUS_EXPR, sizetype,
+ rounded_size,
+ type_size))));
+ tree addr_tree1
+ = fold (build (PLUS_EXPR, TREE_TYPE (addr_tree), addr_tree,
+ addend));
+
+ /* If this type is larger than what fits in a register, then it
+ is passed by reference. */
+ addr_tree
+ = fold (build (COND_EXPR, TREE_TYPE (addr_tree1),
+ fold (build (GT_EXPR, sizetype,
+ rounded_size,
+ ptr_size)),
+ build1 (INDIRECT_REF, build_pointer_type (type),
+ addr_tree1),
+ addr_tree1));
+ }
}
addr = expand_expr (addr_tree, NULL_RTX, Pmode, EXPAND_NORMAL);
diff --git a/gcc/config/mmix/mmix.h b/gcc/config/mmix/mmix.h
index 93c286b4bb7..6171e588500 100644
--- a/gcc/config/mmix/mmix.h
+++ b/gcc/config/mmix/mmix.h
@@ -695,7 +695,7 @@ enum reg_class
#define CAN_ELIMINATE(FROM, TO) 1
#define INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET) \
- (OFFSET) = mmix_initial_elimination_offset (FROM, TO);
+ (OFFSET) = mmix_initial_elimination_offset (FROM, TO)
/* Node: Stack Arguments */
diff --git a/gcc/config/mmix/t-mmix b/gcc/config/mmix/t-mmix
index adf883a0931..84231ace71b 100644
--- a/gcc/config/mmix/t-mmix
+++ b/gcc/config/mmix/t-mmix
@@ -6,7 +6,7 @@ LIBGCC1 =
LIBGCC1_TEST =
CROSS_LIBGCC1 =
-TARGET_LIBGCC2_CFLAGS = -mlibfuncs -Dinhibit_libc -O2
+TARGET_LIBGCC2_CFLAGS = -mlibfuncs -O2
EXTRA_MULTILIB_PARTS = crti.o crtn.o crtbegin.o crtend.o