This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [C++ PATCH] Fix up DECL_ARG_TYPE (PR c++/36631)
On Tue, Nov 18, 2008 at 07:00:29PM -0500, Jason Merrill wrote:
> I note that the code in gimplify_call_expr is the only place in the
> compiler that checks the DECL_ARG_TYPE of a called function; everywhere
> else only uses it for the parameters of the function currently being
> compiled. This is why this mismatch has not been a problem in the past.
> Perhaps gimplify_call_expr shouldn't be relying on it?
Using just TREE_TYPE of the PARM_DECL isn't any better with the C++ FE,
that's also incorrect until the function has been through
cp_genericize. And it would be wrong for types smaller than int
which are promoted to int.
As I said earlier, I can easily move this checking from gimplify_call_expr
until gimple lowering, at which point the C++ FE should be through
cp_genericize with most of the functions (exceptions are late generated
functions, e.g. during OpenMP lowering, but those can handle DECL_ARG_TYPE
explicitly in the langhooks). This would make DECL_ARG_TYPE correct
for all functions that can be inlined (where bodies exist), but still
DECL_ARG_TYPE (and TREE_TYPE) of PARM_DECLs would be wrong for DECL_EXTERNAL
functions.
Jakub