This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/22447] gcc produces code that generate unaligned exceptions
- From: "falk at debian dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 12 Jul 2005 22:59:10 -0000
- Subject: [Bug target/22447] gcc produces code that generate unaligned exceptions
- References: <20050712212227.22447.tsv@solvo.ru>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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