diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 6771a258b62aca4db9500e6e61ea827d215739fc..fc543fa4df27521f7ca466a054324f52a3c9315a 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 3da2e432f70ffdbab5cf81eee91f5a640746c697..730bd3d78e28267c929bc923361ff08c4a370c4d 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;