Bug 69379 - [6 Regression] ICE in fold_convert_loc, at fold-const.c:2366
Summary: [6 Regression] ICE in fold_convert_loc, at fold-const.c:2366
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 6.0
: P1 normal
Target Milestone: 6.0
Assignee: Marek Polacek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-01-20 06:18 UTC by Martin Michlmayr
Modified: 2016-01-27 16:48 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2016-01-20 00:00:00


Attachments
Preprocessed source (399.89 KB, application/x-bzip)
2016-01-20 06:19 UTC, Martin Michlmayr
Details
Preprocessed source (468.77 KB, application/x-bzip)
2016-01-22 02:26 UTC, Martin Michlmayr
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Michlmayr 2016-01-20 06:18:38 UTC
Running multidelta. Will update tomorrow.

tbm@dl580gen9-02:~/gcc6/testcase1/1$ g++-6 -c DictDataInfoPyWrap.ii
tbm@dl580gen9-02:~/gcc6/testcase1/1$ g++-6 -c -Wformat DictDataInfoPyWrap.ii
src/DictDataInfoPyWrap.C: In function 'void InitDictDataInfoPyWrapper()':
src/DictDataInfoPyWrap.C:220:65: internal compiler error: in fold_convert_loc, at fold-const.c:2366

0x890552 fold_convert_loc(unsigned int, tree_node*, tree_node*)
        ../../src/gcc/fold-const.c:2366
0x68f641 cp_fold_convert(tree_node*, tree_node*)
        ../../src/gcc/cp/cvt.c:605
0x6fa49a cxx_eval_constant_expression
        ../../src/gcc/cp/constexpr.c:3344
0x6f902b cxx_eval_constant_expression
        ../../src/gcc/cp/constexpr.c:3421
0x6f8daf cxx_eval_constant_expression
        ../../src/gcc/cp/constexpr.c:3613
0x6fbe48 cxx_eval_outermost_constant_expr
        ../../src/gcc/cp/constexpr.c:3816
0x6fce63 maybe_constant_value_1
        ../../src/gcc/cp/constexpr.c:4003
0x6fce63 maybe_constant_value(tree_node*, tree_node*)
        ../../src/gcc/cp/constexpr.c:4024
0x5cbeb9 build_over_call
        ../../src/gcc/cp/call.c:7546
0x5ca97f build_new_method_call_1
        ../../src/gcc/cp/call.c:8408
0x5ca97f build_new_method_call(tree_node*, tree_node*, vec<tree_node*, va_gc, vl_embed>**, tree_node*, int, tree_node**, int)
        ../../src/gcc/cp/call.c:8478
0x656597 cp_parser_postfix_expression
        ../../src/gcc/cp/parser.c:6855
0x65e370 cp_parser_unary_expression
        ../../src/gcc/cp/parser.c:7964
0x65ee7b cp_parser_cast_expression
        ../../src/gcc/cp/parser.c:8641
0x65f298 cp_parser_binary_expression
        ../../src/gcc/cp/parser.c:8742
0x65fa84 cp_parser_assignment_expression
        ../../src/gcc/cp/parser.c:9029
0x66282a cp_parser_expression
        ../../src/gcc/cp/parser.c:9198
0x663210 cp_parser_expression_statement
        ../../src/gcc/cp/parser.c:10659
0x6516d4 cp_parser_statement
        ../../src/gcc/cp/parser.c:10510
0x6524d1 cp_parser_statement_seq_opt
        ../../src/gcc/cp/parser.c:10782
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
Comment 1 Martin Michlmayr 2016-01-20 06:19:55 UTC
Created attachment 37401 [details]
Preprocessed source
Comment 2 Marek Polacek 2016-01-20 08:45:07 UTC
Confirmed.
Comment 3 Marek Polacek 2016-01-20 08:53:25 UTC
Started with:

commit 3c77e6e51f3def12b1ad416dac4b907f2245b047
Author: jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Date:   Tue Nov 17 21:49:23 2015 +0000

        PR bootstrap/68346
    
        * typeck.c (build_static_cast_1): Force a NOP when converting to
        the same type.
    
    git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@230508 138bc75d-0d04-0410-961f-82ee72b054a4

Reduced testcase would be much appreciated!
Comment 4 Markus Trippelsdorf 2016-01-20 10:03:09 UTC
markus@x4 tmp % cat DictDataInfoPyWrap.ii
typedef int Trans_NS___cxx11_string;
class A {
public:
  template <class DerivedT> A(char *, DerivedT);
  template <class Fn, class A1, class A2>
  void m_fn1(char *, Fn, A1 const &, A2);
};
struct Dict {
  void m_fn2();
};
void fn1() {
  A a("", "");
  typedef void *Get;
  typedef void (Dict::*d)(Trans_NS___cxx11_string);
  a.m_fn1("", Get(), d(&Dict::m_fn2), "");
}

markus@x4 tmp % g++ -w -c -Wformat DictDataInfoPyWrap.ii
DictDataInfoPyWrap.ii: In function ‘void fn1()’:
DictDataInfoPyWrap.ii:15:41: internal compiler error: in fold_convert_loc, at fold-const.c:2366
Comment 5 Marek Polacek 2016-01-21 14:07:48 UTC
This reduced testcase started ICEing with r230365.
Comment 6 Marek Polacek 2016-01-21 14:32:01 UTC
I think I've a fix for the first problem.  But a reduced testcase would be really nice.
Comment 7 Martin Michlmayr 2016-01-21 17:07:15 UTC
(In reply to Marek Polacek from comment #6)
> I think I've a fix for the first problem.  But a reduced testcase would be
> really nice.

I thought Markus Trippelsdorf provided a reduced testcase in comment #4.
Comment 8 Marek Polacek 2016-01-21 17:18:56 UTC
That triggers a slightly different path, but on further consideration I think I have a better fix that fixes both, so the reduced testcase we already have should be enough.
Comment 9 Martin Michlmayr 2016-01-21 21:27:57 UTC
Ok, I'll re-start the delta run.
Comment 10 Martin Michlmayr 2016-01-22 02:25:20 UTC
(In reply to Martin Michlmayr from comment #9)
> Ok, I'll re-start the delta run.

I'm sorry, but this isn't making any progress so I cannot offer a reduced testcase.

However, I'll attach preprocessed source from another package that fails with this ICE.

$ g++-6 -c -Wformat PushButton.pypp.ii
Comment 11 Martin Michlmayr 2016-01-22 02:26:26 UTC
Created attachment 37428 [details]
Preprocessed source
Comment 12 Marek Polacek 2016-01-27 16:47:12 UTC
Author: mpolacek
Date: Wed Jan 27 16:46:40 2016
New Revision: 232882

URL: https://gcc.gnu.org/viewcvs?rev=232882&root=gcc&view=rev
Log:
	PR c++/69379
	* constexpr.c (cxx_eval_constant_expression): Handle PTRMEM_CSTs
	wrapped in NOP_EXPRs.

	* g++.dg/pr69379.C: New test.

Added:
    trunk/gcc/testsuite/g++.dg/pr69379.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/constexpr.c
    trunk/gcc/testsuite/ChangeLog
Comment 13 Marek Polacek 2016-01-27 16:48:26 UTC
Hopefully fixed.