🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.help
Article #49516

Re: aligned access problem on alpha

#49516
From: Pravin Santiago
Date: Thu, 20 Jan 1994 14:23
67 lines
3356 bytes
In article <dlyCJGFBA.D21@netcom.com>, dly@netcom.com (Dixon Ly) writes:
|> Newsgroups: gnu.gcc.help
|> Path: pa.dec.com!decwrl!netcomsv!netcom.com!dly
|> From: dly@netcom.com (Dixon Ly)
|> Subject: aligned access problem on alpha
|> Message-ID: <dlyCJGFBA.D21@netcom.com>
|> Organization: NETCOM On-line Communication Services (408 241-9760 guest)
|> Date: Tue, 11 Jan 94 02:25:58 EST
|> Lines: 26
|> 
|> Hi,
|> I am not very familiar with the Alpha machine.  We just ported a program
|> from a SUN to the Alpha, and everything compiles fine as far as i could
|> tell, but when we try to run the program, we get a seemingless endless
|> stream of the following message on con:
|> 
|> Unaligned access pid=27008 <pind> va=1404eefac pc=120035f20 ra=120035ce8 type=ldq
|> 
|> pid is th process number, pind is the executable.  the rest i dont know.
|> I put the -Wcast-align flag into the makefile, but didnt get anything
|> from it.  Any help would be appreciated.  And we are running gcc 2.4.0
|> on the Alpha.  The cc compiler (i guess the OSF compiler) also gives
|> the same problem.  so if theres anyone out there who can help me out,
|> it'll be greatly appreciated.
|> 
|> thanks
|> -d
|> <dly@netcom.com>
|> 
|> 
|> 
|> -- 
|> 
|> ---
|> Dixon Ly
|> dly@netcom.com
|> 
|>

This usually happens when you munge pointers and integers. The ldq is mnemonic
for load quadword which is a 8 byte quantity. But the va (virtual address)
used is 1404eefac, which is not on an 8 byte boundary [ its on a 4 byte
boundary].  So my hunch is that you are trying to use an C `int' as a pointer
and are dereferencing that pointer.

On an Alpha AXP OSF1 system:
	size of an int < size of a pointer. The size of a pointer is 64 bits
	while an int is 32 bits.  It is not correct to assume that an integer
	can hold a pointer value.

you can find out the place in your code where you are using a non pointer type
as a pointer by using dbx.

dbx> 0x120035F20 /5i

this will print 5 disassembled machine instructions starting at pc 120035F20.
It will also print out the C file and the line number in the C file where the
culprit is, provided you compiled the modules with debug info, ( i.e. the -g
compile flag) 
--
==============================================================
| Pravin Santiago        | Email: santiago@rock.enet.dec.com |
| SEG/RAX                | Disclaimer:                       |
| Digital Equipment Corp.| "I speak for myself, not Digital" |
| Hudson, MA.            |                                   |
==============================================================
Technical Details
Message-ID: <2hm44k$dbp@usenet.pa.dec.com>
Path: arc1-ca.pugleaf.net!gmd.de!xlink.net!howland.reston.ans.net!europa.eng.gtefsd.com!uunet!decwrl!pa.dec.com!evsrv1.afl.hlo.dec.com!santiago
References: <dlyCJGFBA.D21@netcom.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 11318c,9adad3c9cb0cdc15
X-Google-Attributes: gid11318c,public
X-Google-ArrivalTime: 1994-01-20 12:47:59 PST
Path: arc1-ca.pugleaf.net!gmd.de!xlink.net!howland.reston.ans.net!europa.eng.gtefsd.com!uunet!decwrl!pa.dec.com!evsrv1.afl.hlo.dec.com!santiago
From: santiago@evsrv1.afl.hlo.dec.com (Pravin Santiago)
Newsgroups: gnu.gcc.help
Subject: Re: aligned access problem on alpha
Date: 20 Jan 1994 14:23:16 GMT
Organization: Digital Equipment Corp.
Lines: 67
Distribution: world
Message-ID: <2hm44k$dbp@usenet.pa.dec.com>
References: <dlyCJGFBA.D21@netcom.com>
Reply-To: santiago@evsrv1.afl.hlo.dec.com (Pravin Santiago)
NNTP-Posting-Host: evsrv1.hlo.dec.com