On Wed, Feb 7, 2018 at 4:14 PM, Jakub Jelinek <ja...@redhat.com> wrote: > On Wed, Feb 07, 2018 at 03:52:39PM -0500, Jason Merrill wrote: >> > E.g. the constexpr function uses same_type_ignoring_top_level_qualifiers_p >> > instead of == type comparisons, the COMPONENT_REF stuff, ... >> >> > For poly_* stuff, I think Richard S. wants to introduce it into the FEs at >> > some point, but I could be wrong; certainly it hasn't been done yet and >> > generally, poly*int seems to be a nightmare to deal with. >> >> Yes, I understand how we got to this point, but having the functions >> diverge because of this guideline seems like a mistake. And there >> seem to be two ways to avoid the divergence: make an exception to the >> guideline, or move the function. > > Functionally, I think the following patch should turn fold_indirect_ref_1 > to be equivalent to the patched constexpr.c version (with the known > documented differences), so if this is the obstackle for the acceptance > of the patch, I can test this. > > Otherwise, I must say I have no idea how to share the code, > same_type_ignoring_qualifiers is only a C++ FE function, so the middle-end > can't use it even conditionally, and similarly with the TBAA issues.
Again, can we make an exception and use poly_int in this function because it's mirroring a middle-end function? Jason