This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/11376] [3.3/3.4 regression] mozilla-1.4 miscompiled
- From: "kevin dot hendricks at sympatico dot ca" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 8 Jul 2003 18:29:51 -0000
- Subject: [Bug c++/11376] [3.3/3.4 regression] mozilla-1.4 miscompiled
- References: <20030630081619.11376.sirl@gcc.gnu.org>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11376
------- Additional Comments From kevin dot hendricks at sympatico dot ca 2003-07-08 18:29 -------
Subject: Re: [3.3/3.4 regression] mozilla-1.4 miscompiled
Hi Franz,
Please try changing inlinedGetFrameAt() in your imgContainerGIF.ii
To look like the following (a rough hack job)
inline nsresult inlinedGetFrameAt(PRUint32 index, gfxIImageFrame
**_retval) {
nsISupports ** rp = (nsISupports**) _retval;
nsISupports *_elem = mFrames.ElementAt(index);
if (!_elem) return ((nsresult) 0x80004005L);
*rp = _elem;
return 0;
}
This casts back the gfxIImageFrame** _retval to what is really is which
is a nsISupports**
I tried this with your test case under gcc 3.3 and get the following:
[kbhend@base1 huh]$ g++ -O2 -fno-exceptions -o junk imgContainerGIF.ii
-L/src1/mozilla-1.3/obj-ppc/dist/bin -lxpcom -lgkgfx
[kbhend@base1 huh]$ ./junk
rv 0
done
[kbhend@base1 huh]$ gcc -dumpversion
3.3
So it fixes the problem (no segfault!)
This is not the right fix. The nsCOMPtr<> template type and the
many of the methods should be passing around nsISupports** instead
of gfxIImageFrame** in many places.
But this supports Mark's claim that the code is not aliasing safe.
Kevin
On Tuesday, July 8, 2003, at 01:50 PM, sirl at gcc dot gnu dot org
wrote:
> PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT*
> gcc-bugs@gcc.gnu.org.
>
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11376
>
>
>
> ------- Additional Comments From sirl at gcc dot gnu dot org
> 2003-07-08 17:50 -------
> Well, since the generated assembly looks now quite different than for
> the full
> testcase, I would just like to hear another opinion whether the full
> testcase
> was correctly minimized. If yes, I agree that this bug shoud be closed
> and one
> against mozilla should be opened.
> Hmm, Kevin, could you create a "fixed" (like you just did for the
> simplified
> one) full testcase (diff?)? If that fixes the full testcase I'll be
> happy :-).
>
>
>
>
>
> ------- You are receiving this mail because: -------
> You are on the CC list for the bug, or are watching someone who is.
>
>
----
Kevin B. Hendricks
Associate Professor of Operations and Information Technology
Richard Ivey School of Business, University of Western Ontario
London Ontario, CANADA N6A 3K7
khendricks@ivey.uwo.ca