🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.bug
Article #561

Can't bootstrap 1.35.96 or .97 on Pyramid

#561
From: jonathan
Date: Thu, 31 Aug 1989 22:36
119 lines
2479 bytes
Summary:
	Beta-test gcc does not adhere to alignment constraints
	on Pyramids.

Version:
	gcc 1.35.96, gcc 1.35.97

Hardware:
	Pyramid 90x family.

Description:
	The following program (abstracted from genflags.c) will
	dump core with a signal 4 (bus error) when compiled with -O.
	The other seven gen*.cprograms exhibit the same problem.
	Therefore, gcc no longer bootstraps on Pyramids.

#include <stdio.h>

main ()
{
  exit (ferror (stdout) != 0 ? 5 : 7);
}


Assembler output from 1.35.97 with -O:
gcc_compiled.:
.text
	.align 2
.globl _main
_main:
	adsf $0
	movw $0,pr1
	movw __iob+34,pr0
	andw $32,pr0
	cvthw pr0,pr0
	beq L4
	movw $1,pr1
L4:
	mtstw pr1,pr1
	beq L2
	movw $5,pr0
	jump L3
L2:
	movw $7,pr0
L3:
	movw pr0,tr0
	call _exit
	retd $0x0

Assembler output from 1.35.97 without -O:
gcc_compiled.:
.text
	.align 2
.globl _main
_main:
	adsf $0
	movw $0,pr0
	cvthw __iob+36,pr1
	andw $32,pr1
	cvthw pr1,pr1
	movw $0,pr2
	cmpw pr2,pr1
	beq L4
	movw $1,pr0
L4:
	mtstw pr0,pr0
	beq L2
	movw $5,pr0
	jump L3
L2:
	movw $7,pr0
L3:
	movw pr0,tr0
	call _exit
L1:
	retd $0x0

Assembler output from 1.35 release (built with a slightly buggier md) with -O:
#NO_APP
gcc_compiled.:
.text
	.align 2
.globl _main
_main:
	adsf $0
	movw $0,pr1
	cvthw __iob+36,pr0
	andw $32,pr0
	mtstw pr0,pr0
	beq L4
	movw $1,pr1
L4:
	mtstw pr1,pr1
	beq L2
	movw $5,pr0
	jump L3
L2:
	movw $7,pr0
L3:
	movw pr0,tr0
	call _exit
	retd $0x0


Wild guesses as to what's wrong:

	Compiling without -O produces correct results.

	Examination of a core file with gdb reveals that __iob+34
	is aligned on a 16-bit boundary, but not a 32-bit boundary.
	Pyramids require 32-bit operands to be aligned on a 32-bit boundary.
	GCC is not doing so, even though the machine description defines
	STRICT_ALIGNMENT.

	I haven't gone through all the compiler dump files to determine
	which pass is causing this problem.

	I can't see anything in gcc.texinfo where handling of alignment
	has changed; has it?
Technical Details
Message-ID: <8909010338.AA20926@comp.vuw.ac.nz>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!usc!ucsd!tut.cis.ohio-state.edu!comp.vuw.ac.nz!jonathan

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!usc!ucsd!tut.cis.ohio-state.edu!comp.vuw.ac.nz!jonathan
From: jonathan@comp.vuw.ac.nz
Newsgroups: gnu.gcc.bug
Subject: Can't bootstrap 1.35.96 or .97 on Pyramid
Message-ID: <8909010338.AA20926@comp.vuw.ac.nz>
Date: 31 Aug 89 22:36:33 GMT
Sender: daemon@tut.cis.ohio-state.edu
Distribution: gnu
Organization: GNUs Not Usenet
Lines: 119