]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR fortran/26994 (Scalar TRANSFER - error: invalid operand to unary operator)
authorAndrew Pinski <andrew_pinski@playstation.sony.com>
Mon, 13 Nov 2006 14:36:09 +0000 (14:36 +0000)
committerAndrew Pinski <pinskia@gcc.gnu.org>
Mon, 13 Nov 2006 14:36:09 +0000 (06:36 -0800)
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  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.

From-SVN: r118761

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 0c0d4bd403e19923aa71ede1f6097a6fed22710b..3cd8b11641f3bb8a85fe6f60905e729c9e5a8cd4 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 6f1e163d46a6f5d8a7c4125a5880f4629b927b4a..6d8b8b9865d07dbf11291813b19c361d001ad92e 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 6077396aa68fc2cee171a607ea200f193db38bcf..9eba88e4825cfb641e6c53173266238cdce79bf7 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