https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93014
Bug ID: 93014 Summary: [9/10 Regression] ICE when initialising vector references with -flax-vector-conversions Product: gcc Version: 10.0 Status: UNCONFIRMED Keywords: ice-on-invalid-code Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: rsandifo at gcc dot gnu.org Target Milestone: --- This test: typedef unsigned int v4si __attribute__ ((vector_size(16))); typedef unsigned char v16qi __attribute__ ((vector_size(16))); extern v16qi x; v4si &y = x; ICEs with: a.c:4:11: internal compiler error: in convert_like_real, at cp/call.c:7670 This started with r260780, which had the effect of making lvalue_kind look through VIEW_CONVERT_EXPR in all cases, not just for location wrappers. This also means that: typedef unsigned int v4si __attribute__ ((vector_size(16))); typedef unsigned char v16qi __attribute__ ((vector_size(16))); extern v16qi x; v4si &y = reinterpret_cast<v4si>(x); is now valid despite the result of the cast being an rvalue. There might be two separate problems here: (1) Vector conversions aren't being treated as rvalues when they should be. (2) The convert_like_real check seems to be trying (at least partially) to reproduce the logic in reference_binding that led to bad_p being set to true. But the "from" type it's using is the result of the implicit conversion added by reference_binding rather than the "from" type that reference_binding was using. AFAICT he result of that implicit converson should always be reference-compatible with the reference type, so we don't get the error we expected for that case.