From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (qmail 19970 invoked from network); 8 Jul 1999 19:06:45 -0000 Received: from mail.redhat.com (199.183.24.239) by lists.redhat.com with SMTP; 8 Jul 1999 19:06:45 -0000 Received: from ellpspace.math.ualberta.ca (michal@ellpspace.math.ualberta.ca [129.128.88.19]) by mail.redhat.com (8.8.7/8.8.7) with ESMTP id LAA15542 for ; Tue, 29 Jun 1999 11:40:36 -0400 Received: (from michal@localhost) by ellpspace.math.ualberta.ca (8.8.8/8.8.8) id JAA15875 for axp-list@redhat.com; Tue, 29 Jun 1999 09:40:33 -0600 From: Michal Jaegermann Message-Id: <199906291540.JAA15875@ellpspace.math.ualberta.ca> Subject: Re: 2.2.11 To: axp-list@redhat.com Date: Tue, 29 Jun 1999 09:40:32 -0600 (MDT) In-Reply-To: <19990629011028.A1023@twiddle.net> from "Richard Henderson" at Jun 29, 99 01:10:28 am Content-Type: text Richard Henderson wrote: > > (2) Give -fno-strict-alias to gcc 2.95. No matter what we do for > 2.3, we won't be going back to fix what needs fixing in 2.2. Is this good enough? Here is a code distilled from a real program (lyx-1.0.3) which was falling flat on this trouble and, curiously enough, in the original C++ source things were not really that obvious. :-) #include #include unsigned char buffer[sizeof(char *) + 2]; int main () { unsigned char *p; int i; p = (unsigned char *)&p; /* cheap initialization */ printf("original = %p\n", p); #if defined(BUG) memcpy (&buffer[1], &p, sizeof(p)); #else { unsigned char *target, *source; target = &buffer[1]; source = (unsigned char *)&p; for (i = 0; i < sizeof(char *) ; i++) { *target++ = *source++; } } #endif for (i = sizeof(char *) + 2; i > 0 ; ) { printf("%02x ", buffer[--i]); } printf("\n"); return(0); } This program compiled on Alpha with egcs egcs-1.1.2 release (egcs-2.91.66 19990314) when BUG constant is not defined **or** when no optimizations are used prints someting like that: original = 0x11ffffb60 00 00 00 00 01 1f ff fb 60 00 If you add -DBUG to compilation flags and use **any** level of optimization above -O0 then this printout will be original = 0x11ffffb60 00 00 00 00 00 00 00 00 60 00 Adding compilation flags like -fno-strict-aliasing or other aliasing related flags does not change anything at all. Looking at an assembler output it appears that this is the case of an overenthusiastic expansion of an inline function - but I am not sure. I think that I will file a formal bug report - unless I will be told that this bug variant is well known, and taken care of, and I simply live under a rock. Oh, and after a small workaround in one place in a source file math_iter.C, LyX-1.0.3 compiled on Alpha with all optimizations seems to be doing just fine. Michal