This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug rtl-optimization/23585] [4.0 regression] mem_fun* code fine with -O1, bus error with -O2
- From: "mark at codesourcery dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 11 Oct 2005 14:47:43 -0000
- Subject: [Bug rtl-optimization/23585] [4.0 regression] mem_fun* code fine with -O1, bus error with -O2
- References: <bug-23585-11161@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #13 from mark at codesourcery dot com 2005-10-11 14:47 -------
Subject: Re: [4.0 regression] mem_fun* code fine
with -O1, bus error with -O2
ebotcazou at gcc dot gnu dot org wrote:
> ------- Comment #12 from ebotcazou at gcc dot gnu dot org 2005-10-11 14:41 -------
>
>>This certainly is a bug in the back-end, not a bug in the default
>>location of the v-bit. You shouldn't need to break the C++ ABI on SPARC
>>to fix this bug.
>
>
> Right, I was confused, I thought __pfn was dereferenced itself.
>
>
>>However, I'm not sure why you're seeing a 4-byte load from an unaligned
>>address.
>
>
> Because p is a pointer to Class and Class has alignment 1. I guess the first
> branch of the expression works when Class contains a pointer to the vtable,
> hence has alignment 4.
Ah. I think that would best be fixed in the front-end, then. If the
class doesn't have a virtual pointer, then there's no need to generate
the conditional expression; avoiding that will not only fix this bug,
but make the code generated by the front-end easier for the middle end
to process. Please re-assign to me.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23585