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]
Other format: [Raw text]

[Bug target/22447] gcc produces code that generate unaligned exceptions


------- Additional Comments From falk at debian dot org  2005-07-12 22:59 -------
(In reply to comment #4)

> Unfortunatelly, with switching to gcc 4.x some code started to
> produce such exceptions (with gcc 3.4 everything was fine). Is there
> an option to make gcc think that passed *variable is char * and
> can't be null pointer?

No, sorry. -fno-strict-aliasing doesn't cover this.

> Why the simpe test case (that contains the same function and a
> function that calls it) produces the correct code (I could attach it
> if you have time to take a look at it).

Well, for this:

void f(long *p) {
    *(char *) p = 0;
}

I get

        ldl     t0,0(a0)
        andnot  t0,0xff,t0
        stl     t0,0(a0)

which will fail with unaligned *p, with all gccs I have till back to
2.95. So this doesn't seem to be anything recent...


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22447


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