This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] PR 40219, avoid accessing outside built_in_decls array when computing tree hashes
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Michael Meissner <meissner at linux dot vnet dot ibm dot com>, gcc-patches at gcc dot gnu dot org
- Date: Fri, 22 May 2009 22:57:19 +0200
- Subject: Re: [PATCH] PR 40219, avoid accessing outside built_in_decls array when computing tree hashes
- References: <20090522204234.GA21113@hungry-tiger.westford.ibm.com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Fri, May 22, 2009 at 04:42:34PM -0400, Michael Meissner wrote:
> - /* When referring to a built-in FUNCTION_DECL, use the
> - __builtin__ form. Otherwise nodes that compare equal
> - according to operand_equal_p might get different
> - hash codes. */
> - if (DECL_BUILT_IN (t) && built_in_decls[DECL_FUNCTION_CODE (t)])
> + /* When referring to a built-in FUNCTION_DECL, use the __builtin__ form.
> + Otherwise nodes that compare equal according to operand_equal_p might
> + get different hash codes. However, don't do this for machine specific
> + or front end builtins, since the function code is overloaded in those
> + cases. */
> + if (DECL_BUILT_IN (t) && DECL_BUILT_IN_CLASS (t) == BUILT_IN_NORMAL
> + && built_in_decls[DECL_FUNCTION_CODE (t)])
Why not just
if (DECL_BUILT_IN_CLASS (t) == BUILT_IN_NORMAL
&& built_in_decls[DECL_FUNCTION_CODE (t)])
?
DECL_BUILT_IN (t) is DECL_BUILT_IN_CLASS (t) != NOT_BUILT_IN and
AFAIK almost all places that check for BUILT_IN_NORMAL only
check that and don't have DECL_BUILT_IN check before that
(I count 5 exceptions).
Jakub