This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Bug 20375 - ia64 varadic regression
- From: Jeffrey A Law <law at redhat dot com>
- To: Mark Mitchell <mark at codesourcery dot com>
- Cc: Nathan Sidwell <nathan at codesourcery dot com>, gcc <gcc at gcc dot gnu dot org>, Richard Henderson <rth at redhat dot com>, "Joseph S. Myers" <joseph at codesourcery dot com>
- Date: Tue, 08 Mar 2005 10:15:09 -0700
- Subject: Re: Bug 20375 - ia64 varadic regression
- Organization: Red Hat, Inc
- References: <422DCBEF.7010905@codesourcery.com> <422DDB83.7010501@codesourcery.com>
- Reply-to: law at redhat dot com
On Tue, 2005-03-08 at 09:06 -0800, Mark Mitchell wrote:
> Nathan Sidwell wrote:
>
> > Notice that the last specified argument 'union U' has no name. when
> > compiled for ia64-hp-hpux11.23 with -mlp64 this ICEs because of this
> > bit of code in assign_parm_find_data_types
> >
> > /* Set LAST_NAMED if this is last named arg before last anonymous
> > args. */
> > 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;
> > }
> >
> > That triggers on the float argument, not union. Naming the union
> > makes it trigger on the union, and compilation succeeds. This is
> > clearly wrong.
> >
> > The comment doesn't make sense, arguments with and without names can
> > be freely intermixed (in C++), and should not affect the ABI. As this
> > is to do with varadic parameters, is this really talking about the
> > last typed argument before the varadic ones?
>
> Yes, it must be. As you say, the current code is just plain bogus; the
> idea that the ABI would change for a C++ function depending on whether
> or not the argument is named is wrong, as, for example, function
> pointers would cease to work. I suspect this is a relic of our old
> implementation of varargs, and depended on the fact that C functions do
> not have unnamed arguments.
FWIW, there is actually a system which varies its ABI based on whether
or not an argument is named -- my old favorite, the 32bit PA SOM ABI
behaves in this manner. In fact, I believe it is the only port which
gives a hoot about this kind of thing.
Is it lame, absolutely. It was one of the many annoying discoveries
in my decade of PA hacking.
Jeff