public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/58950] New: [4.9 Regression] Missing "statement has no effect"
@ 2013-10-31 23:11 glisse at gcc dot gnu.org
  2013-11-19  9:49 ` [Bug c++/58950] " rguenth at gcc dot gnu.org
                   ` (25 more replies)
  0 siblings, 26 replies; 27+ messages in thread
From: glisse at gcc dot gnu.org @ 2013-10-31 23:11 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 58950
           Summary: [4.9 Regression] Missing "statement has no effect"
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Keywords: diagnostic
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: glisse at gcc dot gnu.org

void f(){
  int i __attribute__((vector_size(2*sizeof(int)))) = { 2, 3 };
  __builtin_shuffle (i, i);
}

g++-4.8:
x.c:3:3: warning: statement has no effect [-Wunused-value]

gcc-4.9:
x.c:3:3: warning: value computed is not used [-Wunused-value]

g++-4.9: nothing :-(
We do warn for i+i, but not for (i+i) (again this is missing only in C++).


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

* [Bug c++/58950] [4.9 Regression] Missing "statement has no effect"
  2013-10-31 23:11 [Bug c++/58950] New: [4.9 Regression] Missing "statement has no effect" glisse at gcc dot gnu.org
@ 2013-11-19  9:49 ` rguenth at gcc dot gnu.org
  2013-11-19 10:43 ` rguenth at gcc dot gnu.org
                   ` (24 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: rguenth at gcc dot gnu.org @ 2013-11-19  9:49 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.9.0


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

* [Bug c++/58950] [4.9 Regression] Missing "statement has no effect"
  2013-10-31 23:11 [Bug c++/58950] New: [4.9 Regression] Missing "statement has no effect" glisse at gcc dot gnu.org
  2013-11-19  9:49 ` [Bug c++/58950] " rguenth at gcc dot gnu.org
@ 2013-11-19 10:43 ` rguenth at gcc dot gnu.org
  2013-11-25 22:49 ` glisse at gcc dot gnu.org
                   ` (23 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: rguenth at gcc dot gnu.org @ 2013-11-19 10:43 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P1
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2013-11-19
     Ever confirmed|0                           |1

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
Confirmed.


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

* [Bug c++/58950] [4.9 Regression] Missing "statement has no effect"
  2013-10-31 23:11 [Bug c++/58950] New: [4.9 Regression] Missing "statement has no effect" glisse at gcc dot gnu.org
  2013-11-19  9:49 ` [Bug c++/58950] " rguenth at gcc dot gnu.org
  2013-11-19 10:43 ` rguenth at gcc dot gnu.org
@ 2013-11-25 22:49 ` glisse at gcc dot gnu.org
  2013-11-26  6:14 ` glisse at gcc dot gnu.org
                   ` (22 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: glisse at gcc dot gnu.org @ 2013-11-25 22:49 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Marc Glisse <glisse at gcc dot gnu.org> ---
For __builtin_shuffle, the issue is that we now call save_expr, which always
sets TREE_SIDE_EFFECTS to 1. I don't know if it would make sense to introduce a
maybe_save_expr that is equivalent to save_expr but does not set
TREE_SIDE_EFFECTS if its argument doesn't have it. But in any case I think we
still want to warn for an unused result in __builtin_shuffle(x,++m) so that's
not the solution. In C we also have the side_effects_flag but we still warn in
warn_if_unused_value (the default for unknown trees), whereas in C++ (near the
end of convert_to_void in cvt.c) only some tcc_comparison, tcc_unary and
tcc_binary can warn when they have side effects. It would be easy to add
VEC_PERM_EXPR to the list and get a "value computed is not used", I just don't
know if something more general is possible.

For (i+i), the PLUS_EXPR ends up with nowarning_flag = 1 somehow.


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

* [Bug c++/58950] [4.9 Regression] Missing "statement has no effect"
  2013-10-31 23:11 [Bug c++/58950] New: [4.9 Regression] Missing "statement has no effect" glisse at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2013-11-25 22:49 ` glisse at gcc dot gnu.org
@ 2013-11-26  6:14 ` glisse at gcc dot gnu.org
  2013-11-26  8:18 ` ebotcazou at gcc dot gnu.org
                   ` (21 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: glisse at gcc dot gnu.org @ 2013-11-26  6:14 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Marc Glisse <glisse at gcc dot gnu.org> ---
(In reply to Manuel López-Ibáñez from comment #3)
> You could decorate __builtin_shuffle with attribute "warn_unused_result". It
> is not the same, but it probably more precise. It would also warn for:
> __builtin_shuffle(x,++m), while -Wunused-value would not.

Would it? The front-ends replace __builtin_shuffle with VEC_PERM_EXPR quite
early. I am not even sure we have a function type to which we could attach the
attribute.
>From gcc-bugs-return-435858-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Tue Nov 26 06:56:20 2013
Return-Path: <gcc-bugs-return-435858-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 30150 invoked by alias); 26 Nov 2013 06:56:20 -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 30087 invoked by uid 48); 26 Nov 2013 06:56:15 -0000
From: "kcc at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug sanitizer/59286] segfault in  __sanitizer::StackDepotGet
Date: Tue, 26 Nov 2013 06:56:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: sanitizer
X-Bugzilla-Version: 4.9.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: kcc at gcc dot gnu.org
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-59286-4-qMp6VIFAjh@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-59286-4@http.gcc.gnu.org/bugzilla/>
References: <bug-59286-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: 2013-11/txt/msg02635.txt.bz2
Content-length: 155

http://gcc.gnu.org/bugzilla/show_bug.cgi?idY286

--- Comment #1 from Kostya Serebryany <kcc at gcc dot gnu.org> ---
does this happen with clang's tsan?


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

* [Bug c++/58950] [4.9 Regression] Missing "statement has no effect"
  2013-10-31 23:11 [Bug c++/58950] New: [4.9 Regression] Missing "statement has no effect" glisse at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2013-11-26  6:14 ` glisse at gcc dot gnu.org
@ 2013-11-26  8:18 ` ebotcazou at gcc dot gnu.org
  2013-11-26 19:58 ` glisse at gcc dot gnu.org
                   ` (20 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: ebotcazou at gcc dot gnu.org @ 2013-11-26  8:18 UTC (permalink / raw)
  To: gcc-bugs

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

Eric Botcazou <ebotcazou at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ebotcazou at gcc dot gnu.org

--- Comment #5 from Eric Botcazou <ebotcazou at gcc dot gnu.org> ---
> For __builtin_shuffle, the issue is that we now call save_expr, which always
> sets TREE_SIDE_EFFECTS to 1. I don't know if it would make sense to
> introduce a maybe_save_expr that is equivalent to save_expr but does not set
> TREE_SIDE_EFFECTS if its argument doesn't have it.

No, this would defeat the purpose of the SAVE_EXPR, since you could duplicate
the expression or move it at will, leading to nasty order of evaluation issues.


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

* [Bug c++/58950] [4.9 Regression] Missing "statement has no effect"
  2013-10-31 23:11 [Bug c++/58950] New: [4.9 Regression] Missing "statement has no effect" glisse at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2013-11-26  8:18 ` ebotcazou at gcc dot gnu.org
@ 2013-11-26 19:58 ` glisse at gcc dot gnu.org
  2013-11-30 15:12 ` glisse at gcc dot gnu.org
                   ` (19 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: glisse at gcc dot gnu.org @ 2013-11-26 19:58 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Marc Glisse <glisse at gcc dot gnu.org> ---
For:

void f(){
  int i = 2;
  (i+i);
}

we always set TREE_NOWARNING in finish_parenthesized_expr. The comment next to
it says this is to avoid warning in c_common_truthvalue_conversion. If that's
the only reason, the hammer seems a bit heavy, in C we only set the bit for
MODIFY_EXPR.


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

* [Bug c++/58950] [4.9 Regression] Missing "statement has no effect"
  2013-10-31 23:11 [Bug c++/58950] New: [4.9 Regression] Missing "statement has no effect" glisse at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2013-11-26 19:58 ` glisse at gcc dot gnu.org
@ 2013-11-30 15:12 ` glisse at gcc dot gnu.org
  2013-11-30 15:36 ` glisse at gcc dot gnu.org
                   ` (18 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: glisse at gcc dot gnu.org @ 2013-11-30 15:12 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from Marc Glisse <glisse at gcc dot gnu.org> ---
Created attachment 31342
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=31342&action=edit
patch

The __builtin_shuffle part of the patch seems fine.

For (i+i), I first tried not setting TREE_NOWARNING on things that are not
MODIFY_EXPR (as in the C front-end), but apparently that's how the warning for
logical ops is disabled for a || (b && c), so that's not ok. The current patch
breaks g++.dg/ext/vla13.C (PR 54583), but nothing else covered by the
testsuite, so it is tempting to see if there are other ways to fix PR 54583.


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

* [Bug c++/58950] [4.9 Regression] Missing "statement has no effect"
  2013-10-31 23:11 [Bug c++/58950] New: [4.9 Regression] Missing "statement has no effect" glisse at gcc dot gnu.org
                   ` (6 preceding siblings ...)
  2013-11-30 15:12 ` glisse at gcc dot gnu.org
@ 2013-11-30 15:36 ` glisse at gcc dot gnu.org
  2013-11-30 17:07 ` ebotcazou at gcc dot gnu.org
                   ` (17 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: glisse at gcc dot gnu.org @ 2013-11-30 15:36 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 from Marc Glisse <glisse at gcc dot gnu.org> ---
(In reply to Eric Botcazou from comment #5)
> > For __builtin_shuffle, the issue is that we now call save_expr, which always
> > sets TREE_SIDE_EFFECTS to 1. I don't know if it would make sense to
> > introduce a maybe_save_expr that is equivalent to save_expr but does not set
> > TREE_SIDE_EFFECTS if its argument doesn't have it.
> 
> No, this would defeat the purpose of the SAVE_EXPR, since you could
> duplicate the expression or move it at will, leading to nasty order of
> evaluation issues.

What I meant was, there are many places in the front-end that do:

if (TREE_SIDE_EFFECTS (op0)) op0 = save_expr (op0);

and I'd like to replace it with

op0 = maybe_save_expr (op0);

that would do the same thing to begin with. Now, if op0 is a long expression
without side-effects, the code I quoted will not call save_expr, it will
duplicate the expression and count on CSE for dedup, whereas we could imagine
having a single version to start with, that optimizations would still be
allowed to duplicate as usual if they consider it worth it.

Of course the uses of SAVE_EXPR that require the stronger protection would be
left alone.

I may still not be making sense, but at least I think I was a little more
precise about what I meant ;-)


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

* [Bug c++/58950] [4.9 Regression] Missing "statement has no effect"
  2013-10-31 23:11 [Bug c++/58950] New: [4.9 Regression] Missing "statement has no effect" glisse at gcc dot gnu.org
                   ` (7 preceding siblings ...)
  2013-11-30 15:36 ` glisse at gcc dot gnu.org
@ 2013-11-30 17:07 ` ebotcazou at gcc dot gnu.org
  2014-01-03  3:29 ` jason at gcc dot gnu.org
                   ` (16 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: ebotcazou at gcc dot gnu.org @ 2013-11-30 17:07 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #9 from Eric Botcazou <ebotcazou at gcc dot gnu.org> ---
> What I meant was, there are many places in the front-end that do:
> 
> if (TREE_SIDE_EFFECTS (op0)) op0 = save_expr (op0);
> 
> and I'd like to replace it with
> 
> op0 = maybe_save_expr (op0);
> 
> that would do the same thing to begin with. Now, if op0 is a long expression
> without side-effects, the code I quoted will not call save_expr, it will
> duplicate the expression and count on CSE for dedup, whereas we could
> imagine having a single version to start with, that optimizations would
> still be allowed to duplicate as usual if they consider it worth it.

Yes, we do something like that in the Ada front-end, i.e. we call save_expr for
complex expressions without side-effects, see e.g. utils2.c:gnat_protect_expr.
But once the SAVE_EXPR is built, you *cannot* remove TREE_SIDE_EFFECTS on it,
or else you'll run into nasty order of evaluation issues.


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

* [Bug c++/58950] [4.9 Regression] Missing "statement has no effect"
  2013-10-31 23:11 [Bug c++/58950] New: [4.9 Regression] Missing "statement has no effect" glisse at gcc dot gnu.org
                   ` (8 preceding siblings ...)
  2013-11-30 17:07 ` ebotcazou at gcc dot gnu.org
@ 2014-01-03  3:29 ` jason at gcc dot gnu.org
  2014-01-03 10:35 ` glisse at gcc dot gnu.org
                   ` (15 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: jason at gcc dot gnu.org @ 2014-01-03  3:29 UTC (permalink / raw)
  To: gcc-bugs

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

Jason Merrill <jason at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jason at gcc dot gnu.org

--- Comment #10 from Jason Merrill <jason at gcc dot gnu.org> ---
(In reply to Marc Glisse from comment #7)
> The __builtin_shuffle part of the patch seems fine.

Yes, that looks right.  That fixes the bug, yes?

The maybe_save_expr idea also makes sense to me, but doesn't seem necessary to
fix this.


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

* [Bug c++/58950] [4.9 Regression] Missing "statement has no effect"
  2013-10-31 23:11 [Bug c++/58950] New: [4.9 Regression] Missing "statement has no effect" glisse at gcc dot gnu.org
                   ` (9 preceding siblings ...)
  2014-01-03  3:29 ` jason at gcc dot gnu.org
@ 2014-01-03 10:35 ` glisse at gcc dot gnu.org
  2014-01-03 21:12 ` glisse at gcc dot gnu.org
                   ` (14 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: glisse at gcc dot gnu.org @ 2014-01-03 10:35 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #11 from Marc Glisse <glisse at gcc dot gnu.org> ---
(In reply to Jason Merrill from comment #10)
> (In reply to Marc Glisse from comment #7)
> > The __builtin_shuffle part of the patch seems fine.
> 
> Yes, that looks right.  That fixes the bug, yes?

It fixes this half of the bug, yes. I'll regtest it separately.


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

* [Bug c++/58950] [4.9 Regression] Missing "statement has no effect"
  2013-10-31 23:11 [Bug c++/58950] New: [4.9 Regression] Missing "statement has no effect" glisse at gcc dot gnu.org
                   ` (10 preceding siblings ...)
  2014-01-03 10:35 ` glisse at gcc dot gnu.org
@ 2014-01-03 21:12 ` glisse at gcc dot gnu.org
  2014-01-03 21:19 ` [Bug c++/58950] " glisse at gcc dot gnu.org
                   ` (13 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: glisse at gcc dot gnu.org @ 2014-01-03 21:12 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #12 from Marc Glisse <glisse at gcc dot gnu.org> ---
Author: glisse
Date: Fri Jan  3 21:12:48 2014
New Revision: 206325

URL: http://gcc.gnu.org/viewcvs?rev=206325&root=gcc&view=rev
Log:
2014-01-03  Marc Glisse  <marc.glisse@inria.fr>

    PR c++/58950
gcc/cp/
    * cvt.c (convert_to_void): Handle VEC_PERM_EXPR and VEC_COND_EXPR.
gcc/testsuite/
    * g++.dg/pr58950.C: New file.

Added:
    trunk/gcc/testsuite/g++.dg/pr58950.C   (with props)
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/cvt.c
    trunk/gcc/testsuite/ChangeLog

Propchange: trunk/gcc/testsuite/g++.dg/pr58950.C
            ('svn:eol-style' added)

Propchange: trunk/gcc/testsuite/g++.dg/pr58950.C
            ('svn:keywords' added)


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

* [Bug c++/58950] Missing "statement has no effect"
  2013-10-31 23:11 [Bug c++/58950] New: [4.9 Regression] Missing "statement has no effect" glisse at gcc dot gnu.org
                   ` (11 preceding siblings ...)
  2014-01-03 21:12 ` glisse at gcc dot gnu.org
@ 2014-01-03 21:19 ` glisse at gcc dot gnu.org
  2014-02-24 15:26 ` glisse at gcc dot gnu.org
                   ` (12 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: glisse at gcc dot gnu.org @ 2014-01-03 21:19 UTC (permalink / raw)
  To: gcc-bugs

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

Marc Glisse <glisse at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[4.9 Regression] Missing    |Missing "statement has no
                   |"statement has no effect"   |effect"

--- Comment #13 from Marc Glisse <glisse at gcc dot gnu.org> ---
Testcase for the remaining part of the PR:

void f(){
  int i=2;
  (i+i); // should warn with -Wall
}


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

* [Bug c++/58950] Missing "statement has no effect"
  2013-10-31 23:11 [Bug c++/58950] New: [4.9 Regression] Missing "statement has no effect" glisse at gcc dot gnu.org
                   ` (12 preceding siblings ...)
  2014-01-03 21:19 ` [Bug c++/58950] " glisse at gcc dot gnu.org
@ 2014-02-24 15:26 ` glisse at gcc dot gnu.org
  2014-02-24 16:09 ` paolo.carlini at oracle dot com
                   ` (11 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: glisse at gcc dot gnu.org @ 2014-02-24 15:26 UTC (permalink / raw)
  To: gcc-bugs

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

Marc Glisse <glisse at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |paolo.carlini at oracle dot com

--- Comment #14 from Marc Glisse <glisse at gcc dot gnu.org> ---
(In reply to Marc Glisse from comment #7)
> The current
> patch breaks g++.dg/ext/vla13.C (PR 54583), but nothing else covered by the
> testsuite, so it is tempting to see if there are other ways to fix PR 54583.

Paolo, do you have an opinion on this PR?


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

* [Bug c++/58950] Missing "statement has no effect"
  2013-10-31 23:11 [Bug c++/58950] New: [4.9 Regression] Missing "statement has no effect" glisse at gcc dot gnu.org
                   ` (13 preceding siblings ...)
  2014-02-24 15:26 ` glisse at gcc dot gnu.org
@ 2014-02-24 16:09 ` paolo.carlini at oracle dot com
  2014-02-24 16:15 ` glisse at gcc dot gnu.org
                   ` (10 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: paolo.carlini at oracle dot com @ 2014-02-24 16:09 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #15 from Paolo Carlini <paolo.carlini at oracle dot com> ---
I don't think you simply want a better fix for 54583, because for the testcase
in #Comment 13 the new conditional setting TREE_NO_WARNING isn't used.
Otherwise, I think it would be easy to tighten it via array_of_runtime_bound_p.


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

* [Bug c++/58950] Missing "statement has no effect"
  2013-10-31 23:11 [Bug c++/58950] New: [4.9 Regression] Missing "statement has no effect" glisse at gcc dot gnu.org
                   ` (14 preceding siblings ...)
  2014-02-24 16:09 ` paolo.carlini at oracle dot com
@ 2014-02-24 16:15 ` glisse at gcc dot gnu.org
  2014-02-24 16:19 ` paolo.carlini at oracle dot com
                   ` (9 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: glisse at gcc dot gnu.org @ 2014-02-24 16:15 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #16 from Marc Glisse <glisse at gcc dot gnu.org> ---
(In reply to Paolo Carlini from comment #15)
> I don't think you simply want a better fix for 54583, because for the
> testcase in #Comment 13 the new conditional setting TREE_NO_WARNING isn't
> used. Otherwise, I think it would be easy to tighten it via
> array_of_runtime_bound_p.

The issue isn't with setting the bit but reading it. If you look at the patch,
I remove a test for TREE_NO_WARNING (expr). This breaks 54583 because the
TREE_NO_WARNING bit is then ignored.


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

* [Bug c++/58950] Missing "statement has no effect"
  2013-10-31 23:11 [Bug c++/58950] New: [4.9 Regression] Missing "statement has no effect" glisse at gcc dot gnu.org
                   ` (15 preceding siblings ...)
  2014-02-24 16:15 ` glisse at gcc dot gnu.org
@ 2014-02-24 16:19 ` paolo.carlini at oracle dot com
  2014-04-22 11:36 ` jakub at gcc dot gnu.org
                   ` (8 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: paolo.carlini at oracle dot com @ 2014-02-24 16:19 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #17 from Paolo Carlini <paolo.carlini at oracle dot com> ---
Yes, I know that. What I'm saying is that other code may want to see that
TREE_NO_WARNING honored, the issue doesn't have much to do with 54583 per se.
In my personal opinion removing a TREE_NO_WARNING check is in general a pretty
risky thing to do, because unfortunately we have only that generic bit and we
use it in many different circumstances.


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

* [Bug c++/58950] Missing "statement has no effect"
  2013-10-31 23:11 [Bug c++/58950] New: [4.9 Regression] Missing "statement has no effect" glisse at gcc dot gnu.org
                   ` (16 preceding siblings ...)
  2014-02-24 16:19 ` paolo.carlini at oracle dot com
@ 2014-04-22 11:36 ` jakub at gcc dot gnu.org
  2014-07-16 13:27 ` jakub at gcc dot gnu.org
                   ` (7 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: jakub at gcc dot gnu.org @ 2014-04-22 11:36 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.9.0                       |4.9.1

--- Comment #18 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
GCC 4.9.0 has been released


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

* [Bug c++/58950] Missing "statement has no effect"
  2013-10-31 23:11 [Bug c++/58950] New: [4.9 Regression] Missing "statement has no effect" glisse at gcc dot gnu.org
                   ` (17 preceding siblings ...)
  2014-04-22 11:36 ` jakub at gcc dot gnu.org
@ 2014-07-16 13:27 ` jakub at gcc dot gnu.org
  2014-10-30 10:38 ` jakub at gcc dot gnu.org
                   ` (6 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: jakub at gcc dot gnu.org @ 2014-07-16 13:27 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58950

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.9.1                       |4.9.2

--- Comment #19 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
GCC 4.9.1 has been released.


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

* [Bug c++/58950] Missing "statement has no effect"
  2013-10-31 23:11 [Bug c++/58950] New: [4.9 Regression] Missing "statement has no effect" glisse at gcc dot gnu.org
                   ` (18 preceding siblings ...)
  2014-07-16 13:27 ` jakub at gcc dot gnu.org
@ 2014-10-30 10:38 ` jakub at gcc dot gnu.org
  2015-04-08  9:32 ` mpolacek at gcc dot gnu.org
                   ` (5 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: jakub at gcc dot gnu.org @ 2014-10-30 10:38 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58950

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.9.2                       |4.9.3

--- Comment #20 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
GCC 4.9.2 has been released.


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

* [Bug c++/58950] Missing "statement has no effect"
  2013-10-31 23:11 [Bug c++/58950] New: [4.9 Regression] Missing "statement has no effect" glisse at gcc dot gnu.org
                   ` (19 preceding siblings ...)
  2014-10-30 10:38 ` jakub at gcc dot gnu.org
@ 2015-04-08  9:32 ` mpolacek at gcc dot gnu.org
  2015-06-26 20:04 ` jakub at gcc dot gnu.org
                   ` (4 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2015-04-08  9:32 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58950

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mpolacek at gcc dot gnu.org

--- Comment #21 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Should this be P1?


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

* [Bug c++/58950] Missing "statement has no effect"
  2013-10-31 23:11 [Bug c++/58950] New: [4.9 Regression] Missing "statement has no effect" glisse at gcc dot gnu.org
                   ` (20 preceding siblings ...)
  2015-04-08  9:32 ` mpolacek at gcc dot gnu.org
@ 2015-06-26 20:04 ` jakub at gcc dot gnu.org
  2015-06-26 20:34 ` jakub at gcc dot gnu.org
                   ` (3 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: jakub at gcc dot gnu.org @ 2015-06-26 20:04 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58950

--- Comment #22 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
GCC 4.9.3 has been released.


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

* [Bug c++/58950] Missing "statement has no effect"
  2013-10-31 23:11 [Bug c++/58950] New: [4.9 Regression] Missing "statement has no effect" glisse at gcc dot gnu.org
                   ` (21 preceding siblings ...)
  2015-06-26 20:04 ` jakub at gcc dot gnu.org
@ 2015-06-26 20:34 ` jakub at gcc dot gnu.org
  2015-06-26 21:28 ` pinskia at gcc dot gnu.org
                   ` (2 subsequent siblings)
  25 siblings, 0 replies; 27+ messages in thread
From: jakub at gcc dot gnu.org @ 2015-06-26 20:34 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58950

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.9.3                       |4.9.4


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

* [Bug c++/58950] Missing "statement has no effect"
  2013-10-31 23:11 [Bug c++/58950] New: [4.9 Regression] Missing "statement has no effect" glisse at gcc dot gnu.org
                   ` (22 preceding siblings ...)
  2015-06-26 20:34 ` jakub at gcc dot gnu.org
@ 2015-06-26 21:28 ` pinskia at gcc dot gnu.org
  2021-12-10 21:31 ` pinskia at gcc dot gnu.org
  2021-12-10 21:34 ` pinskia at gcc dot gnu.org
  25 siblings, 0 replies; 27+ messages in thread
From: pinskia at gcc dot gnu.org @ 2015-06-26 21:28 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58950

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.9.4                       |---


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

* [Bug c++/58950] Missing "statement has no effect"
  2013-10-31 23:11 [Bug c++/58950] New: [4.9 Regression] Missing "statement has no effect" glisse at gcc dot gnu.org
                   ` (23 preceding siblings ...)
  2015-06-26 21:28 ` pinskia at gcc dot gnu.org
@ 2021-12-10 21:31 ` pinskia at gcc dot gnu.org
  2021-12-10 21:34 ` pinskia at gcc dot gnu.org
  25 siblings, 0 replies; 27+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-12-10 21:31 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58950

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |needs-bisection

--- Comment #25 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Marc Glisse from comment #6)
> For:
> 
> void f(){
>   int i = 2;
>   (i+i);
> }

This case is fixed on the trunk:

<source>: In function 'void f1()':
<source>:9:5: warning: statement has no effect [-Wunused-value]
    9 |   (i+i);
      |   ~~^~~

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

* [Bug c++/58950] Missing "statement has no effect"
  2013-10-31 23:11 [Bug c++/58950] New: [4.9 Regression] Missing "statement has no effect" glisse at gcc dot gnu.org
                   ` (24 preceding siblings ...)
  2021-12-10 21:31 ` pinskia at gcc dot gnu.org
@ 2021-12-10 21:34 ` pinskia at gcc dot gnu.org
  25 siblings, 0 replies; 27+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-12-10 21:34 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58950

--- Comment #26 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Andrew Pinski from comment #25)
> (In reply to Marc Glisse from comment #6)
> > For:
> > 
> > void f(){
> >   int i = 2;
> >   (i+i);
> > }
> 
> This case is fixed on the trunk:
> 
> <source>: In function 'void f1()':
> <source>:9:5: warning: statement has no effect [-Wunused-value]
>     9 |   (i+i);
>       |   ~~^~~

I think it was fixed via r12-1804-g65870e75616ee4359d1c13b99 .

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

end of thread, other threads:[~2021-12-10 21:34 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-10-31 23:11 [Bug c++/58950] New: [4.9 Regression] Missing "statement has no effect" glisse at gcc dot gnu.org
2013-11-19  9:49 ` [Bug c++/58950] " rguenth at gcc dot gnu.org
2013-11-19 10:43 ` rguenth at gcc dot gnu.org
2013-11-25 22:49 ` glisse at gcc dot gnu.org
2013-11-26  6:14 ` glisse at gcc dot gnu.org
2013-11-26  8:18 ` ebotcazou at gcc dot gnu.org
2013-11-26 19:58 ` glisse at gcc dot gnu.org
2013-11-30 15:12 ` glisse at gcc dot gnu.org
2013-11-30 15:36 ` glisse at gcc dot gnu.org
2013-11-30 17:07 ` ebotcazou at gcc dot gnu.org
2014-01-03  3:29 ` jason at gcc dot gnu.org
2014-01-03 10:35 ` glisse at gcc dot gnu.org
2014-01-03 21:12 ` glisse at gcc dot gnu.org
2014-01-03 21:19 ` [Bug c++/58950] " glisse at gcc dot gnu.org
2014-02-24 15:26 ` glisse at gcc dot gnu.org
2014-02-24 16:09 ` paolo.carlini at oracle dot com
2014-02-24 16:15 ` glisse at gcc dot gnu.org
2014-02-24 16:19 ` paolo.carlini at oracle dot com
2014-04-22 11:36 ` jakub at gcc dot gnu.org
2014-07-16 13:27 ` jakub at gcc dot gnu.org
2014-10-30 10:38 ` jakub at gcc dot gnu.org
2015-04-08  9:32 ` mpolacek at gcc dot gnu.org
2015-06-26 20:04 ` jakub at gcc dot gnu.org
2015-06-26 20:34 ` jakub at gcc dot gnu.org
2015-06-26 21:28 ` pinskia at gcc dot gnu.org
2021-12-10 21:31 ` pinskia at gcc dot gnu.org
2021-12-10 21:34 ` pinskia 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).