From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,69f5dc369339839e X-Google-Attributes: gidfee84,public From: Joe Mario Subject: Re: Unaligned access Date: 1998/04/01 Message-ID: <35226ED5.41C6@zk3.dec.com>#1/1 X-Deja-AN: 339949962 Content-Transfer-Encoding: 7bit References: <35203F9D.FCE39FD2@gsc.gte.com> To: "Allen M. Cohen" Content-Type: text/plain; charset=us-ascii Organization: UBPG Mime-Version: 1.0 Newsgroups: comp.unix.osf.osf1 Allen M. Cohen wrote: > > We get many unaligned access errors from a AP when built under > Dec Unix 4.0-D and as: > "cc -non_shared -Wf,_p8 -O -std -Olimit 3000" > When we build with as just "cc -g", there are no unaligned access > errors! Is this a compiler bug? It's very likely a problem in your application. If you post a small snipit of code that shows the problem, we can help you understand what's causing it. When you compile with "cc -g", all optimizations are disabled. These include optimizations that take advantage of the C language rules that guarantee the alignment of various datatypes. That's probably why the unaligned errors go away with "cc -g". > Should I use uac to ignore unaligned access errors? I wouldn't. Unaligned access errors degrade performance. Much has been written about unaligned access errros. It's usually a matter of taking the pc reported by the unaligned access error and looking at the source code at or around that pc to see what's causing it. Below are pointers to two web pages which might be of help. See http://www.partner.digital.com/www-swdev/pages/Home/TECH/techsupport.html Choose "Frequently Asked Questions" then "DIGITAL UNIX" or http://www.partner.digital.com/www-swdev/pages/Home/TECH/faqs/dunix/unalign.html BTW, I see you're compiling with "-Wf,_p8" and "-Olimit 300". Neither switch is recognized by DECC. As of UNIX V4.0, the -Olimit switch is only recognized by -oldc. I've never seen the _p8 switch. They're not doing any harm, nor are they doing any good. Joe Mario