2
0
mirror of git://gcc.gnu.org/git/gcc.git synced 2025-04-24 08:10:27 +08:00

error.c (error_print): Move increment out of the assert.

2012-09-17  Tobias Burnus  <burnus@net-b.de>

        * error.c (error_print): Move increment out of the assert.
        * interface.c (gfc_compare_derived_types): Add assert.
        (get_expr_storage_size): Remove always-true logical condition.
        * resolve.c (resolve_allocate_expr): Fix looping logic.
        * target-memory.c (gfc_target_expr_size): Add assert.

From-SVN: r191381
This commit is contained in:
Tobias Burnus 2012-09-17 12:13:12 +02:00 committed by Tobias Burnus
parent 3b9ee1cc73
commit c6423ef3e0
5 changed files with 19 additions and 7 deletions

@ -1,3 +1,11 @@
2012-09-17 Tobias Burnus <burnus@net-b.de>
* error.c (error_print): Move increment out of the assert.
* interface.c (gfc_compare_derived_types): Add assert.
(get_expr_storage_size): Remove always-true logical condition.
* resolve.c (resolve_allocate_expr): Fix looping logic.
* target-memory.c (gfc_target_expr_size): Add assert.
2012-09-16 Janus Weil <janus@gcc.gnu.org>
PR fortran/54594

@ -544,7 +544,8 @@ error_print (const char *type, const char *format0, va_list argp)
gcc_assert (pos >= 0);
while (ISDIGIT(*format))
format++;
gcc_assert (*format++ == '$');
gcc_assert (*format == '$');
format++;
}
else
pos++;

@ -396,11 +396,12 @@ gfc_compare_derived_types (gfc_symbol *derived1, gfc_symbol *derived2)
if (derived1 == derived2)
return 1;
gcc_assert (derived1 && derived2);
/* Special case for comparing derived types across namespaces. If the
true names and module names are the same and the module name is
nonnull, then they are equal. */
if (derived1 != NULL && derived2 != NULL
&& strcmp (derived1->name, derived2->name) == 0
if (strcmp (derived1->name, derived2->name) == 0
&& derived1->module != NULL && derived2->module != NULL
&& strcmp (derived1->module, derived2->module) == 0)
return 1;
@ -2267,8 +2268,7 @@ get_expr_storage_size (gfc_expr *e)
elements *= (end - start)/stride + 1L;
}
else if (ref->type == REF_ARRAY && ref->u.ar.type == AR_FULL
&& ref->u.ar.as->lower && ref->u.ar.as->upper)
else if (ref->type == REF_ARRAY && ref->u.ar.type == AR_FULL)
for (i = 0; i < ref->u.ar.as->rank; i++)
{
if (ref->u.ar.as->lower[i] && ref->u.ar.as->upper[i]

@ -7427,7 +7427,7 @@ check_symbols:
"statement at %L", &e->where);
goto failure;
}
break;
continue;
}
if (ar->dimen_type[i] == DIMEN_STAR && i == (ar->dimen + ar->codimen - 1)

@ -125,9 +125,12 @@ gfc_target_expr_size (gfc_expr *e)
/* Determine type size without clobbering the typespec for ISO C
binding types. */
gfc_typespec ts;
HOST_WIDE_INT size;
ts = e->ts;
type = gfc_typenode_for_spec (&ts);
return int_size_in_bytes (type);
size = int_size_in_bytes (type);
gcc_assert (size >= 0);
return size;
}
default:
gfc_internal_error ("Invalid expression in gfc_target_expr_size.");