Skip to content

Commit

Permalink
2012-09-17 Tobias Burnus <burnus@net-b.de>
Browse files Browse the repository at this point in the history
        * 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.



git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@191381 138bc75d-0d04-0410-961f-82ee72b054a4
  • Loading branch information
burnus committed Sep 17, 2012
1 parent 2a155cf commit b3034d8
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 7 deletions.
8 changes: 8 additions & 0 deletions gcc/fortran/ChangeLog
Original file line number Diff line number Diff line change
@@ -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
Expand Down
3 changes: 2 additions & 1 deletion gcc/fortran/error.c
Original file line number Diff line number Diff line change
Expand Up @@ -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++;
Expand Down
8 changes: 4 additions & 4 deletions gcc/fortran/interface.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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]
Expand Down
2 changes: 1 addition & 1 deletion gcc/fortran/resolve.c
Original file line number Diff line number Diff line change
Expand Up @@ -7427,7 +7427,7 @@ resolve_allocate_expr (gfc_expr *e, gfc_code *code)
"statement at %L", &e->where);
goto failure;
}
break;
continue;
}

if (ar->dimen_type[i] == DIMEN_STAR && i == (ar->dimen + ar->codimen - 1)
Expand Down
5 changes: 4 additions & 1 deletion gcc/fortran/target-memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.");
Expand Down

0 comments on commit b3034d8

Please sign in to comment.