[patch] preserve DECL_ORIGINAL_TYPE invariant in remap_decl

Eric Botcazou ebotcazou@adacore.com
Fri Jun 24 19:39:00 GMT 2016


> Consider a comment pointing back to the relevant dwarf2 code that
> enforces the invariant.

I added the comment and installed the patch yesterday, but it breaks the 
Fortran compiler in some cases because, unlike the C family of compilers or 
the Ada compiler, the front-end builds TYPE_DECLs with DECL_ORIGINAL_TYPE for 
anonymous types (and even sets DECL_ORIGINAL_TYPE to TREE_TYPE for them).
That's useless and DECL_ORIGINAL_TYPE is skipped in this case by the DWARF 
back-end, but my patch inadvertently turns anonymous types into named types so 
the DWARF back-end now chokes.

Fixed by attached patchlet, tested on x86_64-suse-linux, applied as obvious.


2016-06-24  Eric Botcazou  <ebotcazou@adacore.com>

	PR debug/71642
        * tree-inline.c (remap_decl): When fixing up DECL_ORIGINAL_TYPE, just
	copy the type name.


2016-06-24  Eric Botcazou  <ebotcazou@adacore.com>

	* gfortran.dg/pr71642.f90: New test.

-- 
Eric Botcazou
-------------- next part --------------
A non-text attachment was scrubbed...
Name: p.diff
Type: text/x-patch
Size: 445 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20160624/9d5d8e9b/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr71642.f90
Type: text/x-fortran
Size: 833 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20160624/9d5d8e9b/attachment-0001.bin>


More information about the Gcc-patches mailing list