public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/94955] New: ICE in to_wide
@ 2020-05-05 15:18 hubicka at gcc dot gnu.org
  2020-05-05 15:37 ` [Bug c++/94955] [10 regression] " mpolacek at gcc dot gnu.org
                   ` (13 more replies)
  0 siblings, 14 replies; 15+ messages in thread
From: hubicka at gcc dot gnu.org @ 2020-05-05 15:18 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 94955
           Summary: ICE in to_wide
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: hubicka at gcc dot gnu.org
  Target Milestone: ---

Created attachment 48454
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=48454&action=edit
proposed patch

This was reported to me by Mark Williams (who also did the testcase and
proposed patch)

% g++ -std=gnu++17 bug.ii -S -o bug.s
bug.ii: In function �void d()�:
bug.ii:6:32: internal compiler error: in sign_mask, at wide-int.h:855
    6 | void d() { short e = e >> b::c(); }
      |                                ^
0xa56be2 generic_wide_int<wide_int_ref_storage<false, false> >::sign_mask()
const
        /home/engshare/third-party2/gcc/9.x/src/gcc-10.x/gcc/wide-int.h:855
0xa56be2 bool wi::neg_p<generic_wide_int<wide_int_ref_storage<false, false> >
>(generic_wide_int<wide_int_ref_storage<false, false> > const&, signop)
        /home/engshare/third-party2/gcc/9.x/src/gcc-10.x/gcc/wide-int.h:1836
0xa56be2 tree_int_cst_sgn(tree_node const*)
        /home/engshare/third-party2/gcc/9.x/src/gcc-10.x/gcc/tree.c:7386
0x1065e85 cp_build_binary_op(op_location_t const&, tree_code, tree_node*,
tree_node*, int)
        /home/engshare/third-party2/gcc/9.x/src/gcc-10.x/gcc/cp/typeck.c:5613
0xfa9629 build_new_op_1
        /home/engshare/third-party2/gcc/9.x/src/gcc-10.x/gcc/cp/call.c:6501
0xfa931d build_new_op(op_location_t const&, tree_code, int, tree_node*,
tree_node*, tree_node*, tree_node**, int)
        /home/engshare/third-party2/gcc/9.x/src/gcc-10.x/gcc/cp/call.c:6547
0x106267f build_x_binary_op(op_location_t const&, tree_code, tree_node*,
tree_code, tree_node*, tree_code, tree_node**, int)
        /home/engshare/third-party2/gcc/9.x/src/gcc-10.x/gcc/cp/typeck.c:4248
0x10162f0 cp_parser_binary_expression
        /home/engshare/third-party2/gcc/9.x/src/gcc-10.x/gcc/cp/parser.c:9684
0x10157a4 cp_parser_assignment_expression
        /home/engshare/third-party2/gcc/9.x/src/gcc-10.x/gcc/cp/parser.c:9824
0x1015380 cp_parser_constant_expression
        /home/engshare/third-party2/gcc/9.x/src/gcc-10.x/gcc/cp/parser.c:10118
0x1015380 cp_parser_initializer_clause
        /home/engshare/third-party2/gcc/9.x/src/gcc-10.x/gcc/cp/parser.c:23148
0x1015380 cp_parser_initializer
        /home/engshare/third-party2/gcc/9.x/src/gcc-10.x/gcc/cp/parser.c:23086
0x1008ab0 cp_parser_init_declarator
        /home/engshare/third-party2/gcc/9.x/src/gcc-10.x/gcc/cp/parser.c:20780
0x1006144 cp_parser_simple_declaration
        /home/engshare/third-party2/gcc/9.x/src/gcc-10.x/gcc/cp/parser.c:13689
0x101df42 cp_parser_declaration_statement
        /home/engshare/third-party2/gcc/9.x/src/gcc-10.x/gcc/cp/parser.c:13121
0x101a67c cp_parser_statement
        /home/engshare/third-party2/gcc/9.x/src/gcc-10.x/gcc/cp/parser.c:11434
0x101a38a cp_parser_statement_seq_opt
        /home/engshare/third-party2/gcc/9.x/src/gcc-10.x/gcc/cp/parser.c:11800
0x101a38a cp_parser_compound_statement
        /home/engshare/third-party2/gcc/9.x/src/gcc-10.x/gcc/cp/parser.c:11750
0x101a0f9 cp_parser_function_body
        /home/engshare/third-party2/gcc/9.x/src/gcc-10.x/gcc/cp/parser.c:22992
0x101a0f9 cp_parser_ctor_initializer_opt_and_function_body
        /home/engshare/third-party2/gcc/9.x/src/gcc-10.x/gcc/cp/parser.c:23043

The problem was that it had previously used fold_for_warn to find an
INTEGER_CST, and assumed the cp_fold_rvalue would too. But fold_for_warn
handles some edge cases that cp_fold_rvalue does not, and in this case we end
up with a NOP_EXPR instead of the INTEGER_CST

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

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

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-05 15:18 [Bug c++/94955] New: ICE in to_wide hubicka at gcc dot gnu.org
2020-05-05 15:37 ` [Bug c++/94955] [10 regression] " mpolacek at gcc dot gnu.org
2020-05-05 16:13 ` mpolacek at gcc dot gnu.org
2020-05-05 16:15 ` hubicka at gcc dot gnu.org
2020-05-05 16:16 ` hubicka at gcc dot gnu.org
2020-05-05 16:33 ` [Bug c++/94955] [10/11 Regression] " mpolacek at gcc dot gnu.org
2020-05-06 19:20 ` mpolacek at gcc dot gnu.org
2020-05-11  0:35 ` mpolacek at gcc dot gnu.org
2020-05-11 12:28 ` john at mcfarlane dot name
2020-05-18 23:06 ` cvs-commit at gcc dot gnu.org
2020-05-18 23:07 ` [Bug c++/94955] [10 " mpolacek at gcc dot gnu.org
2020-05-19 16:55 ` mpolacek at gcc dot gnu.org
2020-06-08 16:59 ` jakub at gcc dot gnu.org
2020-06-11 20:27 ` cvs-commit at gcc dot gnu.org
2020-06-11 20:27 ` mpolacek 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).