Hello, Thanks for your suggestions, Jason. On 05/08/2017 06:27 PM, Jason Merrill wrote: >> That seems like a bug; if gen_typedef_die is going to generate a DIE >> for a cloned typedef, it needs to associate the type with the DIE. Hm… gen_typedef_die generates a DIE for a DECL node, but modified_type_die look for a DIE for the corresponding TYPE, and of course the lookup returns NULL. So just removing the “if (DECL_ABSTRACT_P (decl))” condition in gen_typedef_die is not enough to make the crash go away. >> This is unnecessarily complicated; at this point we already know that >> TYPE_NAME (qualified_type) is non-null and in the variable "name". Fixed, thanks! >> gen_typedef_die does create a DIE for them, it just doesn't do it >> properly. But we could change gen_typedef_die to abort in that case, >> making this comment correct. > > Something like this, which also avoids routinely creating DIEs for > local typedefs that will only be pruned away later; this patch doesn't > change the size of .debug_info in cc1plus. I tried this, but I got a crash when compiling the Ada runtime (g-awk.adb). I could not extract a reproducer, but the idea is that because of the call to set_decl_origin_self, some DECLs have themselves as DECL_ABSTRACT_ORIGIN. As a result, my patch in modified_type_die does not prevent execution from calling gen_typedef_die with a DECL that has a non-null abstract origin. So I have to soften the assertion so that this specific case was still allowed in gen_typedef_die. So here’s the update patch: bootstrapped and regtested fine on x86_64-linux. -- Pierre-Marie de Rodat