This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch i386] Fix detection of va_list type for w64.


Kai Tietz wrote:
Hi Uros,

2008/7/7 Uros Bizjak <ubizjak@gmail.com>:
Hello!

2008-07-07 Kai Tietz <kai.tietz@onevision.com>

       * config/i386.c (is_va_list_pointer_char): New.
       (ix86_va_start): Replace compare with ms_va_list_type_node
       by call of is_va_list_pointer_char.
       (ix86_gimplify_va_arg): Likewise.

Bootstraped on x86_64-pc-linux64 and x86_64-pc-mingw32 without
regressions.
Ok for apply?

Please add something like following to both call sites:

if (!TARGET_64BIT
|| ix86_canonical_va_list_type (TREE_TYPE (valist)) ==
(DEFAULT_ABI == MS_ABI) ? ms_va_list_type_node : va_list_type_node)
{

This would be wrong, because - as I wrote - both return values are
possible for w64. This is depent on the use of the
__builtin_ms_va_list or __builtin_va_list, and on the use in context
of x86_64 or in w64 itself. Your suggested replacement just checks for
one case, which is just the half of the job here.
The method checks for both types, which is the fix.

Thanks for the explanation! Please go ahead with your original patch then. Also, please fix the comment before is_va_list_pointer_char. Return value is obvious from the function name ;)


Thanks,
Uros.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]