This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/50815] ICE on allocation of deferred length character scalar dummy argument when -fbounds-check
- From: "burnus at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 26 Oct 2011 11:36:59 +0000
- Subject: [Bug fortran/50815] ICE on allocation of deferred length character scalar dummy argument when -fbounds-check
- Auto-submitted: auto-generated
- References: <bug-50815-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50815
Tobias Burnus <burnus at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |ice-on-valid-code, patch
Status|UNCONFIRMED |NEW
Last reconfirmed| |2011-10-26
CC| |burnus at gcc dot gnu.org
Ever Confirmed|0 |1
--- Comment #2 from Tobias Burnus <burnus at gcc dot gnu.org> 2011-10-26 11:36:59 UTC ---
With the trunk (i.e. tree checking) one gets:
test.f90:1:0: error: mismatching comparison operand types
integer(kind=4) *
integer(kind=4)
D.1725 = _string != .string;
test.f90:1:0: internal compiler error: verify_gimple failed
The issue is that the check "Actual string length does not match the declared
one for dummy argument" does not make sense for assumed-shape arrays.
--- a/gcc/fortran/trans-decl.c
+++ b/gcc/fortran/trans-decl.c
@@ -4654,8 +4654,10 @@ add_argument_checking (stmtblock_t *block, gfc_symbol
*sym)
if the actual argument is (part of) an array, but only if the
dummy argument is an array. (See "Sequence association" in
Section 12.4.1.4 for F95 and 12.4.1.5 for F2003.) */
- if (fsym->attr.pointer || fsym->attr.allocatable
- || (fsym->as && fsym->as->type == AS_ASSUMED_SHAPE))
+ if (fsym->ts.deferred)
+ continue;
+ else if (fsym->attr.pointer || fsym->attr.allocatable
+ || (fsym->as && fsym->as->type == AS_ASSUMED_SHAPE))
{
comparison = NE_EXPR;
message = _("Actual string length does not match the declared one"