This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
PATCH: K&R fixes for bootstrap with HP bundled compiler
- From: "John David Anglin" <dave at hiauly1 dot hia dot nrc dot ca>
- To: gcc-patches at gcc dot gnu dot org
- Date: Fri, 11 Oct 2002 14:19:25 -0400 (EDT)
- Subject: PATCH: K&R fixes for bootstrap with HP bundled compiler
With the enclosed patch, I was successfuly able to do a complete bootstrap
and check using the HP native compiler in K&R mode (-Ac). No regressions
were observed on hppa64-hp-hpux11.00.
The fix to tree.c is probably relevant to the 3.2 branch as well.
Ok?
Dave
--
J. David Anglin dave.anglin@nrc.ca
National Research Council of Canada (613) 990-0752 (FAX: 952-6605)
2002-10-11 John David Anglin <dave@hiauly1.hia.nrc.ca>
* cfganal.c (dfs_enumerate_from): Use PARAMS.
* genautomata.c (output_insn_code_cases): Likewise.
* real.c (real_format): Likewise.
* tree.c (tree_size): Revise expressions using TREE_CODE_LENGTH to
ensure value is promoted before doing subtraction.
Index: cfganal.c
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/cfganal.c,v
retrieving revision 1.29
diff -u -3 -p -r1.29 cfganal.c
--- cfganal.c 27 Sep 2002 22:59:29 -0000 1.29
+++ cfganal.c 11 Oct 2002 17:30:28 -0000
@@ -1134,7 +1134,7 @@ int
dfs_enumerate_from (bb, reverse, predicate, rslt, rslt_max, data)
basic_block bb;
int reverse;
- bool (*predicate) (basic_block, void *);
+ bool (*predicate) PARAMS ((basic_block, void *));
basic_block *rslt;
int rslt_max;
void *data;
Index: genautomata.c
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/genautomata.c,v
retrieving revision 1.24
diff -u -3 -p -r1.24 genautomata.c
--- genautomata.c 21 Aug 2002 23:24:10 -0000 1.24
+++ genautomata.c 11 Oct 2002 17:30:33 -0000
@@ -7990,7 +7990,7 @@ output_max_insn_queue_index_def ()
function *output_automata_list_code. */
static void
output_insn_code_cases (output_automata_list_code)
- void (*output_automata_list_code) (automata_list_el_t);
+ void (*output_automata_list_code) PARAMS ((automata_list_el_t));
{
decl_t decl, decl2;
int i, j;
Index: real.h
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/real.h,v
retrieving revision 1.56
diff -u -3 -p -r1.56 real.h
--- real.h 4 Oct 2002 08:01:12 -0000 1.56
+++ real.h 11 Oct 2002 17:30:33 -0000
@@ -104,8 +104,10 @@ extern char test_real_width
struct real_format
{
/* Move to and from the target bytes. */
- void (*encode) (const struct real_format *, long *, const REAL_VALUE_TYPE *);
- void (*decode) (const struct real_format *, REAL_VALUE_TYPE *, const long *);
+ void (*encode) PARAMS ((const struct real_format *, long *,
+ const REAL_VALUE_TYPE *));
+ void (*decode) PARAMS ((const struct real_format *, REAL_VALUE_TYPE *,
+ const long *));
/* The radix of the exponent and digits of the significand. */
int b;
Index: tree.c
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/tree.c,v
retrieving revision 1.274
diff -u -3 -p -r1.274 tree.c
--- tree.c 27 Sep 2002 12:48:04 -0000 1.274
+++ tree.c 11 Oct 2002 17:30:33 -0000
@@ -177,7 +177,7 @@ tree_size (node)
case '1': /* a unary arithmetic expression */
case '2': /* a binary arithmetic expression */
return (sizeof (struct tree_exp)
- + (TREE_CODE_LENGTH (code) - 1) * sizeof (char *));
+ + TREE_CODE_LENGTH (code) * sizeof (char *) - sizeof (char *));
case 'c': /* a constant */
/* We can't use TREE_CODE_LENGTH for INTEGER_CST, since the number of
@@ -199,7 +199,7 @@ tree_size (node)
length = (sizeof (struct tree_common)
+ TREE_CODE_LENGTH (code) * sizeof (char *));
if (code == TREE_VEC)
- length += (TREE_VEC_LENGTH (node) - 1) * sizeof (char *);
+ length += TREE_VEC_LENGTH (node) * sizeof (char *) - sizeof (char *);
return length;
}