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]

Re: [C PATCH] Prevent -Wunused-value warning with __atomic_fetch_* (PR c/69407)


Hello!

> This is not a regression but I thought I'd post this anyway.  Martin reported
> that we generate -Wunused-value warnings on the attached testcase, which
> arguable doesn't make sense.  Setting TREE_USED suppresses the warning.  Since
> we already compute 'fetch_op' I used that.  (This warning doesn't trigger e.g.
> for __atomic_load/store/compare.)
>
> Bootstrapped/regtested on x86_64-linux, ok for trunk or gcc7?
>
> 2016-03-04  Marek Polacek  <polacek@redhat.com>
>
> PR c/69407
> * c-common.c (resolve_overloaded_builtin): Set TREE_USED for the fetch
> operations.
>
> * gcc.dg/atomic-op-6.c: New test.

You can probably revert my workaround [1] that suppressed these
warnings in libsupc++/guard.cc.

[1] https://gcc.gnu.org/ml/gcc-patches/2015-07/msg00023.html

Uros.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]