Commit c05800b6 by Jerry DeLisle

re PR fortran/35223 (IBITS gives compiler error)

2008-02-24  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR fortran/35223
	* simplify.c (gfc_simplify_ibclr), (gfc_simplify_ibits),
	(gfc_simplify_ibset): Remove call to range_check.
	(simplify_cmplx), (gfc_simplify_dble), (gfc_simplify_float)
	(gfc_simplify_real): Add call gfc_clear_ts to initialize the
	temporary gfc_typspec variable.

From-SVN: r132597
parent 849998c2
2008-02-24 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR fortran/35223
* simplify.c (gfc_simplify_ibclr), (gfc_simplify_ibits),
(gfc_simplify_ibset): Remove call to range_check.
(simplify_cmplx), (gfc_simplify_dble), (gfc_simplify_float)
(gfc_simplify_real): Add call gfc_clear_ts to initialize the
temporary gfc_typspec variable.
2008-02-23 Francois-Xavier Coudert <coudert@clipper.ens.fr> 2008-02-23 Francois-Xavier Coudert <coudert@clipper.ens.fr>
PR target/25477 PR target/25477
...@@ -7,7 +16,15 @@ ...@@ -7,7 +16,15 @@
gfor_fndecl_math_cpowl10, gfor_fndecl_math_cpowl16): Remove. gfor_fndecl_math_cpowl10, gfor_fndecl_math_cpowl16): Remove.
* trans-decl.c: Likewise. * trans-decl.c: Likewise.
2008-02-20 Jerry DeLisle <jvdelisle@gcc.gnu.org> 2008-02-22 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR fortran/35059
* expr.c (find_array_element): Modify traversing the constructor to
avoid trying to access NULL memory pointed to by next for the
last element. (find_array_section): Exit while loop if cons->next is
NULL.
2008-02-22 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR fortran/34907 PR fortran/34907
* iresolve.c (resolve_mask_arg): Add gfc_clear_ts to initialize * iresolve.c (resolve_mask_arg): Add gfc_clear_ts to initialize
......
...@@ -779,6 +779,7 @@ simplify_cmplx (const char *name, gfc_expr *x, gfc_expr *y, int kind) ...@@ -779,6 +779,7 @@ simplify_cmplx (const char *name, gfc_expr *x, gfc_expr *y, int kind)
if (x->is_boz) if (x->is_boz)
{ {
gfc_typespec ts; gfc_typespec ts;
gfc_clear_ts (&ts);
ts.kind = result->ts.kind; ts.kind = result->ts.kind;
ts.type = BT_REAL; ts.type = BT_REAL;
if (!gfc_convert_boz (x, &ts)) if (!gfc_convert_boz (x, &ts))
...@@ -789,6 +790,7 @@ simplify_cmplx (const char *name, gfc_expr *x, gfc_expr *y, int kind) ...@@ -789,6 +790,7 @@ simplify_cmplx (const char *name, gfc_expr *x, gfc_expr *y, int kind)
if (y && y->is_boz) if (y && y->is_boz)
{ {
gfc_typespec ts; gfc_typespec ts;
gfc_clear_ts (&ts);
ts.kind = result->ts.kind; ts.kind = result->ts.kind;
ts.type = BT_REAL; ts.type = BT_REAL;
if (!gfc_convert_boz (y, &ts)) if (!gfc_convert_boz (y, &ts))
...@@ -960,6 +962,7 @@ gfc_simplify_dble (gfc_expr *e) ...@@ -960,6 +962,7 @@ gfc_simplify_dble (gfc_expr *e)
if (e->ts.type == BT_INTEGER && e->is_boz) if (e->ts.type == BT_INTEGER && e->is_boz)
{ {
gfc_typespec ts; gfc_typespec ts;
gfc_clear_ts (&ts);
ts.type = BT_REAL; ts.type = BT_REAL;
ts.kind = gfc_default_double_kind; ts.kind = gfc_default_double_kind;
result = gfc_copy_expr (e); result = gfc_copy_expr (e);
...@@ -1148,6 +1151,7 @@ gfc_simplify_float (gfc_expr *a) ...@@ -1148,6 +1151,7 @@ gfc_simplify_float (gfc_expr *a)
if (a->is_boz) if (a->is_boz)
{ {
gfc_typespec ts; gfc_typespec ts;
gfc_clear_ts (&ts);
ts.type = BT_REAL; ts.type = BT_REAL;
ts.kind = gfc_default_real_kind; ts.kind = gfc_default_real_kind;
...@@ -1359,7 +1363,7 @@ gfc_simplify_ibclr (gfc_expr *x, gfc_expr *y) ...@@ -1359,7 +1363,7 @@ gfc_simplify_ibclr (gfc_expr *x, gfc_expr *y)
convert_mpz_to_signed (result->value.integer, convert_mpz_to_signed (result->value.integer,
gfc_integer_kinds[k].bit_size); gfc_integer_kinds[k].bit_size);
return range_check (result, "IBCLR"); return result;
} }
...@@ -1400,6 +1404,8 @@ gfc_simplify_ibits (gfc_expr *x, gfc_expr *y, gfc_expr *z) ...@@ -1400,6 +1404,8 @@ gfc_simplify_ibits (gfc_expr *x, gfc_expr *y, gfc_expr *z)
} }
result = gfc_constant_result (x->ts.type, x->ts.kind, &x->where); result = gfc_constant_result (x->ts.type, x->ts.kind, &x->where);
convert_mpz_to_unsigned (result->value.integer,
gfc_integer_kinds[k].bit_size);
bits = gfc_getmem (bitsize * sizeof (int)); bits = gfc_getmem (bitsize * sizeof (int));
...@@ -1421,7 +1427,10 @@ gfc_simplify_ibits (gfc_expr *x, gfc_expr *y, gfc_expr *z) ...@@ -1421,7 +1427,10 @@ gfc_simplify_ibits (gfc_expr *x, gfc_expr *y, gfc_expr *z)
gfc_free (bits); gfc_free (bits);
return range_check (result, "IBITS"); convert_mpz_to_signed (result->value.integer,
gfc_integer_kinds[k].bit_size);
return result;
} }
...@@ -1459,7 +1468,7 @@ gfc_simplify_ibset (gfc_expr *x, gfc_expr *y) ...@@ -1459,7 +1468,7 @@ gfc_simplify_ibset (gfc_expr *x, gfc_expr *y)
convert_mpz_to_signed (result->value.integer, convert_mpz_to_signed (result->value.integer,
gfc_integer_kinds[k].bit_size); gfc_integer_kinds[k].bit_size);
return range_check (result, "IBSET"); return result;
} }
...@@ -3020,6 +3029,7 @@ gfc_simplify_real (gfc_expr *e, gfc_expr *k) ...@@ -3020,6 +3029,7 @@ gfc_simplify_real (gfc_expr *e, gfc_expr *k)
if (e->ts.type == BT_INTEGER && e->is_boz) if (e->ts.type == BT_INTEGER && e->is_boz)
{ {
gfc_typespec ts; gfc_typespec ts;
gfc_clear_ts (&ts);
ts.type = BT_REAL; ts.type = BT_REAL;
ts.kind = kind; ts.kind = kind;
result = gfc_copy_expr (e); result = gfc_copy_expr (e);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment