Re: patch needed to build gcc on ppc
On Mon, Sep 06, 1999 at 05:27:32PM -0400, Daniel Jacobowitz wrote:
> Anyway, this version still can't build apt; I have a workaround which
> I'm testing now.
Yep, fixed it. This patch is a bit of a hack; it's been fixed in the
mainline much better. Should be completely safe though.
Dan
/--------------------------------\ /--------------------------------\
| Daniel Jacobowitz |__| SCS Class of 2002 |
| Debian GNU/Linux Developer __ Carnegie Mellon University |
| dan@debian.org | | dmj+@andrew.cmu.edu |
\--------------------------------/ \--------------------------------/
#! /bin/sh -e
# DP: Work around memory corruption (just for 2.95.1)
# DP: by Daniel Jacobowitz <dan@debian.org>
if [ $# -eq 3 -a "$2" = '-d' ]; then
pdir="-d $3"
elif [ $# -ne 1 ]; then
echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
exit 1
fi
case "$1" in
-patch) patch $pdir -f --no-backup-if-mismatch -p1 < $0;;
-unpatch) patch $pdir -f --no-backup-if-mismatch -R -p1 < $0;;
*)
echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
exit 1
esac
exit 0
# append the patch here and adjust the -p? flag in the patch calls.
diff -rcp ../egcs/for-unstable/gcc-2.95/gcc/cp/cp-tree.h gcc-2.95/gcc/cp/cp-tree.h
*** ../egcs/for-unstable/gcc-2.95/gcc/cp/cp-tree.h Thu Jun 24 09:16:17 1999
--- gcc-2.95/gcc/cp/cp-tree.h Fri Aug 6 17:41:45 1999
*************** Boston, MA 02111-1307, USA. */
*** 52,58 ****
4: BINFO_NEW_VTABLE_MARKED.
TREE_HAS_CONSTRUCTOR (in INDIRECT_REF, SAVE_EXPR, CONSTRUCTOR,
or FIELD_DECL).
! 5: Not used.
6: Not used.
Usage of TYPE_LANG_FLAG_?:
--- 52,58 ----
4: BINFO_NEW_VTABLE_MARKED.
TREE_HAS_CONSTRUCTOR (in INDIRECT_REF, SAVE_EXPR, CONSTRUCTOR,
or FIELD_DECL).
! 5: CALL_EXPR_RTL_IS_TREE.
6: Not used.
Usage of TYPE_LANG_FLAG_?:
*************** extern int flag_new_for_scope;
*** 1614,1619 ****
--- 1614,1622 ----
/* Nonzero for _TYPE means that the _TYPE defines a destructor. */
#define TYPE_HAS_DESTRUCTOR(NODE) (TYPE_LANG_FLAG_2(NODE))
+
+ /* Nonzero for CALL_EXPR means that operands[2] is a cv_qualifier tree */
+ #define CALL_EXPR_RTL_IS_TREE(NODE) (TREE_LANG_FLAG_5(NODE))
#if 0
/* Nonzero for _TYPE node means that creating an object of this type
diff -rcp ../egcs/for-unstable/gcc-2.95/gcc/cp/lex.c gcc-2.95/gcc/cp/lex.c
*** ../egcs/for-unstable/gcc-2.95/gcc/cp/lex.c Thu Jun 24 09:16:26 1999
--- gcc-2.95/gcc/cp/lex.c Fri Aug 6 16:14:25 1999
*************** make_call_declarator (target, parms, cv_
*** 226,231 ****
--- 226,233 ----
tree target, parms, cv_qualifiers, exception_specification;
{
target = build_parse_node (CALL_EXPR, target, parms, cv_qualifiers);
+ if (cv_qualifiers != NULL_TREE)
+ CALL_EXPR_RTL_IS_TREE (target) = 1;
TREE_TYPE (target) = exception_specification;
return target;
}
*************** set_quals_and_spec (call_declarator, cv_
*** 235,240 ****
--- 237,246 ----
tree call_declarator, cv_qualifiers, exception_specification;
{
TREE_OPERAND (call_declarator, 2) = cv_qualifiers;
+ if (cv_qualifiers != NULL_TREE)
+ CALL_EXPR_RTL_IS_TREE (call_declarator) = 1;
+ else
+ CALL_EXPR_RTL_IS_TREE (call_declarator) = 0;
TREE_TYPE (call_declarator) = exception_specification;
}
diff -rcp ../egcs/for-unstable/gcc-2.95/gcc/cp/tree.c gcc-2.95/gcc/cp/tree.c
*** ../egcs/for-unstable/gcc-2.95/gcc/cp/tree.c Thu Jun 24 09:16:27 1999
--- gcc-2.95/gcc/cp/tree.c Fri Aug 6 16:08:20 1999
*************** mapcar (t, func)
*** 1887,1892 ****
--- 1887,1893 ----
/* tree.def says that operand two is RTL, but
make_call_declarator puts trees in there. */
if (TREE_OPERAND (t, 2)
+ && CALL_EXPR_RTL_IS_TREE (t)
&& TREE_CODE (TREE_OPERAND (t, 2)) == TREE_LIST)
TREE_OPERAND (t, 2) = mapcar (TREE_OPERAND (t, 2), func);
else
Reply to: