re PR tree-optimization/29788 (ICE in var_ann, at tree-flow-inline.h:130)

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

        PR tree-opt/29788
        * fold-const.c (fold_indirect_ref_1): Fold *&CONST_DECL down
        to what is the const decl is a place holder for.

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

        PR tree-opt/29788
        * gfortran.fortran-torture/compile/inline_1.f90:
        New testcase.

From-SVN: r118861
This commit is contained in:
Andrew Pinski 2006-11-15 17:04:56 +00:00 committed by Andrew Pinski
parent 47a37ce45e
commit f9f63ff215
4 changed files with 32 additions and 0 deletions

View File

@ -1,3 +1,9 @@
2006-11-15 Andrew Pinski <andrew_pinski@playstation.sony.com>
PR tree-opt/29788
* fold-const.c (fold_indirect_ref_1): Fold *&CONST_DECL down
to what is the const decl is a place holder for.
2006-11-15 Uros Bizjak <ubizjak@gmail.com> 2006-11-15 Uros Bizjak <ubizjak@gmail.com>
* config/i386/i386.opt: New target option -mx87regparm. * config/i386/i386.opt: New target option -mx87regparm.

View File

@ -13038,6 +13038,9 @@ fold_indirect_ref_1 (tree type, tree op0)
{ {
tree op = TREE_OPERAND (sub, 0); tree op = TREE_OPERAND (sub, 0);
tree optype = TREE_TYPE (op); tree optype = TREE_TYPE (op);
/* *&CONST_DECL -> to the value of the const decl. */
if (TREE_CODE (op) == CONST_DECL)
return DECL_INITIAL (op);
/* *&p => p; make sure to handle *&"str"[cst] here. */ /* *&p => p; make sure to handle *&"str"[cst] here. */
if (type == optype) if (type == optype)
{ {

View File

@ -1,3 +1,9 @@
2006-11-15 Andrew Pinski <andrew_pinski@playstation.sony.com>
PR tree-opt/29788
* gfortran.fortran-torture/compile/inline_1.f90:
New testcase.
2006-11-15 Uros Bizjak <ubizjak@gmail.com> 2006-11-15 Uros Bizjak <ubizjak@gmail.com>
* gcc.target/i386/x87regparm-1.c: New test. * gcc.target/i386/x87regparm-1.c: New test.

View File

@ -0,0 +1,17 @@
program gfcbug43
call try_fit (1)
call try_fit (1)
contains
subroutine try_fit (k)
call fit (1, debug=.true.)
end subroutine try_fit
subroutine fit (k, debug)
logical, intent(in), optional :: debug
do j = 1, 2
maxerr1 = funk (r ,x1 , x1)
end do
if (debug) then
print "help"
end if
end subroutine fit
end program gfcbug43