public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug other/111264] New: [14 regression] gcc.dg/plugin/analyzer_cpython_plugin.c breaks after r14-3580-g597b9ec69bca8a
@ 2023-08-31 23:22 seurer at gcc dot gnu.org
  2023-09-01  2:09 ` [Bug other/111264] " hp at gcc dot gnu.org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: seurer at gcc dot gnu.org @ 2023-08-31 23:22 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 111264
           Summary: [14 regression]
                    gcc.dg/plugin/analyzer_cpython_plugin.c breaks after
                    r14-3580-g597b9ec69bca8a
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: other
          Assignee: unassigned at gcc dot gnu.org
          Reporter: seurer at gcc dot gnu.org
  Target Milestone: ---

g:597b9ec69bca8acb7a3d65641c0a730de8b27ed4, r14-3580-g597b9ec69bca8a
make  -k check-gcc
RUNTESTFLAGS="plugin.exp=gcc.dg/plugin/analyzer_cpython_plugin.c"
FAIL: gcc.dg/plugin/analyzer_cpython_plugin.c compilation
# of unexpected failures        1

commit 597b9ec69bca8acb7a3d65641c0a730de8b27ed4 (HEAD)
Author: Eric Feng <ef2648@columbia.edu>
Date:   Wed Aug 30 17:52:24 2023 -0400

    analyzer: implement reference count checking for CPython plugin [PR107646]



Executing on build: g++ -g
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.dg/plugin/analyzer_cpython_plugin.c
-I. -I/home/seurer/gcc/git/gcc-test/gcc/testsuite
-I/home/seurer/gcc/git/gcc-test/gcc/testsuite/../../gcc
-I/home/seurer/gcc/git/build/gcc-test/gcc/testsuite/gcc/../../../gcc 
-I/home/seurer/gcc/git/gcc-test/gcc/testsuite/../../include
-I/home/seurer/gcc/git/gcc-test/gcc/testsuite/../../libcpp/include 
-I/home/seurer/gcc/git/build/gcc-test/./gmp -I/home/seurer/gcc/git/gcc-test/gmp
-I/home/seurer/gcc/git/build/gcc-test/./mpfr/src
-I/home/seurer/gcc/git/gcc-test/mpfr/src
-I/home/seurer/gcc/git/gcc-test/mpc/src 
-I/home/seurer/gcc/git/build/gcc-test/gcc/testsuite/gcc/../../../intl -g
-DIN_GCC -fPIC -shared -fno-rtti -o analyzer_cpython_plugin.so    (timeout =
300)
spawn -ignore SIGHUP g++ -g
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.dg/plugin/analyzer_cpython_plugin.c
-I. -I/home/seurer/gcc/git/gcc-test/gcc/testsuite
-I/home/seurer/gcc/git/gcc-test/gcc/testsuite/../../gcc
-I/home/seurer/gcc/git/build/gcc-test/gcc/testsuite/gcc/../../../gcc
-I/home/seurer/gcc/git/gcc-test/gcc/testsuite/../../include
-I/home/seurer/gcc/git/gcc-test/gcc/testsuite/../../libcpp/include
-I/home/seurer/gcc/git/build/gcc-test/./gmp -I/home/seurer/gcc/git/gcc-test/gmp
-I/home/seurer/gcc/git/build/gcc-test/./mpfr/src
-I/home/seurer/gcc/git/gcc-test/mpfr/src
-I/home/seurer/gcc/git/gcc-test/mpc/src
-I/home/seurer/gcc/git/build/gcc-test/gcc/testsuite/gcc/../../../intl -g
-DIN_GCC -fPIC -shared -fno-rtti -o analyzer_cpython_plugin.so
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.dg/plugin/analyzer_cpython_plugin.c:
In function 'void ana::pyobj_refcnt_checker(const ana::region_model*, const
ana::region_model*, const ana::svalue*, ana::region_model_context*)':
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.dg/plugin/analyzer_cpython_plugin.c:480:58:
error: no matching function for call to 'hash_map<const ana::region*,
int>::hash_map(hash_map<const ana::region*, int>)'
   auto region_to_refcnt = hash_map<const region *, int> ();
                                                          ^
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.dg/plugin/analyzer_cpython_plugin.c:
In member function 'virtual void
ana::kf_analyzer_cpython_dump_refcounts::impl_call_pre(const
ana::call_details&) const':
/home/seurer/gcc/git/gcc-test/gcc/testsuite/gcc.dg/plugin/analyzer_cpython_plugin.c:564:60:
error: no matching function for call to 'hash_map<const ana::region*,
int>::hash_map(hash_map<const ana::region*, int>)'
     auto region_to_refcnt = hash_map<const region *, int> ();
                                                            ^

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

* [Bug other/111264] [14 regression] gcc.dg/plugin/analyzer_cpython_plugin.c breaks after r14-3580-g597b9ec69bca8a
  2023-08-31 23:22 [Bug other/111264] New: [14 regression] gcc.dg/plugin/analyzer_cpython_plugin.c breaks after r14-3580-g597b9ec69bca8a seurer at gcc dot gnu.org
@ 2023-09-01  2:09 ` hp at gcc dot gnu.org
  2023-09-01  2:52 ` hp at gcc dot gnu.org
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: hp at gcc dot gnu.org @ 2023-09-01  2:09 UTC (permalink / raw)
  To: gcc-bugs

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

Hans-Peter Nilsson <hp at gcc dot gnu.org> changed:

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

--- Comment #1 from Hans-Peter Nilsson <hp at gcc dot gnu.org> ---
Also seen for cris-elf and m68k-linux
(https://gcc.gnu.org/pipermail/gcc-testresults/2023-August/794806.html).

Some experimentation says that this is a mismatch between the default C++
version for the host/installed gcc (for me, C++11, I think) and the target
(C++17, right?).  If you add "-std=c++17" to the invocation line in gcc.log,
compilation succeeds.  Or, change the form of the newly introduced declarations
from
 auto foobar = foo<bar>();
to
 foo<bar> foobar;
Not sure why the former is used, it seems negate the benefits of auto and just
be more typing.  Beware: since I know Very Little C++ of the last decades, I
could be completely wrong.

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

* [Bug other/111264] [14 regression] gcc.dg/plugin/analyzer_cpython_plugin.c breaks after r14-3580-g597b9ec69bca8a
  2023-08-31 23:22 [Bug other/111264] New: [14 regression] gcc.dg/plugin/analyzer_cpython_plugin.c breaks after r14-3580-g597b9ec69bca8a seurer at gcc dot gnu.org
  2023-09-01  2:09 ` [Bug other/111264] " hp at gcc dot gnu.org
@ 2023-09-01  2:52 ` hp at gcc dot gnu.org
  2023-09-01  3:07 ` pinskia at gcc dot gnu.org
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: hp at gcc dot gnu.org @ 2023-09-01  2:52 UTC (permalink / raw)
  To: gcc-bugs

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

Hans-Peter Nilsson <hp at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                URL|                            |https://gcc.gnu.org/piperma
                   |                            |il/gcc-patches/2023-Septemb
                   |                            |er/629019.html

--- Comment #2 from Hans-Peter Nilsson <hp at gcc dot gnu.org> ---
Patch posted:
https://gcc.gnu.org/pipermail/gcc-patches/2023-September/629019.html

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

* [Bug other/111264] [14 regression] gcc.dg/plugin/analyzer_cpython_plugin.c breaks after r14-3580-g597b9ec69bca8a
  2023-08-31 23:22 [Bug other/111264] New: [14 regression] gcc.dg/plugin/analyzer_cpython_plugin.c breaks after r14-3580-g597b9ec69bca8a seurer at gcc dot gnu.org
  2023-09-01  2:09 ` [Bug other/111264] " hp at gcc dot gnu.org
  2023-09-01  2:52 ` hp at gcc dot gnu.org
@ 2023-09-01  3:07 ` pinskia at gcc dot gnu.org
  2023-09-01  7:07 ` [Bug analyzer/111264] " rguenth at gcc dot gnu.org
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-09-01  3:07 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2023-09-01

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Hans-Peter Nilsson from comment #1)
> Also seen for cris-elf and m68k-linux
> (https://gcc.gnu.org/pipermail/gcc-testresults/2023-August/794806.html).
> 
> Some experimentation says that this is a mismatch between the default C++
> version for the host/installed gcc (for me, C++11, I think) and the target
> (C++17, right?).  If you add "-std=c++17" to the invocation line in gcc.log,
> compilation succeeds.  Or, change the form of the newly introduced
> declarations from
>  auto foobar = foo<bar>();
> to
>  foo<bar> foobar;
> Not sure why the former is used, it seems negate the benefits of auto and
> just be more typing.  Beware: since I know Very Little C++ of the last
> decades, I could be completely wrong.

You are mostly correct.
In C++17, Copy elision is guaranteed to be done here while in earlier versions
it is not and earlier versions of C++ require a copy/move constructor even if
copy elision is to be done. See
https://en.cppreference.com/w/cpp/language/copy_elision for more information.

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

* [Bug analyzer/111264] [14 regression] gcc.dg/plugin/analyzer_cpython_plugin.c breaks after r14-3580-g597b9ec69bca8a
  2023-08-31 23:22 [Bug other/111264] New: [14 regression] gcc.dg/plugin/analyzer_cpython_plugin.c breaks after r14-3580-g597b9ec69bca8a seurer at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2023-09-01  3:07 ` pinskia at gcc dot gnu.org
@ 2023-09-01  7:07 ` rguenth at gcc dot gnu.org
  2023-09-01 13:30 ` hp at gcc dot gnu.org
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-09-01  7:07 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |testsuite-fail
   Target Milestone|---                         |14.0
          Component|other                       |analyzer

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

* [Bug analyzer/111264] [14 regression] gcc.dg/plugin/analyzer_cpython_plugin.c breaks after r14-3580-g597b9ec69bca8a
  2023-08-31 23:22 [Bug other/111264] New: [14 regression] gcc.dg/plugin/analyzer_cpython_plugin.c breaks after r14-3580-g597b9ec69bca8a seurer at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2023-09-01  7:07 ` [Bug analyzer/111264] " rguenth at gcc dot gnu.org
@ 2023-09-01 13:30 ` hp at gcc dot gnu.org
  2023-09-01 18:59 ` [Bug testsuite/111264] " hp at gcc dot gnu.org
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: hp at gcc dot gnu.org @ 2023-09-01 13:30 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Hans-Peter Nilsson <hp at gcc dot gnu.org> ---
(In reply to Andrew Pinski from comment #3)
> You are mostly correct.
> In C++17, Copy elision is guaranteed to be done here while in earlier
> versions it is not and earlier versions of C++ require a copy/move
> constructor even if copy elision is to be done. See
> https://en.cppreference.com/w/cpp/language/copy_elision for more information.

So before this "copy elision", there'd be temporaries constructed and then
copied into other temporaries, this in an object that is essentially just
declared, without initializer?  Weird.  Thanks for the pointer; I guess that's
the general idea, but here there'd be no difference.  IOW, sounds like the
patch is right.

If we move past the difference in semantics of the idioms in the patch, I still
don't see why there actually was error for the original syntax.  There must be
something in the difference between the hash_map and hash_set declarations. 
Eagerly awaiting comments on the patch.  (Probably not the best way to learn
recent C++ standards, but believe it or not, I'm exposed to a worse way, on
another track... :)

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

* [Bug testsuite/111264] [14 regression] gcc.dg/plugin/analyzer_cpython_plugin.c breaks after r14-3580-g597b9ec69bca8a
  2023-08-31 23:22 [Bug other/111264] New: [14 regression] gcc.dg/plugin/analyzer_cpython_plugin.c breaks after r14-3580-g597b9ec69bca8a seurer at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2023-09-01 13:30 ` hp at gcc dot gnu.org
@ 2023-09-01 18:59 ` hp at gcc dot gnu.org
  2023-09-01 19:01 ` cvs-commit at gcc dot gnu.org
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: hp at gcc dot gnu.org @ 2023-09-01 18:59 UTC (permalink / raw)
  To: gcc-bugs

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

Hans-Peter Nilsson <hp at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|analyzer                    |testsuite
           Assignee|efric at gcc dot gnu.org           |hp at gcc dot gnu.org

--- Comment #5 from Hans-Peter Nilsson <hp at gcc dot gnu.org> ---
I'm taking it as I'm about to commit the approved patch.
Also, changing component to testsuite.

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

* [Bug testsuite/111264] [14 regression] gcc.dg/plugin/analyzer_cpython_plugin.c breaks after r14-3580-g597b9ec69bca8a
  2023-08-31 23:22 [Bug other/111264] New: [14 regression] gcc.dg/plugin/analyzer_cpython_plugin.c breaks after r14-3580-g597b9ec69bca8a seurer at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2023-09-01 18:59 ` [Bug testsuite/111264] " hp at gcc dot gnu.org
@ 2023-09-01 19:01 ` cvs-commit at gcc dot gnu.org
  2023-09-01 19:10 ` hp at gcc dot gnu.org
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-09-01 19:01 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Hans-Peter Nilsson <hp@gcc.gnu.org>:

https://gcc.gnu.org/g:d3dd69706af4c086cb3385ff1f321887b91f49fb

commit r14-3631-gd3dd69706af4c086cb3385ff1f321887b91f49fb
Author: Hans-Peter Nilsson <hp@axis.com>
Date:   Fri Sep 1 04:36:03 2023 +0200

    testsuite: Fix analyzer_cpython_plugin.c declarations, PR testsuite/111264

    Also, add missing newline at end of file.

            PR testsuite/111264
            * gcc.dg/plugin/analyzer_cpython_plugin.c: Make declarations
            C++11-compatible.

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

* [Bug testsuite/111264] [14 regression] gcc.dg/plugin/analyzer_cpython_plugin.c breaks after r14-3580-g597b9ec69bca8a
  2023-08-31 23:22 [Bug other/111264] New: [14 regression] gcc.dg/plugin/analyzer_cpython_plugin.c breaks after r14-3580-g597b9ec69bca8a seurer at gcc dot gnu.org
                   ` (6 preceding siblings ...)
  2023-09-01 19:01 ` cvs-commit at gcc dot gnu.org
@ 2023-09-01 19:10 ` hp at gcc dot gnu.org
  2023-09-01 19:11 ` hp at gcc dot gnu.org
  2023-09-01 21:32 ` efric at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: hp at gcc dot gnu.org @ 2023-09-01 19:10 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from Hans-Peter Nilsson <hp at gcc dot gnu.org> ---
I don't think it's worthwhile to keep this open, as I'm pretty sure I fixed it
for all targets, as the cause wasn't target-related.  Otherwise, reopen; if
adding a sarcastic comment, then preferably also with a humorous twist.

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

* [Bug testsuite/111264] [14 regression] gcc.dg/plugin/analyzer_cpython_plugin.c breaks after r14-3580-g597b9ec69bca8a
  2023-08-31 23:22 [Bug other/111264] New: [14 regression] gcc.dg/plugin/analyzer_cpython_plugin.c breaks after r14-3580-g597b9ec69bca8a seurer at gcc dot gnu.org
                   ` (7 preceding siblings ...)
  2023-09-01 19:10 ` hp at gcc dot gnu.org
@ 2023-09-01 19:11 ` hp at gcc dot gnu.org
  2023-09-01 21:32 ` efric at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: hp at gcc dot gnu.org @ 2023-09-01 19:11 UTC (permalink / raw)
  To: gcc-bugs

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

Hans-Peter Nilsson <hp at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|NEW                         |RESOLVED

--- Comment #8 from Hans-Peter Nilsson <hp at gcc dot gnu.org> ---
.

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

* [Bug testsuite/111264] [14 regression] gcc.dg/plugin/analyzer_cpython_plugin.c breaks after r14-3580-g597b9ec69bca8a
  2023-08-31 23:22 [Bug other/111264] New: [14 regression] gcc.dg/plugin/analyzer_cpython_plugin.c breaks after r14-3580-g597b9ec69bca8a seurer at gcc dot gnu.org
                   ` (8 preceding siblings ...)
  2023-09-01 19:11 ` hp at gcc dot gnu.org
@ 2023-09-01 21:32 ` efric at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: efric at gcc dot gnu.org @ 2023-09-01 21:32 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #9 from Eric Feng <efric at gcc dot gnu.org> ---
(In reply to Hans-Peter Nilsson from comment #4)
> 
> If we move past the difference in semantics of the idioms in the patch, I
> still don't see why there actually was error for the original syntax.  There
> must be something in the difference between the hash_map and hash_set
> declarations.  Eagerly awaiting comments on the patch.  (Probably not the
> best way to learn recent C++ standards, but believe it or not, I'm exposed
> to a worse way, on another track... :)

Thanks again for the patch, Hans-Peter. For those interested, I try to dive
into why hash_map caused an error here whilst hash_set was fine in the original
syntax in the body of this e-mail:
https://gcc.gnu.org/pipermail/gcc/2023-September/242404.html. In short: I think
the issue was due to the compiler having trouble disambiguating between which
hash_map constructor to use in the original syntax in C++11. Please feel free
to chime in and correct my hypothesis. Cheers!

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

end of thread, other threads:[~2023-09-01 21:32 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-31 23:22 [Bug other/111264] New: [14 regression] gcc.dg/plugin/analyzer_cpython_plugin.c breaks after r14-3580-g597b9ec69bca8a seurer at gcc dot gnu.org
2023-09-01  2:09 ` [Bug other/111264] " hp at gcc dot gnu.org
2023-09-01  2:52 ` hp at gcc dot gnu.org
2023-09-01  3:07 ` pinskia at gcc dot gnu.org
2023-09-01  7:07 ` [Bug analyzer/111264] " rguenth at gcc dot gnu.org
2023-09-01 13:30 ` hp at gcc dot gnu.org
2023-09-01 18:59 ` [Bug testsuite/111264] " hp at gcc dot gnu.org
2023-09-01 19:01 ` cvs-commit at gcc dot gnu.org
2023-09-01 19:10 ` hp at gcc dot gnu.org
2023-09-01 19:11 ` hp at gcc dot gnu.org
2023-09-01 21:32 ` efric 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).