public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/59819] New: -Wunused-value reports incorrect values as unused
@ 2014-01-15  6:31 caibbor at gmail dot com
  0 siblings, 0 replies; only message in thread
From: caibbor at gmail dot com @ 2014-01-15  6:31 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 59819
           Summary: -Wunused-value reports incorrect values as unused
           Product: gcc
           Version: 4.8.1
            Status: UNCONFIRMED
          Severity: trivial
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: caibbor at gmail dot com

Created attachment 31836
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=31836&action=edit
The program in full to replicate this bug

This is pretty trivial but the warning outputs incorrect information. given the
line:

int foo = static_cast< int >( 1, 2, 3 );

G++ reports that value 2 and 3 are not used, when in fact 1 and 2 are not used.

G++ 4.8.1's output (with -Wall):
test.cpp: In function ‘int main()’:
test.cpp:15:35: warning: left operand of comma operator has no effect
[-Wunused-value]
  int foo = static_cast< int >( 1, 2, 3 );
                                   ^
test.cpp:15:38: warning: right operand of comma operator has no effect
[-Wunused-value]
  int foo = static_cast< int >( 1, 2, 3 );
                                      ^


Clang 3.2.7 gets it right, however:

test.cpp:15:32: warning: expression result unused [-Wunused-value]
        int foo = static_cast< int >( 1, 2, 3 );
                                      ^
test.cpp:15:35: warning: expression result unused [-Wunused-value]
        int foo = static_cast< int >( 1, 2, 3 );
                                         ^
2 warnings generated.
>From gcc-bugs-return-440384-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Wed Jan 15 06:55:25 2014
Return-Path: <gcc-bugs-return-440384-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 22011 invoked by alias); 15 Jan 2014 06:55:23 -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 21976 invoked by uid 48); 15 Jan 2014 06:55:19 -0000
From: "kirill.yukhin at intel dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug testsuite/59808] [4.9 Regression] r206596 caused: FAIL: gcc.target/i386/sse-14.c (test for excess errors)
Date: Wed, 15 Jan 2014 06:55:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: testsuite
X-Bugzilla-Version: 4.9.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: kirill.yukhin at intel dot com
X-Bugzilla-Status: NEW
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: 4.9.0
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-59808-4-q1qkO4oMTt@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-59808-4@http.gcc.gnu.org/bugzilla/>
References: <bug-59808-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2014-01/txt/msg01526.txt.bz2
Content-length: 347

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

--- Comment #4 from Yukhin Kirill <kirill.yukhin at intel dot com> ---
(In reply to Uroš Bizjak from comment #2)
> Kirill, please update also sse-13.c with new builtins.

Fix is posted as part of:
http://gcc.gnu.org/ml/gcc-patches/2014-01/msg00761.html
I may strip it into separate one...
>From gcc-bugs-return-440385-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Wed Jan 15 06:56:01 2014
Return-Path: <gcc-bugs-return-440385-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 22750 invoked by alias); 15 Jan 2014 06:56:00 -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 22725 invoked by uid 48); 15 Jan 2014 06:55:57 -0000
From: "kirill.yukhin at intel dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug testsuite/59808] [4.9 Regression] r206596 caused: FAIL: gcc.target/i386/sse-14.c (test for excess errors)
Date: Wed, 15 Jan 2014 06:56:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: testsuite
X-Bugzilla-Version: 4.9.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: kirill.yukhin at intel dot com
X-Bugzilla-Status: NEW
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: 4.9.0
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-59808-4-RGwcQpEJJR@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-59808-4@http.gcc.gnu.org/bugzilla/>
References: <bug-59808-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2014-01/txt/msg01527.txt.bz2
Content-length: 389

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

--- Comment #5 from Yukhin Kirill <kirill.yukhin at intel dot com> ---
(In reply to Uroš Bizjak from comment #3)
> (In reply to Uroš Bizjak from comment #2)
> > Kirill, please update also sse-13.c with new builtins.
> 
> And sse-12.c with new options.

Sure, I think this is obvious change if no regressions.
Will do today.
>From gcc-bugs-return-440386-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Wed Jan 15 06:57:22 2014
Return-Path: <gcc-bugs-return-440386-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 23743 invoked by alias); 15 Jan 2014 06:57:21 -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 23692 invoked by uid 48); 15 Jan 2014 06:57:18 -0000
From: "jakub at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/59803] [4.8 Regression] s390x -march=z10 reload ICE
Date: Wed, 15 Jan 2014 06:57:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: target
X-Bugzilla-Version: 4.8.2
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: jakub at gcc dot gnu.org
X-Bugzilla-Status: ASSIGNED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: krebbel at gcc dot gnu.org
X-Bugzilla-Target-Milestone: 4.8.3
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-59803-4-LbF8GF0fH6@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-59803-4@http.gcc.gnu.org/bugzilla/>
References: <bug-59803-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-01/txt/msg01528.txt.bz2
Content-length: 793

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

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Thanks, looks good to me in my testing (s390-linux and s390x-linux
--enable-checking=release 4.8 branch --with-arch=z196 --with-tune=zEC12
bootstraps/regtests), and it even fixed one FAIL in the testsuite:
-FAIL: gcc.dg/torture/vshuf-v32qi.c  -O2  (internal compiler error)
-FAIL: gcc.dg/torture/vshuf-v32qi.c  -O2  (test for excess errors)
-UNRESOLVED: gcc.dg/torture/vshuf-v32qi.c  -O2  compilation failed to produce
executable
which apparently ICEd the same way with e.g. -O2 -march=z10 or -O2 -march=z196
without the patch and doesn't with the patch.  Though I'd say the #c0 testcase
doesn't hurt, can you please add it to say gcc.c-torture/compile/ (or
gcc.dg/torture/)?


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2014-01-15  6:31 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-15  6:31 [Bug c++/59819] New: -Wunused-value reports incorrect values as unused caibbor at gmail dot com

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).