OSDN Git Service

2006-11-12 Andrew Pinski <andrew_pinski@playstation.sony.com>
authorpinskia <pinskia@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 13 Nov 2006 14:36:09 +0000 (14:36 +0000)
committerpinskia <pinskia@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 13 Nov 2006 14:36:09 +0000 (14:36 +0000)
        PR fortran/26994
        * gfortran.fortran-torture/compile/transfer-1.f90:
        New testcase.

2006-11-12  Andrew Pinski  <andrew_pinski@playstation.sony.com>

        PR fortran/26994
        * trans-expr.c (gfc_conv_expr_reference): Set TREE_STATIC on the
        new CONST_DECL.

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

gcc/fortran/ChangeLog
gcc/fortran/trans-expr.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.fortran-torture/compile/transfer-1.f90 [new file with mode: 0644]

index 0c0d4bd..3cd8b11 100644 (file)
@@ -1,3 +1,9 @@
+2006-11-12  Andrew Pinski  <andrew_pinski@playstation.sony.com>
+
+       PR fortran/26994
+       * trans-expr.c (gfc_conv_expr_reference): Set TREE_STATIC on the
+       new CONST_DECL.
+
 2006-11-11  Tobias Schl\81├╝ter  <tobias.schlueter@physik.uni-muenchen.de>
 
        * array.c: Add 2006 to copyright years.
index 6f1e163..6d8b8b9 100644 (file)
@@ -3104,6 +3104,7 @@ gfc_conv_expr_reference (gfc_se * se, gfc_expr * expr)
     {
       var = build_decl (CONST_DECL, NULL, TREE_TYPE (se->expr));
       DECL_INITIAL (var) = se->expr;
+      TREE_STATIC (var) = 1;
       pushdecl (var);
     }
   else
index 6077396..9eba88e 100644 (file)
@@ -1,3 +1,9 @@
+2006-11-12  Andrew Pinski  <andrew_pinski@playstation.sony.com>
+
+       PR fortran/26994
+       * gfortran.fortran-torture/compile/transfer-1.f90:
+       New testcase.
+
 2006-11-12  H.J. Lu  <hongjiu.lu@intel.com>
            Zdenek Dvorak <dvorakz@suse.cz>
 
diff --git a/gcc/testsuite/gfortran.fortran-torture/compile/transfer-1.f90 b/gcc/testsuite/gfortran.fortran-torture/compile/transfer-1.f90
new file mode 100644 (file)
index 0000000..9fa4bfc
--- /dev/null
@@ -0,0 +1,22 @@
+! Bigendian test posted by Perseus in comp.lang.fortran on 4 July 2005.
+   integer(1), parameter :: zero = 0
+   LOGICAL, PARAMETER :: bigend = IACHAR(TRANSFER(1,"a")) == zero
+   LOGICAL :: bigendian
+   call foo ()
+contains
+   subroutine foo ()
+   integer :: chr, ans
+   if (bigend) then
+     ans = 1
+   else
+     ans = 0
+   end if
+   chr = IACHAR(TRANSFER(1,"a"))
+   bigendian =  chr == 0_4
+   if (bigendian) then
+     ans = 1
+   else
+     ans = 0
+   end if
+   end subroutine foo
+end