public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/114970] New: 32-bit ARM gcc-14.1 new false positive -Wunused-value
@ 2024-05-07 10:51 nilsgladitz at gmail dot com
  2024-05-07 20:44 ` [Bug c++/114970] [14/15 Regression] " pinskia at gcc dot gnu.org
  0 siblings, 1 reply; 2+ messages in thread
From: nilsgladitz at gmail dot com @ 2024-05-07 10:51 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 114970
           Summary: 32-bit ARM gcc-14.1 new false positive -Wunused-value
           Product: gcc
           Version: 14.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: nilsgladitz at gmail dot com
  Target Milestone: ---

Created attachment 58114
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=58114&action=edit
Testcase

The attached reduced test case produces the following warning:
test.cpp:6:43: warning: value computed is not used [-Wunused-value]
    6 |         std::string_view prefix("<prefix>");

When compiling with:
 -Wall -std=c++20 -O2

I see the warning when building for 32-bit ARM but not x86-64.
There is no warning with GCC 13.2.0.

Also seen with godbolt on "trunk": https://godbolt.org/z/GvbMMsfch

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

* [Bug c++/114970] [14/15 Regression] 32-bit ARM gcc-14.1 new false positive -Wunused-value
  2024-05-07 10:51 [Bug c++/114970] New: 32-bit ARM gcc-14.1 new false positive -Wunused-value nilsgladitz at gmail dot com
@ 2024-05-07 20:44 ` pinskia at gcc dot gnu.org
  0 siblings, 0 replies; 2+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-05-07 20:44 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|32-bit ARM gcc-14.1 new     |[14/15 Regression] 32-bit
                   |false positive              |ARM gcc-14.1 new false
                   |-Wunused-value              |positive -Wunused-value
             Target|arm                         |arm*-*-*eabi
   Target Milestone|---                         |14.2

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
This looks related to constructor return this where with ARM EABI constructors
(and deconstructors return this) and we produce:
      <<cleanup_point <<< Unknown tree: expr_stmt
        prefix = {._M_len=8, ._M_str=(const char *) "<prefix>"}, (struct
basic_string_view *) &prefix >>>>>;


Note "this" of &prefix is there.

Let me try to reduce this a little bit.
I might not get to it until week after next though.

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

end of thread, other threads:[~2024-05-07 20:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-05-07 10:51 [Bug c++/114970] New: 32-bit ARM gcc-14.1 new false positive -Wunused-value nilsgladitz at gmail dot com
2024-05-07 20:44 ` [Bug c++/114970] [14/15 Regression] " 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).