This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: [PATCH] Emit Fortran PARAMETERs as DW_TAG_constant into debuginfo
Your patch restores bootstrap with Ada on x86_64-linux, thanks!
Laurent
On Sat, 2008-08-30 at 09:24 -0400, Jakub Jelinek wrote:
> On Sat, Aug 30, 2008 at 02:29:49PM +0200, Laurent GUERBY wrote:
> > I confirm the patch below is the source of the Ada bootstrap failure:
> > rev 139779 works and rev 139781 fails.
>
> I think following patch should fix it (the first hunk only is needed,
> the second one is just to handle more initializers). Will bootstrap/regtest
> it later this afternoon.
>
> BTW, in the backport of the native_encode_initializer patch to 4.3 branch
> Ada passed a type in DECL_INITIALIZER, the committed patch will avoid
> it because of the inializer_constant_valid_p test I've added, but having
> type in DECL_INITIALIZER seems terribly broken to me and surprises me
> other code doesn't break on it.
> In particular it was a PARM_DECL, which had
> TREE_TYPE (parm) == DECL_INITIALIZER (parm)
> && TREE_CODE (TREE_TYPE (parm)) == RECORD_TYPE.
>
> 2008-08-30 Jakub Jelinek <jakub@redhat.com>
>
> * dwarf2out.c (native_encode_initializer): Subtract min_index for
> non-range array index. Handle VIEW_CONVERT_EXPR and NON_LVALUE_EXPR.
>
> --- gcc/dwarf2out.c.jj 2008-08-29 20:54:14.000000000 +0200
> +++ gcc/dwarf2out.c 2008-08-30 15:09:42.000000000 +0200
> @@ -11846,7 +11846,7 @@ native_encode_initializer (tree init, un
> pos = (tree_low_cst (TREE_OPERAND (index, 0), 0) - min_index)
> * fieldsize;
> else if (index)
> - pos = tree_low_cst (index, 0) * fieldsize;
> + pos = (tree_low_cst (index, 0) - min_index) * fieldsize;
>
> if (val)
> {
> @@ -11916,6 +11916,9 @@ native_encode_initializer (tree init, un
> return true;
> }
> return false;
> + case VIEW_CONVERT_EXPR:
> + case NON_LVALUE_EXPR:
> + return native_encode_initializer (TREE_OPERAND (init, 0), array, size);
> default:
> return native_encode_expr (init, array, size) == size;
> }
>
>
> Jakub
>