http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60336

--- Comment #14 from H.J. Lu <hjl.tools at gmail dot com> ---
(In reply to H.J. Lu from comment #13)
> Passing
> 
> struct dummy { };
> 
> is still odd for g++.  It is supposed to have a single member of type char,
> which should be passed in register, not on stack.

This passes it in register:

diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 00773d8..6975ff1 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -6613,6 +6613,8 @@ classify_argument (enum machine_mode mode, const_tree
type,
         return 0;
       }
   }
+      if (mode == QImode && words == 1 && classes[0] == X86_64_NO_CLASS)
+  classes[0] = X86_64_INTEGERSI_CLASS;
       return words;
     }

Reply via email to