http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47939
--- Comment #5 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-03-01 15:41:53 UTC --- The patch bootstrapped and tested ok. Removing if (!flag_gen_aux_info && (TYPE_QUALS (element_type))) type = TYPE_MAIN_VARIANT (type); unconditionally breaks gcc.dg/array-quals-2.c (but nothing else). Whether that is a bug or such radical fix is wrong remains to be determined. Changing types based on flag_gen_aux_info definitely looks wrong. Probably a better general approach would be to make c_build_qualified_type also take a desired name as argument instead of using TYPE_NAME.