From mboxrd@z Thu Jan 1 00:00:00 1970 From: "John David Anglin" To: rth@redhat.com (Richard Henderson) Cc: gcc-patches@gcc.gnu.org, bkorb@gnu.org Subject: Re: Enum related fixes for gcc build with native cc on vax ultrix Date: Fri, 02 Mar 2001 15:47:00 -0000 Message-id: <200103022346.SAA04198@hiauly1.hia.nrc.ca> References: <20010301175132.A28153@redhat.com> X-SW-Source: 2001-03/msg00126.html > > - result = purge_addressof_1 (&SET_DEST (x), insn, force, 1, ht); > > - result &= purge_addressof_1 (&SET_SRC (x), insn, force, 0, ht); > > - return result; > > + if (purge_addressof_1 (&SET_DEST (x), insn, force, 1, ht) == true > > + && purge_addressof_1 (&SET_SRC (x), insn, force, 0, ht) == true) > > + return true; > > + return false; > > Eh? Perhaps this gets fixed with Zack's boolean cleanup patch. Yes, I believe that this is fixed in the main but not the branch. Zack is not going to patch the branch. If the `Eh' applies to the code, I believe that the code rework is correct to the best of my knowledge given my understanding of the constant representations for the enums true and false (see hash.h) but I could be wrong. > > -typedef enum > > +typedef enum boolean > > Wait for Zack's commit to kill this. Zack's commit didn't kill this and he doesn't want to touch it, so I have copied Bruce Korb. So, this is what remains to be approved to get vax ultrix bootstrapping again with the native compiler: 1) For the 3.0 branch, 2001-02-19 John David Anglin * function.c (purge_addressof_1): Revise to avoid using &= with enum result. --- function.c.orig Fri Feb 16 17:17:29 2001 +++ function.c Wed Feb 28 16:14:35 2001 @@ -2996,9 +2996,10 @@ memory. */ if (code == SET) { - result = purge_addressof_1 (&SET_DEST (x), insn, force, 1, ht); - result &= purge_addressof_1 (&SET_SRC (x), insn, force, 0, ht); - return result; + if (purge_addressof_1 (&SET_DEST (x), insn, force, 1, ht) == true + && purge_addressof_1 (&SET_SRC (x), insn, force, 0, ht) == true) + return true; + return false; } else if (code == ADDRESSOF && GET_CODE (XEXP (x, 0)) == MEM) @@ -3230,9 +3231,10 @@ } else if (code == SET) { - result = purge_addressof_1 (&SET_DEST (x), insn, force, 1, ht); - result &= purge_addressof_1 (&SET_SRC (x), insn, force, 0, ht); - return result; + if (purge_addressof_1 (&SET_DEST (x), insn, force, 1, ht) == true + && purge_addressof_1 (&SET_SRC (x), insn, force, 0, ht) == true) + return true; + return false; } /* Scan all subexpressions. */ @@ -3240,10 +3242,19 @@ for (i = 0; i < GET_RTX_LENGTH (code); i++, fmt++) { if (*fmt == 'e') - result &= purge_addressof_1 (&XEXP (x, i), insn, force, 0, ht); + { + if (result == true + && purge_addressof_1 (&XEXP (x, i), insn, force, 0, ht) == false) + result = false; + } else if (*fmt == 'E') - for (j = 0; j < XVECLEN (x, i); j++) - result &= purge_addressof_1 (&XVECEXP (x, i, j), insn, force, 0, ht); + { + for (j = 0; j < XVECLEN (x, i); j++) + if (result == true + && purge_addressof_1 (&XVECEXP (x, i, j), insn, force, 0, ht) + == false) + result = false; + } } return result; 2) For the main and the branch, 2001-02-19 John David Anglin * fixinc/fixlib.h (bool_t): Add identifier `boolean' in typedef. * fixinc/server.c (read_pipe_timeout): Use enum boolean instead of bool_t in declaration because pcc can't combine volatile with typedef types. --- fixinc/fixlib.h.orig Wed Dec 13 15:07:46 2000 +++ fixinc/fixlib.h Wed Feb 21 17:54:05 2001 @@ -88,7 +88,7 @@ #define IGNORE_ARG(a) ((void)(a)) -typedef enum +typedef enum boolean { BOOL_FALSE, BOOL_TRUE } t_bool; --- fixinc/server.c.orig Wed Feb 21 17:54:28 2001 +++ fixinc/server.c Wed Feb 21 17:55:11 2001 @@ -57,7 +57,7 @@ # define volatile #endif -STATIC volatile t_bool read_pipe_timeout; +STATIC volatile enum boolean read_pipe_timeout; STATIC pid_t server_master_pid = NOPROCESS; tSCC* def_args[] = 3) The trivial fix to cplus-dem.c in libiberty for the main and branch, 2001-02-21 John David Anglin * cplus-dem.c (main): Cast enum style to int. --- cplus-dem.c.orig Sun Feb 18 14:06:37 2001 +++ cplus-dem.c Wed Feb 21 21:38:12 2001 @@ -5148,7 +5148,7 @@ skip_first = i; mbuffer[i] = 0; - flags |= style; + flags |= (int) style; result = cplus_demangle (mbuffer + skip_first, flags); if (result) { Dave -- J. David Anglin dave.anglin@nrc.ca National Research Council of Canada (613) 990-0752 (FAX: 952-6605)