Path: utzoo!telly!attcan!uunet!tut.cis.ohio-state.edu!SUN.COM!earle From: earle@SUN.COM (Greg Earle) Newsgroups: gnu.gcc.bug Subject: GNU gcc 1.33 patches and X patches to build the Core X R3 with gcc Message-ID: <8902200730.AA14576@poseur.Sun.COM> Date: 20 Feb 89 07:30:08 GMT Sender: daemon@tut.cis.ohio-state.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 176 Try these patches to gcc 1.33; they're from RMS (thus blessed) and they enabled me to build the core X R3 distribution with gcc 1.33 after they were applied. I didn't even need to use `-traditional'. Actually, I should qualify that; fonts/bdftosnf/fontutil.c uses `inline' as a local variable name (Non `-traditional' gcc reserves `inline' as a keyword), and that name needs to be changed; and fonts/bdftosnf/showsnf.c gets a self-induced abort() somewhere (`gcc got fatal signal 6'); a workaround is to move a variable declaration outside of a function. Try the following patches for these 2 files (the patches for gcc are after them, strip them out and put in a separate patch file): Note that these patches only help the Core X distribution. My first foray into the contrib stuff (adding the PEX extension to the server, and building the PEX extension demonstration clients) is meeting considerably more resistance. 2 files cause gcc to self-abort, a couple have code that gcc complains about, and a couple of directories have code that tries to be ANSI-ized (has `#if (__STDC__) && !(__HIGHC__)' and such), but still makes gcc complain anyway. It's a tough battle ... Hope this helps, - Greg Earle Sun Los Angeles - JPL on-site software support poseur!earle@Sun.COM ------------------------------------------------------------------------------ Apply the following patch from your top level X directory, using `patch -c -p0': *** fonts/bdftosnf/fontutil.c.orig Fri Oct 14 10:33:27 1988 --- fonts/bdftosnf/fontutil.c Thu Feb 9 04:57:45 1989 *************** *** 399,412 **** { int x, y; int dx, dy; ! unsigned char *inline, *outline; int inwidth; dx = pCI->metrics.leftSideBearing; dy = ascent - pCI->metrics.ascent; bzero (newglyph, width * (ascent + descent)); ! inline = oldglyphs + pCI->byteOffset; ! outline = newglyph + dy * width; inwidth = GLWIDTHBYTESPADDED (pCI->metrics.characterWidth, glyphPad); for (y = 0; y < pCI->metrics.ascent + pCI->metrics.descent; y++) { for (x = 0; --- 399,412 ---- { int x, y; int dx, dy; ! unsigned char *in_line, *out_line; int inwidth; dx = pCI->metrics.leftSideBearing; dy = ascent - pCI->metrics.ascent; bzero (newglyph, width * (ascent + descent)); ! in_line = oldglyphs + pCI->byteOffset; ! out_line = newglyph + dy * width; inwidth = GLWIDTHBYTESPADDED (pCI->metrics.characterWidth, glyphPad); for (y = 0; y < pCI->metrics.ascent + pCI->metrics.descent; y++) { for (x = 0; *************** *** 413,423 **** x < pCI->metrics.rightSideBearing - pCI->metrics.leftSideBearing; x++) { ! if (ISBITON (x, inline)) ! SETBIT (x + dx, outline); } ! inline += inwidth; ! outline += width; } pCI->metrics.leftSideBearing = 0; pCI->metrics.rightSideBearing = pCI->metrics.characterWidth; --- 413,423 ---- x < pCI->metrics.rightSideBearing - pCI->metrics.leftSideBearing; x++) { ! if (ISBITON (x, in_line)) ! SETBIT (x + dx, out_line); } ! in_line += inwidth; ! out_line += width; } pCI->metrics.leftSideBearing = 0; pCI->metrics.rightSideBearing = pCI->metrics.characterWidth; *** fonts/bdftosnf/showsnf.c.orig Fri Oct 14 10:15:15 1988 --- fonts/bdftosnf/showsnf.c Thu Feb 9 05:23:06 1989 *************** *** 81,86 **** --- 81,90 ---- exit (1); } + #if defined(__GNUC__) || defined(__STDC__) + int total; + #endif + showfont(file, verbose) char *file; int verbose; *************** *** 91,97 **** --- 95,105 ---- FontInfoRec f; int fd, i, strings; int bytesGlUsed; + #if defined(__GNUC__) || defined(__STDC__) + ; + #else int total; + #endif if (stat(file, &st) < 0) { fprintf(stderr, "can't stat %s\n", file); ------------------------------------------------------------------------------ Apply these patches to your gcc 1.33 source directory: *** expmed.c.orig Sat Jan 28 16:48:11 1989 --- expmed.c Mon Feb 6 09:08:57 1989 *************** *** 193,206 **** { if (GET_MODE_BITSIZE (GET_MODE (value)) >= bitsize) { - /* Avoid making subreg of a subreg. */ - if (GET_CODE (value1) == SUBREG) - value1 = copy_to_reg (value1); /* Optimization: Don't bother really extending VALUE if it has all the bits we will actually use. */ ! value1 = gen_rtx (SUBREG, SImode, value1, 0); ! if (GET_CODE (SUBREG_REG (value1)) != REG) value1 = copy_to_reg (value1); } else if (!CONSTANT_P (value)) /* Parse phase is supposed to make VALUE's data type --- 193,205 ---- { if (GET_MODE_BITSIZE (GET_MODE (value)) >= bitsize) { /* Optimization: Don't bother really extending VALUE if it has all the bits we will actually use. */ ! ! /* Avoid making subreg of a subreg. */ ! if (GET_CODE (value1) != REG) value1 = copy_to_reg (value1); + value1 = gen_rtx (SUBREG, SImode, value1, 0); } else if (!CONSTANT_P (value)) /* Parse phase is supposed to make VALUE's data type *** integrate.c.orig Mon Jan 16 13:05:38 1989 --- integrate.c Tue Feb 7 12:48:13 1989 *************** *** 613,618 **** --- 613,620 ---- { int size = int_size_in_bytes (TREE_TYPE (formal)); copy = assign_stack_local (tmode, size); + if (!memory_address_p (DECL_MODE (formal), XEXP (copy, 0))) + copy = change_address (copy, VOIDmode, copy_rtx (XEXP (copy, 0))); store_expr (arg, copy, 0); } else if (! TREE_READONLY (formal) *** output-sparc.c.orig Mon Jan 30 23:50:45 1989 --- output-sparc.c Sat Feb 4 23:30:12 1989 *************** *** 1429,1434 **** --- 1429,1435 ---- int lucky1 = ((unsigned)REGNO (operands[1]) - 8) <= 1; int lucky2 = ((unsigned)REGNO (operands[2]) - 8) <= 1; + CC_STATUS_INIT; /* this forgotten in virgin 1.33. */ if (lucky1) if (lucky2) output_asm_insn ("call .mul,2\n\tnop", operands);