Commit 90966337 by H.J. Lu Committed by H.J. Lu

Check that result of string folding is of integral type.

gcc/

2010-09-10  H.J. Lu  <hongjiu.lu@intel.com>

	PR middle-end/45634
	* tree-ssa-ccp.c (fold_const_aggregate_ref): Check that result
	of string folding is of integral type.

gcc/testsuite/

2010-09-10  H.J. Lu  <hongjiu.lu@intel.com>

	PR middle-end/45634
	* gfortran.fortran-torture/compile/pr45634.f90: New.

From-SVN: r164183
parent e1d9659d
2010-09-10 H.J. Lu <hongjiu.lu@intel.com>
PR middle-end/45634
* tree-ssa-ccp.c (fold_const_aggregate_ref): Check that result
of string folding is of integral type.
2010-09-10 Ryan Mansfield <rmansfield@qnx.com> 2010-09-10 Ryan Mansfield <rmansfield@qnx.com>
* doc/invoke.texi (-x): Fix typo. * doc/invoke.texi (-x): Fix typo.
......
2010-09-10 H.J. Lu <hongjiu.lu@intel.com>
PR middle-end/45634
* gfortran.fortran-torture/compile/pr45634.f90: New.
2010-09-10 Nicola Pero <nicola.pero@meta-innovation.com> 2010-09-10 Nicola Pero <nicola.pero@meta-innovation.com>
* objc.dg/fobjc-exceptions.m: New test. * objc.dg/fobjc-exceptions.m: New test.
......
SUBROUTINE RCRDRD (VTYP)
CHARACTER(4), INTENT(OUT) :: VTYP
CHARACTER(1), SAVE :: DBL = "D"
VTYP = DBL
END
...@@ -1537,8 +1537,9 @@ fold_const_aggregate_ref (tree t) ...@@ -1537,8 +1537,9 @@ fold_const_aggregate_ref (tree t)
/* Fold read from constant string. */ /* Fold read from constant string. */
if (TREE_CODE (ctor) == STRING_CST) if (TREE_CODE (ctor) == STRING_CST)
{ {
if ((TYPE_MODE (TREE_TYPE (t)) if (INTEGRAL_TYPE_P (TREE_TYPE (t))
== TYPE_MODE (TREE_TYPE (TREE_TYPE (ctor)))) && (TYPE_MODE (TREE_TYPE (t))
== TYPE_MODE (TREE_TYPE (TREE_TYPE (ctor))))
&& (GET_MODE_CLASS (TYPE_MODE (TREE_TYPE (TREE_TYPE (ctor)))) && (GET_MODE_CLASS (TYPE_MODE (TREE_TYPE (TREE_TYPE (ctor))))
== MODE_INT) == MODE_INT)
&& GET_MODE_SIZE (TYPE_MODE (TREE_TYPE (TREE_TYPE (ctor)))) == 1 && GET_MODE_SIZE (TYPE_MODE (TREE_TYPE (TREE_TYPE (ctor)))) == 1
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment