This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/52162] Bogus -fcheck=bounds with realloc on assignment to unallocated LHS
- 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: Thu, 09 Feb 2012 17:17:03 +0000
- Subject: [Bug fortran/52162] Bogus -fcheck=bounds with realloc on assignment to unallocated LHS
- Auto-submitted: auto-generated
- References: <bug-52162-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52162
--- Comment #1 from Tobias Burnus <burnus at gcc dot gnu.org> 2012-02-09 17:17:03 UTC ---
a = b
The problem is that the LHS is REAL(4) while the RHS is REAL(8). Thus, the
expression is not <variable A> = <variable B> but
<variable A> = __convert_i8_i4 (<variable B>)
But trans-array's gfc_trans_assignment_1 contains:
if (gfc_is_reallocatable_lhs (expr1)
&& !(expr2->expr_type == EXPR_FUNCTION
&& expr2->value.function.isym != NULL))
lss->is_alloc_lhs = 1;
As expr2->value.function.isym is set (expr2->value.function.isym->id ==
GFC_ISYM_CONVERSION), the is_alloc_lhs is not set. Hence, the bound checking
code is inserted.