This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix ICE on sprintf (p, "%s") and miscompilation of sprintf (p, "a", q++) (PR middle-end/30473)
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Ian Lance Taylor <iant at google dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Thu, 1 Feb 2007 17:36:30 -0500
- Subject: Re: [PATCH] Fix ICE on sprintf (p, "%s") and miscompilation of sprintf (p, "a", q++) (PR middle-end/30473)
- References: <20070201133323.GG27294@devserv.devel.redhat.com> <m3hcu5qzuh.fsf@localhost.localdomain>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Thu, Feb 01, 2007 at 02:26:14PM -0800, Ian Lance Taylor wrote:
> > + arglist = TREE_CHAIN (TREE_CHAIN (arglist));
>
> Please use a new variable here, e.g., third_argument, rather than
> reusing arglist. New variables are fairly cheap, and I think it will
> make the rest of the patch more comprehensible.
I tried to follow all other {fold,expand}_builtin_*printf* routines which
also advance arglist (the big difference is that they usually don't
call verify_arglist but validate it by hand).
third_argument would be a wrong name, as 3rd argument really is
TREE_VALUE (TREE_CHAIN (TREE_CHAIN (arglist))), but guess this can
be called args or something similar.
> I assume you bootstrapped it--you didn't say.
Nope, because trunk didn't bootstrap this morning, but I certainly
will bootstrap/regression test it before committing.
Jakub