[PATCH] Fix PR fortran/26994, transfer with a constant (CONST_DECL) vs the inliner

Andrew Pinski pinskia@gmail.com
Mon Nov 13 06:12:00 GMT 2006


Hi,
  The problem here is the after inlining the middle-end no longer thinks
the address of a CONST_DECL from the inlined function is invariant.
This causes ICEs, either we get an invalid operand to unary operand or
in newer GCCs, "control flow in the middle of basic block".

This patch fixes the problem by marking the CONST_DECL as "static".

OK? Bootstrapped and tested on i686-linux-gnu with no regressions.

Thanks,
Andrew Pinski

ChangeLog:

	* trans-expr.c (gfc_conv_expr_reference): Set TREE_STATIC on the
	new CONST_DECL.

	* gfortran.fortran-torture/compile/transfer-1.f90: New testcase.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fixconstdecl.diff.txt
Type: text/x-patch
Size: 1227 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20061113/7cddb319/attachment.bin>


More information about the Fortran mailing list