This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/43311] missed 'movw' optimization.
- From: "rguenth at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 25 Jan 2012 11:13:40 +0000
- Subject: [Bug target/43311] missed 'movw' optimization.
- Auto-submitted: auto-generated
- References: <bug-43311-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43311
--- Comment #4 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-01-25 11:13:40 UTC ---
(In reply to comment #3)
> Does the following code have undefined behavior?
>
> typedef struct { unsigned char b1, b2; } __attribute__((aligned(8))) S;
> void f( S const* s, unsigned char* b1, unsigned char* b2 )
> {
> *b1 = s->b1;
> *b2 = s->b2;
> }
>
> int main()
> {
> S s = { 1, 2 };
> f(&s, &s.b2, &s.b2);
> return s.b2 != 1;
> }
No, s.b2 should be 1.