https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87325
--- Comment #6 from Richard Biener <rguenth at gcc dot gnu.org> --- (In reply to Drea Pinski from comment #5) > I just noticed this also. > > determine_base_object_1 uses a bare ptr_type_node in 2 places when it should > have used one with the corrected namespace on it. > > obj = fold_convert (ptr_type_node, build_fold_addr_expr (base)); > ... > obj = fold_convert (generic_type_for (TREE_TYPE (*tp)), *tp); > > I will fix those. Note that this base_object isn't directly used, it's used to compare against other base objects for equality and as flag. The conversion is probably done to make the compare succeed when there are slight differences to the type of the ADDR_EXPR for whatever reason. I'd instead remove the casting.
