This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Bug 20375 - ia64 varadic regression
- From: Mark Mitchell <mark at codesourcery dot com>
- To: Zack Weinberg <zack at codesourcery dot com>
- Cc: Nathan Sidwell <nathan at codesourcery dot com>, Dave Korn <dave dot korn at artimi dot com>,'Andrew Pinski' <pinskia at physics dot uc dot edu>, "'Joseph S. Myers'" <joseph at codesourcery dot com>,'Richard Henderson' <rth at redhat dot com>, 'gcc' <gcc at gcc dot gnu dot org>
- Date: Tue, 08 Mar 2005 16:18:08 -0800
- Subject: Re: Bug 20375 - ia64 varadic regression
- Organization: CodeSourcery, LLC
- References: <SERRANOaGidX0UZ07MX00000014@SERRANO.CAM.ARTIMI.COM> <422DE418.9060202@codesourcery.com> <87hdjmj8qa.fsf@codesourcery.com>
Zack Weinberg wrote:
It would certainly be nice to get rid of this mess, but Jim Wilson
expressed concerns last time it came up:
<http://gcc.gnu.org/ml/gcc-patches/2004-01/msg03213.html>
Well, sidestepping that, what the compiler really seems to want is "the
last argument that was declared by the user" rather than "the last
parameter with a name". We have a good way of determining that: it's
just the last parameter, nowadays, given that we've no longer got
varargs to worry about. So can't we just fix this loop:
if (current_function_stdarg)
{
tree tem;
for (tem = TREE_CHAIN (parm); tem; tem = TREE_CHAIN (tem))
if (DECL_NAME (tem))
break;
if (tem == 0)
data->last_named = true;
}
to iterate until the end of the loop, without checking DECL_NAME?
In C, this is not an ABI change because all parameters are named. And,
here, we're looking at the definition of the function, not a prototype.
In C++, this is an ABI change in that an unnamed parameter directly
proceeding the ellipsis will now be treated as named, rather than
unnamed. That's clearly correct, but it will change the C++ ABI on
those platforms where this makes a difference.
I would call this sufficiently much a corner case as to say that we
should just go ahead and do it. If we're truly paranoid, we can make
this dependent on flag_abi_version.
--
Mark Mitchell
CodeSourcery, LLC
mark@codesourcery.com
(916) 791-8304