public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/95311] New: [11 Regression] ICE in cp_ubsan_maybe_instrument_member_call at gcc/cp/cp-ubsan.c:136 since r11-578-g72af65b91cc2a2eb
@ 2020-05-25  8:56 marxin at gcc dot gnu.org
  2020-05-25  8:56 ` [Bug c++/95311] " marxin at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: marxin at gcc dot gnu.org @ 2020-05-25  8:56 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 95311
           Summary: [11 Regression] ICE in
                    cp_ubsan_maybe_instrument_member_call at
                    gcc/cp/cp-ubsan.c:136 since r11-578-g72af65b91cc2a2eb
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: marxin at gcc dot gnu.org
                CC: jason at gcc dot gnu.org
  Target Milestone: ---

I see the following ICE:

$ g++ /home/marxin/Programming/gcc/gcc/testsuite/g++.dg/ipa/pr63470.C
-fsanitize=undefined -c
/home/marxin/Programming/gcc/gcc/testsuite/g++.dg/ipa/pr63470.C: In member
function ‘virtual bool FTjackSupport::m_fn1()’:
/home/marxin/Programming/gcc/gcc/testsuite/g++.dg/ipa/pr63470.C:45:1: internal
compiler error: tree check: expected class ‘expression’, have ‘declaration’
(parm_decl) in tree_operand_check, at tree.h:3794
   45 | }
      | ^
0x848120 tree_class_check_failed(tree_node const*, tree_code_class, char
const*, int, char const*)
        /home/marxin/Programming/gcc/gcc/tree.c:9736
0x6408d7 expr_check(tree_node*, char const*, int, char const*)
        /home/marxin/Programming/gcc/gcc/tree.h:3465
0x6408d7 tree_operand_check(tree_node*, int, char const*, int, char const*)
        /home/marxin/Programming/gcc/gcc/tree.h:3794
0x6408d7 cp_ubsan_maybe_instrument_member_call(tree_node*)
        /home/marxin/Programming/gcc/gcc/cp/cp-ubsan.c:136
0x9a4633 cp_genericize_r
        /home/marxin/Programming/gcc/gcc/cp/cp-gimplify.c:1713
0x138d083 walk_tree_1(tree_node**, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*,
tree_node* (*)(tree_node**, int*, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*))
        /home/marxin/Programming/gcc/gcc/tree.c:11956
0x138d948 walk_tree_1(tree_node**, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*,
tree_node* (*)(tree_node**, int*, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*))
        /home/marxin/Programming/gcc/gcc/tree.c:12286
0x138d948 walk_tree_1(tree_node**, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*,
tree_node* (*)(tree_node**, int*, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*))
        /home/marxin/Programming/gcc/gcc/tree.c:12286
0x9a559a cp_genericize_r
        /home/marxin/Programming/gcc/gcc/cp/cp-gimplify.c:1785
0x138d083 walk_tree_1(tree_node**, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*,
tree_node* (*)(tree_node**, int*, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*))
        /home/marxin/Programming/gcc/gcc/tree.c:11956
0x9a5da2 cp_genericize_r
        /home/marxin/Programming/gcc/gcc/cp/cp-gimplify.c:1455
0x138d083 walk_tree_1(tree_node**, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*,
tree_node* (*)(tree_node**, int*, tree_node* (*)(tree_node**, int*, void*),
void*, hash_set<tree_node*, false, default_hash_traits<tree_node*> >*))
        /home/marxin/Programming/gcc/gcc/tree.c:11956
0x9a3498 cp_genericize_tree
        /home/marxin/Programming/gcc/gcc/cp/cp-gimplify.c:1820
0x9a3724 cp_genericize(tree_node*)
        /home/marxin/Programming/gcc/gcc/cp/cp-gimplify.c:1969
0x9e5111 finish_function(bool)
        /home/marxin/Programming/gcc/gcc/cp/decl.c:17192
0xa9122a cp_parser_function_definition_after_declarator
        /home/marxin/Programming/gcc/gcc/cp/parser.c:29015
0xa92001 cp_parser_function_definition_from_specifiers_and_declarator
        /home/marxin/Programming/gcc/gcc/cp/parser.c:28928
0xa92001 cp_parser_init_declarator
        /home/marxin/Programming/gcc/gcc/cp/parser.c:20685
0xa71253 cp_parser_simple_declaration
        /home/marxin/Programming/gcc/gcc/cp/parser.c:13749
0xa99f47 cp_parser_declaration
        /home/marxin/Programming/gcc/gcc/cp/parser.c:13448
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

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

* [Bug c++/95311] [11 Regression] ICE in cp_ubsan_maybe_instrument_member_call at gcc/cp/cp-ubsan.c:136 since r11-578-g72af65b91cc2a2eb
  2020-05-25  8:56 [Bug c++/95311] New: [11 Regression] ICE in cp_ubsan_maybe_instrument_member_call at gcc/cp/cp-ubsan.c:136 since r11-578-g72af65b91cc2a2eb marxin at gcc dot gnu.org
@ 2020-05-25  8:56 ` marxin at gcc dot gnu.org
  2020-05-25 11:17 ` rguenth at gcc dot gnu.org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: marxin at gcc dot gnu.org @ 2020-05-25  8:56 UTC (permalink / raw)
  To: gcc-bugs

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

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
           Keywords|                            |ice-on-valid-code
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2020-05-25

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

* [Bug c++/95311] [11 Regression] ICE in cp_ubsan_maybe_instrument_member_call at gcc/cp/cp-ubsan.c:136 since r11-578-g72af65b91cc2a2eb
  2020-05-25  8:56 [Bug c++/95311] New: [11 Regression] ICE in cp_ubsan_maybe_instrument_member_call at gcc/cp/cp-ubsan.c:136 since r11-578-g72af65b91cc2a2eb marxin at gcc dot gnu.org
  2020-05-25  8:56 ` [Bug c++/95311] " marxin at gcc dot gnu.org
@ 2020-05-25 11:17 ` rguenth at gcc dot gnu.org
  2020-05-27  7:04 ` marxin at gcc dot gnu.org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2020-05-25 11:17 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |11.0

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

* [Bug c++/95311] [11 Regression] ICE in cp_ubsan_maybe_instrument_member_call at gcc/cp/cp-ubsan.c:136 since r11-578-g72af65b91cc2a2eb
  2020-05-25  8:56 [Bug c++/95311] New: [11 Regression] ICE in cp_ubsan_maybe_instrument_member_call at gcc/cp/cp-ubsan.c:136 since r11-578-g72af65b91cc2a2eb marxin at gcc dot gnu.org
  2020-05-25  8:56 ` [Bug c++/95311] " marxin at gcc dot gnu.org
  2020-05-25 11:17 ` rguenth at gcc dot gnu.org
@ 2020-05-27  7:04 ` marxin at gcc dot gnu.org
  2020-05-28 12:15 ` dcb314 at hotmail dot com
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: marxin at gcc dot gnu.org @ 2020-05-27  7:04 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Martin Liška <marxin at gcc dot gnu.org> ---
@Jason: I would like to do a merge of libsanitizer but this issue is blocking
me right now. One can't do a UBSAN bootstrap right now.
Can you please take a look?

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

* [Bug c++/95311] [11 Regression] ICE in cp_ubsan_maybe_instrument_member_call at gcc/cp/cp-ubsan.c:136 since r11-578-g72af65b91cc2a2eb
  2020-05-25  8:56 [Bug c++/95311] New: [11 Regression] ICE in cp_ubsan_maybe_instrument_member_call at gcc/cp/cp-ubsan.c:136 since r11-578-g72af65b91cc2a2eb marxin at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2020-05-27  7:04 ` marxin at gcc dot gnu.org
@ 2020-05-28 12:15 ` dcb314 at hotmail dot com
  2020-05-29 14:25 ` jason at gcc dot gnu.org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: dcb314 at hotmail dot com @ 2020-05-28 12:15 UTC (permalink / raw)
  To: gcc-bugs

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

David Binderman <dcb314 at hotmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dcb314 at hotmail dot com

--- Comment #2 from David Binderman <dcb314 at hotmail dot com> ---
This C++ code seems to do something similar:

class a {
  virtual long b() const;
};
class c : a {
public:
  long b() const;
};
class d : c {
  long e();
};
long d::e() { b(); }

$ /home/dcb/gcc/results/bin/g++ -c -w -fsanitize=undefined -std=c++11 
bug616.cc
bug616.cc: In member function ‘long int d::e()’:
bug616.cc:11:20: internal compiler error: tree check: expected class
‘expression
’, have ‘declaration’ (parm_decl) in tree_operand_check, at tree.h:3794
   11 | long d::e() { b(); }
      |                    ^
0x124fe0a tree_class_check_failed(tree_node const*, tree_code_class, char
const*
, int, char const*)
        ../../trunk.git/gcc/tree.c:9755
0x6b915d cp_ubsan_maybe_instrument_member_call(tree_node*)
        ../../trunk.git/gcc/cp/cp-ubsan.c:0

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

* [Bug c++/95311] [11 Regression] ICE in cp_ubsan_maybe_instrument_member_call at gcc/cp/cp-ubsan.c:136 since r11-578-g72af65b91cc2a2eb
  2020-05-25  8:56 [Bug c++/95311] New: [11 Regression] ICE in cp_ubsan_maybe_instrument_member_call at gcc/cp/cp-ubsan.c:136 since r11-578-g72af65b91cc2a2eb marxin at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2020-05-28 12:15 ` dcb314 at hotmail dot com
@ 2020-05-29 14:25 ` jason at gcc dot gnu.org
  2020-05-29 16:21 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: jason at gcc dot gnu.org @ 2020-05-29 14:25 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|unassigned at gcc dot gnu.org      |jason at gcc dot gnu.org
             Status|NEW                         |ASSIGNED

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

* [Bug c++/95311] [11 Regression] ICE in cp_ubsan_maybe_instrument_member_call at gcc/cp/cp-ubsan.c:136 since r11-578-g72af65b91cc2a2eb
  2020-05-25  8:56 [Bug c++/95311] New: [11 Regression] ICE in cp_ubsan_maybe_instrument_member_call at gcc/cp/cp-ubsan.c:136 since r11-578-g72af65b91cc2a2eb marxin at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2020-05-29 14:25 ` jason at gcc dot gnu.org
@ 2020-05-29 16:21 ` cvs-commit at gcc dot gnu.org
  2020-05-29 16:22 ` jason at gcc dot gnu.org
  2020-06-01 20:52 ` cvs-commit at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-05-29 16:21 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jason Merrill <jason@gcc.gnu.org>:

https://gcc.gnu.org/g:8e915901deb3518d4bef73ea52eab2ece7a2bbf6

commit r11-728-g8e915901deb3518d4bef73ea52eab2ece7a2bbf6
Author: Jason Merrill <jason@redhat.com>
Date:   Fri May 29 11:59:33 2020 -0400

    c++: vptr ubsan and derived class [PR95311].

    We weren't able to find OBJ_TYPE_REF_OBJECT walking through
    OBJ_TYPE_REF_EXPR because we had folded away the ADDR_EXPR.

    gcc/cp/ChangeLog:

            PR c++/95311
            PR c++/95221
            * class.c (build_vfn_ref): Don't fold the INDIRECT_REF.

    gcc/testsuite/ChangeLog:

            PR c++/95311
            * g++.dg/ubsan/vptr-16.C: New test.

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

* [Bug c++/95311] [11 Regression] ICE in cp_ubsan_maybe_instrument_member_call at gcc/cp/cp-ubsan.c:136 since r11-578-g72af65b91cc2a2eb
  2020-05-25  8:56 [Bug c++/95311] New: [11 Regression] ICE in cp_ubsan_maybe_instrument_member_call at gcc/cp/cp-ubsan.c:136 since r11-578-g72af65b91cc2a2eb marxin at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2020-05-29 16:21 ` cvs-commit at gcc dot gnu.org
@ 2020-05-29 16:22 ` jason at gcc dot gnu.org
  2020-06-01 20:52 ` cvs-commit at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: jason at gcc dot gnu.org @ 2020-05-29 16:22 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #4 from Jason Merrill <jason at gcc dot gnu.org> ---
Fixed.

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

* [Bug c++/95311] [11 Regression] ICE in cp_ubsan_maybe_instrument_member_call at gcc/cp/cp-ubsan.c:136 since r11-578-g72af65b91cc2a2eb
  2020-05-25  8:56 [Bug c++/95311] New: [11 Regression] ICE in cp_ubsan_maybe_instrument_member_call at gcc/cp/cp-ubsan.c:136 since r11-578-g72af65b91cc2a2eb marxin at gcc dot gnu.org
                   ` (6 preceding siblings ...)
  2020-05-29 16:22 ` jason at gcc dot gnu.org
@ 2020-06-01 20:52 ` cvs-commit at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-06-01 20:52 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jason Merrill <jason@gcc.gnu.org>:

https://gcc.gnu.org/g:172f2c42a10fd470c93f1e84575de9766c157591

commit r11-775-g172f2c42a10fd470c93f1e84575de9766c157591
Author: Jason Merrill <jason@redhat.com>
Date:   Mon Jun 1 16:20:38 2020 -0400

    c++: vptr ubsan and object of known type [PR95466]

    Another case where we can't find the OBJ_TYPE_REF_OBJECT in the
    OBJ_TYPE_REF_EXPR.  So let's just evaluate the sanitize call first.

    gcc/cp/ChangeLog:

            PR c++/95466
            PR c++/95311
            PR c++/95221
            * class.c (build_vfn_ref): Revert 95311 change.
            * cp-ubsan.c (cp_ubsan_maybe_instrument_member_call): Build a
            COMPOUND_EXPR.

    gcc/testsuite/ChangeLog:

            PR c++/95466
            * g++.dg/ubsan/vptr-17.C: New test.

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

end of thread, other threads:[~2020-06-01 20:52 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-25  8:56 [Bug c++/95311] New: [11 Regression] ICE in cp_ubsan_maybe_instrument_member_call at gcc/cp/cp-ubsan.c:136 since r11-578-g72af65b91cc2a2eb marxin at gcc dot gnu.org
2020-05-25  8:56 ` [Bug c++/95311] " marxin at gcc dot gnu.org
2020-05-25 11:17 ` rguenth at gcc dot gnu.org
2020-05-27  7:04 ` marxin at gcc dot gnu.org
2020-05-28 12:15 ` dcb314 at hotmail dot com
2020-05-29 14:25 ` jason at gcc dot gnu.org
2020-05-29 16:21 ` cvs-commit at gcc dot gnu.org
2020-05-29 16:22 ` jason at gcc dot gnu.org
2020-06-01 20:52 ` cvs-commit 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).