This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH, PR63229] fix assert in hash_table pch routines
- From: Richard Sandiford <richard dot sandiford at arm dot com>
- To: tsaunders at mozilla dot com
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Fri, 19 Sep 2014 11:23:11 +0100
- Subject: Re: [PATCH, PR63229] fix assert in hash_table pch routines
- Authentication-results: sourceware.org; auth=none
- References: <1410525265-18003-1-git-send-email-tsaunders at mozilla dot com>
tsaunders@mozilla.com writes:
> diff --git a/gcc/ChangeLog b/gcc/ChangeLog
> index c048672..5b27aa8 100644
> --- a/gcc/ChangeLog
> +++ b/gcc/ChangeLog
> @@ -1,3 +1,8 @@
> +2014-09-12 Trevor Saunders <tsaunders@mozilla.com>
> +
> + * hash-table.h (gt_pch_nx): don't call gt_pch_note_object within an
> + assert.
> +
> 2014-09-12 Joseph Myers <joseph@codesourcery.com>
>
> * target.def (libgcc_floating_mode_supported_p): New hook.
> diff --git a/gcc/hash-table.h b/gcc/hash-table.h
> index c2a68fd..028b7de 100644
> --- a/gcc/hash-table.h
> +++ b/gcc/hash-table.h
> @@ -1598,8 +1598,9 @@ template<typename D>
> static void
> gt_pch_nx (hash_table<D> *h)
> {
> - gcc_checking_assert (gt_pch_note_object (h->m_entries, h,
> - hashtab_entry_note_pointers<D>));
> + bool success ATTRIBUTE_UNUSED
> + = gt_pch_note_object (h->m_entries, h, hashtab_entry_note_pointers<D>);
> + gcc_checking_assert (success);
Do we need ATTRIBUTE_UNUSED here? I thought we tried to define
gcc_checking_assert so that its argument appeared used even when
asserts were disabled.
(Sorry for the nit.)
Thanks,
Richard