public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/60195] New: Strange warnings using atomic types
@ 2014-02-14 14:17 jp.deplaix at gmail dot com
  2014-02-17 20:42 ` [Bug c/60195] " mpolacek at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: jp.deplaix at gmail dot com @ 2014-02-14 14:17 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60195

            Bug ID: 60195
           Summary: Strange warnings using atomic types
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jp.deplaix at gmail dot com

Created attachment 32134
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=32134&action=edit
Test case

Two warnings are raised while compiling the attached test-case.

The first one in the function f:

warning: variable 'y' set but not used

but clearly it is. For example if you replace atomic_int by int here, the
warning desapears.

The second one in the function g at the line of « y = 0 »:

warning: right-hand operand of comma has no effect

this warning make no sense, since there is no comma at this line.


This was experienced with gcc 4.9.0 20140111 for the first warning and gcc
4.9.0 20140213 for both warnings.
>From gcc-bugs-return-443560-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Fri Feb 14 14:32:36 2014
Return-Path: <gcc-bugs-return-443560-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 4897 invoked by alias); 14 Feb 2014 14:32:35 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 4844 invoked by uid 55); 14 Feb 2014 14:32:32 -0000
From: "tejohnson at google dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug middle-end/60175] ICE on gcc.dg/asan/nosanitize-and-inline.c
Date: Fri, 14 Feb 2014 14:32:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: middle-end
X-Bugzilla-Version: 4.9.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: tejohnson at google dot com
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-60175-4-EbTiOWhFP0@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-60175-4@http.gcc.gnu.org/bugzilla/>
References: <bug-60175-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2014-02/txt/msg01317.txt.bz2
Content-length: 1058

http://gcc.gnu.org/bugzilla/show_bug.cgi?id`175

--- Comment #4 from Teresa Johnson <tejohnson at google dot com> ---
On Fri, Feb 14, 2014 at 1:01 AM, y.gribov at samsung dot com
<gcc-bugzilla@gcc.gnu.org> wrote:
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id`175
>
> Yury Gribov <y.gribov at samsung dot com> changed:
>
>            What    |Removed                     |Added
> ----------------------------------------------------------------------------
>                  CC|                            |hubicka at gcc dot gnu.org,
>                    |                            |tejohnson at google dot com
>
> --- Comment #3 from Yury Gribov <y.gribov at samsung dot com> ---
> Adding Jan and Teresa (who worked on this piece of code) to comment on proposed
> patch.

The patch looks good to me, but I can't approve. The other calls to
combine_probabilities from this module look ok to me, but this one
should be apply_probability as you note.

Thanks,
Teresa

>
> --
> You are receiving this mail because:
> You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug c/60195] Strange warnings using atomic types
  2014-02-14 14:17 [Bug c/60195] New: Strange warnings using atomic types jp.deplaix at gmail dot com
@ 2014-02-17 20:42 ` mpolacek at gcc dot gnu.org
  2014-02-19  6:30 ` mpolacek at gcc dot gnu.org
  2014-02-19  6:31 ` mpolacek at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2014-02-17 20:42 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60195

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2014-02-17
                 CC|                            |mpolacek at gcc dot gnu.org
     Ever confirmed|0                           |1

--- Comment #1 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Confirmed.  Mine for now.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug c/60195] Strange warnings using atomic types
  2014-02-14 14:17 [Bug c/60195] New: Strange warnings using atomic types jp.deplaix at gmail dot com
  2014-02-17 20:42 ` [Bug c/60195] " mpolacek at gcc dot gnu.org
@ 2014-02-19  6:30 ` mpolacek at gcc dot gnu.org
  2014-02-19  6:31 ` mpolacek at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2014-02-19  6:30 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60195

--- Comment #2 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Author: mpolacek
Date: Wed Feb 19 06:29:49 2014
New Revision: 207873

URL: http://gcc.gnu.org/viewcvs?rev=207873&root=gcc&view=rev
Log:
    PR c/60195
c/
    * c-typeck.c (convert_lvalue_to_rvalue): Set TREE_NO_WARNING on tmp.
    Call mark_exp_read on exp.value.
    (build_atomic_assign): Set TREE_NO_WARNING on val and old.  Set
    TREE_ADDRESSABLE on old instead of val.
    (emit_side_effect_warnings): Warn only if RHS has !TREE_NO_WARNING.
testsuite/
    * gcc.dg/pr60195.c: New test.


Added:
    trunk/gcc/testsuite/gcc.dg/pr60195.c
Modified:
    trunk/gcc/c/ChangeLog
    trunk/gcc/c/c-typeck.c
    trunk/gcc/testsuite/ChangeLog


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug c/60195] Strange warnings using atomic types
  2014-02-14 14:17 [Bug c/60195] New: Strange warnings using atomic types jp.deplaix at gmail dot com
  2014-02-17 20:42 ` [Bug c/60195] " mpolacek at gcc dot gnu.org
  2014-02-19  6:30 ` mpolacek at gcc dot gnu.org
@ 2014-02-19  6:31 ` mpolacek at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2014-02-19  6:31 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60195

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED
   Target Milestone|---                         |4.9.0

--- Comment #3 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Hopefully fixed.


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-02-19  6:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-14 14:17 [Bug c/60195] New: Strange warnings using atomic types jp.deplaix at gmail dot com
2014-02-17 20:42 ` [Bug c/60195] " mpolacek at gcc dot gnu.org
2014-02-19  6:30 ` mpolacek at gcc dot gnu.org
2014-02-19  6:31 ` mpolacek at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).