This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH 15/14] Use fold_for_warn in get_atomic_generic_size
- From: Jason Merrill <jason at redhat dot com>
- To: David Malcolm <dmalcolm at redhat dot com>
- Cc: Nathan Sidwell <nathan at acm dot org>, Jakub Jelinek <jakub at redhat dot com>, Richard Biener <richard dot guenther at gmail dot com>, gcc-patches List <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 19 Dec 2017 15:35:06 -0500
- Subject: Re: [PATCH 15/14] Use fold_for_warn in get_atomic_generic_size
- Authentication-results: sourceware.org; auth=none
- References: <1510350329-48956-1-git-send-email-dmalcolm@redhat.com> <1513473175-61128-1-git-send-email-dmalcolm@redhat.com>
On Sat, Dec 16, 2017 at 8:12 PM, David Malcolm <dmalcolm@redhat.com> wrote:
> I rebased the v2 patchkit; here's an extra patch to fix an issue
> with it uncovered by a recently-added testcase (in r254990).
>
> With the patch kit, but without this patch, g++'s
> c-c++-common/pr83059.c
> fails to emit the "invalid memory model argument 6" warning.
>
> Successfully bootstrapped®rtested on x86_64-pc-linux-gnu, as
> part of the kit.
>
> Is this OK for trunk, assuming the rest of the kit is approved?
>
> gcc/c-family/ChangeLog:
> * c-common.c (get_atomic_generic_size): Call fold_for_warn on the
> params before checking for INTEGER_CST.
> ---
> gcc/c-family/c-common.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/gcc/c-family/c-common.c b/gcc/c-family/c-common.c
> index 3438b87..ab03b7d 100644
> --- a/gcc/c-family/c-common.c
> +++ b/gcc/c-family/c-common.c
> @@ -6720,7 +6720,7 @@ get_atomic_generic_size (location_t loc, tree function,
> /* Check memory model parameters for validity. */
> for (x = n_param - n_model ; x < n_param; x++)
> {
> - tree p = (*params)[x];
> + tree p = fold_for_warn ((*params)[x]);
> if (TREE_CODE (p) == INTEGER_CST)
> {
> /* memmodel_base masks the low 16 bits, thus ignore any bits above
Let's check the error case before we call fold_for_warn.
Jason