http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60836
Bug ID: 60836 Summary: [4.9 Regression] invalid PHI argument and ICE in verify_gimple Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: ppluzhnikov at google dot com Google ref: b/14002147 Using current trunk @r209347 gcc -c -O2 t.ii && echo OK OK gcc -c -O2 t.ii -ftree-vectorize t.ii: In function ‘double norm_(const int&) [with <template-parameter-1-1> = int; <template-parameter-1-2> = A]’: t.ii:19:1: error: invalid PHI argument norm_ (const int &) ^ {pretmp_20, pretmp_20, pretmp_20, pretmp_20} vect_p1_13.20_56 = PHI <{pretmp_20, pretmp_20, pretmp_20, pretmp_20}(5), vect_p1_13.20_60(13)> t.ii:19:1: error: invalid PHI argument {pretmp_20, pretmp_20, pretmp_20, pretmp_20} vect_p1_13.20_57 = PHI <{pretmp_20, pretmp_20, pretmp_20, pretmp_20}(5), vect_p1_13.20_61(13)> t.ii:19:1: error: invalid PHI argument {pretmp_20, pretmp_20, pretmp_20, pretmp_20} vect_p1_13.20_58 = PHI <{pretmp_20, pretmp_20, pretmp_20, pretmp_20}(5), vect_p1_13.20_62(13)> t.ii:19:1: internal compiler error: verify_gimple failed 0xb82d63 verify_gimple_in_cfg(function*) ../../gcc/tree-cfg.c:4942 0xaab2c2 execute_function_todo ../../gcc/passes.c:1853 0xaabc23 execute_todo ../../gcc/passes.c:1887 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. Test case: int a, b; typedef double (*NormFunc) (const int &); int & max (int &p1, int &p2) { if (p1 < p2) return p2; return p1; } struct A { int operator () (int p1, int p2) { return max (p1, p2); } }; template < class, class > double norm_ (const int &) { char c, d; A e; for (; a; a++) { b = e (b, d); b = e (b, c); } } void norm () { static NormFunc f = norm_ < int, A >; f = 0; }