re PR fortran/26994 (Scalar TRANSFER - error: invalid operand to unary operator)

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
This commit is contained in:
Andrew Pinski 2006-11-13 14:36:09 +00:00 committed by Andrew Pinski
parent 46fb6400ee
commit 3e806a3df4
4 changed files with 35 additions and 0 deletions

View 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<68>üter <tobias.schlueter@physik.uni-muenchen.de>
* array.c: Add 2006 to copyright years.

View 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

View 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>

View file

@ -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