This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/53732] [4.7/4.8 Regression] "mismatching comparison operand types" on compile
- 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, 20 Jun 2012 16:40:05 +0000
- Subject: [Bug fortran/53732] [4.7/4.8 Regression] "mismatching comparison operand types" on compile
- Auto-submitted: auto-generated
- References: <bug-53732-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53732
Tobias Burnus <burnus at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |ice-on-valid-code,
| |wrong-code
CC| |burnus at gcc dot gnu.org
Target Milestone|--- |4.7.2
--- Comment #2 from Tobias Burnus <burnus at gcc dot gnu.org> 2012-06-20 16:40:05 UTC ---
The problem is the following code in trans-array.c's gfc_add_loop_ss_code:
switch (ss_info->type)
{
case GFC_SS_SCALAR:
...
gfc_conv_expr (&se, expr);
Here, expr is "0.0d0", which is properly converted. However:
if (expr->ts.type != BT_CHARACTER)
{
/* Move the evaluation of scalar expressions outside the
scalarization loop, except for WHERE assignments. */
if (subscript)
se.expr = convert(gfc_array_index_type, se.expr);
As subscript is true, the "0.0d0" gets converted to the integer "0".