Re: Window cycling keybinding problem


Here's the problem:


static void
nconc (repv x, repv y)
   repv *ptr = &x;

   while (rep_CONSP (*ptr))
   ptr = rep_CDRLOC (*ptr);

   *ptr = y;

gcc 4.0.1 with -O2 removes the *ptr = y. After asking about this on
their mailing list, the gcc folks explained that gcc 4.0.1 assumes that
ptr points to a local variable, and have created a patch (which will go
into 4.0.2) that fixes this.

Besides -fno-strict-aliasing, two other ways of working around this with
an unpatched gcc 4.0.1 are declaring ptr as volatile repv *, or perhaps,
if rep_CONSP(x) is always true, starting with ptr = rep_CDRLOC(x).

gcc 4.1 snapshots don't have a problem with this code.

Hope this helps.

(PS: I had trouble sending a message earlier. Sorry if multiple messages
show up.)

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]