From: Michal Jaegermann <michal@ellpspace.math.ualberta.ca>
To: axp-list@redhat.com
Subject: Re: 2.2.11
Date: Tue, 29 Jun 1999 09:40:32 -0600 (MDT) [thread overview]
Message-ID: <199906291540.JAA15875@ellpspace.math.ualberta.ca> (raw)
In-Reply-To: <19990629011028.A1023@twiddle.net> from "Richard Henderson" at Jun 29, 99 01:10:28 am
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 <stdio.h>
#include <string.h>
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
next prev parent reply other threads:[~1999-07-08 19:06 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <19990628204237.A29511@twiddle.net>
[not found] ` <Pine.LNX.4.10.9906282216350.779-100000@penguin.transmeta.com>
1999-06-29 8:10 ` 2.2.11 Richard Henderson
1999-06-29 11:44 ` 2.2.11 Jeff Garzik
1999-06-29 12:10 ` 2.2.11 Quant-X Alpha Linux Support
1999-06-29 16:29 ` 2.2.11 Richard Henderson
[not found] ` <Pine.LNX.4.10.9906290916140.1940-100000@penguin.transmeta.com>
1999-06-29 18:23 ` 2.2.11 Quant-X Alpha Linux Support
1999-06-29 15:40 ` Michal Jaegermann [this message]
1999-06-29 16:42 ` 2.2.11 Richard Henderson
1999-06-29 18:48 ` 2.2.11 Michal Jaegermann
1999-06-29 12:48 2.2.11 Paul Jakma
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox