OSDN Git Service

2010-05-14 Steven G. Kargl <kargl@gcc.gnu.org>
authorkargl <kargl@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 14 May 2010 21:02:26 +0000 (21:02 +0000)
committerkargl <kargl@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 14 May 2010 21:02:26 +0000 (21:02 +0000)
PR fortran/44135
* gfortran.dg/actual_array_interface_2.f90: New test.

2010-05-14  Steven G. Kargl  <kargl@gcc.gnu.org>

PR fortran/44135
* fortran/interface.c (get_sym_storage_size): Use signed instead of
unsigned mpz_get_?i routines.

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

gcc/fortran/ChangeLog
gcc/fortran/interface.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/actual_array_interface_2.f90 [new file with mode: 0644]

index c766d40..a95d16d 100644 (file)
@@ -1,3 +1,9 @@
+2010-05-14  Steven G. Kargl  <kargl@gcc.gnu.org>
+
+       PR fortran/44135
+       * fortran/interface.c (get_sym_storage_size): Use signed instead of
+       unsigned mpz_get_?i routines.
+
 2010-05-14  Jakub Jelinek  <jakub@redhat.com>
 
        * trans.c (trans_code): Set backend locus early.
index 38adf9b..4bcc63e 100644 (file)
@@ -1645,8 +1645,8 @@ get_sym_storage_size (gfc_symbol *sym)
          || sym->as->lower[i]->expr_type != EXPR_CONSTANT)
        return 0;
 
-      elements *= mpz_get_ui (sym->as->upper[i]->value.integer)
-                 - mpz_get_ui (sym->as->lower[i]->value.integer) + 1L;
+      elements *= mpz_get_si (sym->as->upper[i]->value.integer)
+                 - mpz_get_si (sym->as->lower[i]->value.integer) + 1L;
     }
 
   return strlen*elements;
index b96b9a3..4cf7112 100644 (file)
@@ -1,3 +1,8 @@
+2010-05-14  Steven G. Kargl  <kargl@gcc.gnu.org>
+
+       PR fortran/44135
+       * gfortran.dg/actual_array_interface_2.f90: New test.
+
 2010-05-14  Richard Guenther  <rguenther@suse.de>
 
        PR tree-optimization/44119
diff --git a/gcc/testsuite/gfortran.dg/actual_array_interface_2.f90 b/gcc/testsuite/gfortran.dg/actual_array_interface_2.f90
new file mode 100644 (file)
index 0000000..ae429b7
--- /dev/null
@@ -0,0 +1,13 @@
+! { dg-do compile }
+program gprogram
+   implicit none
+   real, dimension(-2:0) :: my_arr
+   call fill_array(my_arr)
+   contains
+      subroutine  fill_array(arr)
+         implicit none
+         real, dimension(-2:0), intent(out) :: arr
+         arr = 42
+      end subroutine fill_array
+end program gprogram
+