OSDN Git Service

* simplify.c (gfc_simplify_ibclr): Fix POS comparison.
authorbrooks <brooks@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 10 Jan 2007 07:42:56 +0000 (07:42 +0000)
committerbrooks <brooks@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 10 Jan 2007 07:42:56 +0000 (07:42 +0000)
(gfc_simplify_ibset): Same.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@120636 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/fortran/ChangeLog
gcc/fortran/simplify.c

index 8cf0bc3..7634dce 100644 (file)
@@ -1,5 +1,10 @@
 2007-01-09  Brooks Moses  <brooks.moses@codesourcery.com>
 
+       * simplify.c (gfc_simplify_ibclr): Fix POS comparison.
+       (gfc_simplify_ibset): Same.
+
+2007-01-09  Brooks Moses  <brooks.moses@codesourcery.com>
+
        PR 30381
        PR 30420
        * simplify.c (convert_mpz_to_unsigned): New function.
index 82005f1..d4cdc9e 100644 (file)
@@ -1280,7 +1280,7 @@ gfc_simplify_ibclr (gfc_expr * x, gfc_expr * y)
 
   k = gfc_validate_kind (x->ts.type, x->ts.kind, false);
 
-  if (pos > gfc_integer_kinds[k].bit_size)
+  if (pos >= gfc_integer_kinds[k].bit_size)
     {
       gfc_error ("Second argument of IBCLR exceeds bit size at %L",
                 &y->where);
@@ -1386,7 +1386,7 @@ gfc_simplify_ibset (gfc_expr * x, gfc_expr * y)
 
   k = gfc_validate_kind (x->ts.type, x->ts.kind, false);
 
-  if (pos > gfc_integer_kinds[k].bit_size)
+  if (pos >= gfc_integer_kinds[k].bit_size)
     {
       gfc_error ("Second argument of IBSET exceeds bit size at %L",
                 &y->where);