re PR target/31989 (Gcc miscompiles C/C++ on Linux/x86-64)
authorH.J. Lu <hongjiu.lu@intel.com>
Fri, 18 May 2007 21:35:12 +0000 (21:35 +0000)
committerH.J. Lu <hjl@gcc.gnu.org>
Fri, 18 May 2007 21:35:12 +0000 (14:35 -0700)
2007-05-18  H.J. Lu  <hongjiu.lu@intel.com>

PR target/31989
PR target/31681
PR target/31666
* config/i386/i386.c (init_cumulative_args): Set maybe_vaarg to
true if function has no argument.

From-SVN: r124835

gcc/ChangeLog
gcc/config/i386/i386.c

index 630e06d..6033a60 100644 (file)
@@ -1,3 +1,11 @@
+2007-05-18  H.J. Lu  <hongjiu.lu@intel.com>
+
+       PR target/31989
+       PR target/31681
+       PR target/31666
+       * config/i386/i386.c (init_cumulative_args): Set maybe_vaarg to
+       true if function has no argument.
+
 2007-05-18  DJ Delorie  <dj@redhat.com>
 
        * config/mips/mips.c (mips_offset_within_alignment_p): New.
index 3c9445a..1bea8d7 100644 (file)
@@ -3051,7 +3051,10 @@ init_cumulative_args (CUMULATIVE_ARGS *cum,  /* Argument info to initialize */
     cum->mmx_nregs = MMX_REGPARM_MAX;
   cum->warn_sse = true;
   cum->warn_mmx = true;
-  cum->maybe_vaarg = (fntype ? type_has_variadic_args_p (fntype) : !libname);
+  cum->maybe_vaarg = (fntype
+                     ? (!TYPE_ARG_TYPES (fntype)
+                        || type_has_variadic_args_p (fntype))
+                     : !libname);
 
   if (!TARGET_64BIT)
     {