[Bug fortran/54599] Issues found in gfortran by the Coverity Scan
burnus at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Tue Sep 18 09:29:00 GMT 2012
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54599
--- Comment #3 from Tobias Burnus <burnus at gcc dot gnu.org> 2012-09-18 09:28:46 UTC ---
Dump two patches here. First is about a pointless check ("nl->sym->..." is used
all over the place) and the second: If the assert fails, we would use
TREE_TYPE(NULL_TREE) ...
--- a/gcc/fortran/resolve.c
+++ b/gcc/fortran/resolve.c
@@ -12481 +12481 @@ resolve_fl_namelist (gfc_symbol *sym)
- if (nl->sym && nl->sym->name)
+ if (nl->sym->name)
--- a/gcc/fortran/trans-array.c
+++ b/gcc/fortran/trans-array.c
@@ -1024,4 +1024,4 @@ gfc_trans_create_temp_array (stmtblock_t * pre,
stmtblock_t * post, gfc_ss * ss,
{
- if (POINTER_TYPE_P (TREE_TYPE (initial)))
- class_expr = build_fold_indirect_ref_loc (input_location, initial);
+ gcc_assert (POINTER_TYPE_P (TREE_TYPE (initial)));
+ class_expr = build_fold_indirect_ref_loc (input_location, initial);
eltype = TREE_TYPE (class_expr);
More information about the Gcc-bugs
mailing list