From c60ee6f503e41f54ced5925dbe39cbf1f33602fb Mon Sep 17 00:00:00 2001
From: Jan Hubicka <jh@suse.cz>
Date: Tue, 27 Aug 2002 19:52:41 +0200
Subject: [PATCH] * i386.c (classify_argument): Handle variable sized objects.

From-SVN: r56609
---
 gcc/ChangeLog          | 4 ++++
 gcc/config/i386/i386.c | 4 ++++
 2 files changed, 8 insertions(+)

diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 6771a258b62a..fc543fa4df27 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,7 @@
+Tue Aug 27 19:51:05 CEST 2002  Jan Hubicka  <jh@suse.cz>
+
+	* i386.c (classify_argument): Handle variable sized objects.
+
 Tue Aug 27 19:18:16 CEST 2002  Jan Hubicka  <jh@suse.cz>
 
 	* i386.c (ix86_expand_int_movcc): Fix RTL sharing problem
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 3da2e432f70f..730bd3d78e28 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -1594,6 +1594,10 @@ classify_argument (mode, type, classes, bit_offset)
     (mode == BLKmode) ? int_size_in_bytes (type) : (int) GET_MODE_SIZE (mode);
   int words = (bytes + (bit_offset % 64) / 8 + UNITS_PER_WORD - 1) / UNITS_PER_WORD;
 
+  /* Variable sized entities are always passed/returned in memory.  */
+  if (bytes < 0)
+    return 0;
+
   if (type && AGGREGATE_TYPE_P (type))
     {
       int i;
-- 
GitLab