Re: Window cycling keybinding problem



Hello,

Here's the problem:

sawfish/src/keys.c:

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.

http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/tree-ssa-alias.c.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&only_with_tag=gcc-4_0-branch&r1=2.71.2.2&r2=2.71.2.3

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]