This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Fix more type errors
- From: Richard Guenther <rguenth at tat dot physik dot uni-tuebingen dot de>
- To: gcc-patches at gcc dot gnu dot org
- Date: Wed, 01 Jun 2005 23:38:08 +0200
- Subject: [PATCH] Fix more type errors
More stuff catched by instrumentation.
Ok if bootstrap and testing succeeds?
Richard.
2005-06-01 Richard Guenther <rguenth@gcc.gnu.org>
* c-typeck.c (build_indirect_ref): Build INDIRECT_REF
with correct type.
* fold-const.c (fold_unary): Adjust type of Y in folding
of (T1)((T2)X op Y) to (T1)X op Y.
Index: c-typeck.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/c-typeck.c,v
retrieving revision 1.446
diff -c -3 -p -r1.446 c-typeck.c
*** c-typeck.c 25 May 2005 03:58:56 -0000 1.446
--- c-typeck.c 1 Jun 2005 21:34:28 -0000
*************** build_indirect_ref (tree ptr, const char
*** 1638,1649 ****
else
{
tree t = TREE_TYPE (type);
- tree mvt = t;
tree ref;
! if (TREE_CODE (mvt) != ARRAY_TYPE)
! mvt = TYPE_MAIN_VARIANT (mvt);
! ref = build1 (INDIRECT_REF, mvt, pointer);
if (!COMPLETE_OR_VOID_TYPE_P (t) && TREE_CODE (t) != ARRAY_TYPE)
{
--- 1635,1643 ----
else
{
tree t = TREE_TYPE (type);
tree ref;
! ref = build1 (INDIRECT_REF, t, pointer);
if (!COMPLETE_OR_VOID_TYPE_P (t) && TREE_CODE (t) != ARRAY_TYPE)
{
Index: fold-const.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fold-const.c,v
retrieving revision 1.589
diff -c -3 -p -r1.589 fold-const.c
*** fold-const.c 1 Jun 2005 18:51:12 -0000 1.589
--- fold-const.c 1 Jun 2005 21:34:29 -0000
*************** fold_unary (enum tree_code code, tree ty
*** 7072,7078 ****
if (s0 && s1 && operand_equal_p (s0, s1, OEP_ONLY_CONST))
return build2 (TREE_CODE (arg0), t0, fold_convert (t0, arg00),
! TREE_OPERAND (arg0, 1));
}
tem = fold_convert_const (code, type, arg0);
--- 7072,7078 ----
if (s0 && s1 && operand_equal_p (s0, s1, OEP_ONLY_CONST))
return build2 (TREE_CODE (arg0), t0, fold_convert (t0, arg00),
! fold_convert (t0, TREE_OPERAND (arg0, 1)));
}
tem = fold_convert_const (code, type, arg0);