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] |
On Sat, 9 Oct 2004 23:57:02 -0400, Andrew Pinski <pinskia@physics.uc.edu> wrote:
This patch fixes that by copying some code from builtins.c into gimplify.c.
We could make an fold_builtin_va_start which does this, if someone wants
me to do this, just ask.
Please.
Actually there is already a function which does this, fold_builtin_next_arg. I exported it and made it return true if a warning (undefined behavior) or error (fatal problem) so that we don't get two or more warnings/errors for the same problem. I also changed it so every place where we used fold_builtin_next_arg before, we would just return const0_rtx (because these were in the expander). There is still some clean up possible in builtins.c but that is for another day.
Thanks, Andrew Pinski
* builtins.c (fold_builtin_next_arg): Export and return true when there is a warning or an error. (expand_builtin_va_start): When fold_builtin_next_arg returns true, return const0_rtx. (expand_builtin): Likewise. * gimplify.c (gimplify_call_expr): Error out if there is not enough arguments to va_start. Call fold_builtin_next_arg also on the second argument.
Attachment:
temp.diff.txt
Description: Text document
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |