This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Scheduler moves load in front of store on powerpc-linux, 3.0 and mainline



Franz Sirl <Franz.Sirl-kernel@lauterbach.com> writes:
> the attached testcase breaks KDE2 on powerpc-linux-gnu and I consider it 
> probably the last gcc-3.0 showstopper bug I know of.

KDE2 appears to be broken.  This code:

*((unsigned char **) &p->clients)

refers to p->clients as an 'unsigned char *'.

But this code:

    p->clients = nwindup(windows, count);

refers to p->clients as a 'Window *', which has underlying type
'unsigned long *'.

This is the usual type violation when accessing memory that causes
undefined behaviour under ISO C.  I suppose you could try
-fno-strict-aliasing, but it'd be better to fix the code.

-- 
- Geoffrey Keating <geoffk@geoffk.org>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]