This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[patch, fortran] PR35223 IBITS gives compiler error
- From: Jerry DeLisle <jvdelisle at verizon dot net>
- To: Fortran List <fortran at gcc dot gnu dot org>
- Cc: gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Sat, 23 Feb 2008 13:30:50 -0800
- Subject: [patch, fortran] PR35223 IBITS gives compiler error
This is a simple patch. It removes the call to range_check for three of the
bit-manipulation functions.
While I was at it, I threw in some more gfc_clear_ts in a few spots.
I see no need for a test case for these things, but will do so if someone deems
it is needed.
Regression tested on x86-64. OK for trunk?
Best regards,
Jerry
2008-02-23 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 variables.
Index: simplify.c
===================================================================
--- simplify.c (revision 132577)
+++ simplify.c (working copy)
@@ -779,6 +779,7 @@ simplify_cmplx (const char *name, gfc_ex
if (x->is_boz)
{
gfc_typespec ts;
+ gfc_clear_ts (&ts);
ts.kind = result->ts.kind;
ts.type = BT_REAL;
if (!gfc_convert_boz (x, &ts))
@@ -789,6 +790,7 @@ simplify_cmplx (const char *name, gfc_ex
if (y && y->is_boz)
{
gfc_typespec ts;
+ gfc_clear_ts (&ts);
ts.kind = result->ts.kind;
ts.type = BT_REAL;
if (!gfc_convert_boz (y, &ts))
@@ -960,6 +962,7 @@ gfc_simplify_dble (gfc_expr *e)
if (e->ts.type == BT_INTEGER && e->is_boz)
{
gfc_typespec ts;
+ gfc_clear_ts (&ts);
ts.type = BT_REAL;
ts.kind = gfc_default_double_kind;
result = gfc_copy_expr (e);
@@ -1148,6 +1151,7 @@ gfc_simplify_float (gfc_expr *a)
if (a->is_boz)
{
gfc_typespec ts;
+ gfc_clear_ts (&ts);
ts.type = BT_REAL;
ts.kind = gfc_default_real_kind;
@@ -1359,7 +1363,7 @@ gfc_simplify_ibclr (gfc_expr *x, gfc_exp
convert_mpz_to_signed (result->value.integer,
gfc_integer_kinds[k].bit_size);
- return range_check (result, "IBCLR");
+ return result;
}
@@ -1421,7 +1425,7 @@ gfc_simplify_ibits (gfc_expr *x, gfc_exp
gfc_free (bits);
- return range_check (result, "IBITS");
+ return result;
}
@@ -1459,7 +1463,7 @@ gfc_simplify_ibset (gfc_expr *x, gfc_exp
convert_mpz_to_signed (result->value.integer,
gfc_integer_kinds[k].bit_size);
- return range_check (result, "IBSET");
+ return result;
}
@@ -3020,6 +3024,7 @@ gfc_simplify_real (gfc_expr *e, gfc_expr
if (e->ts.type == BT_INTEGER && e->is_boz)
{
gfc_typespec ts;
+ gfc_clear_ts (&ts);
ts.type = BT_REAL;
ts.kind = kind;
result = gfc_copy_expr (e);