public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "vegard at peltkore dot net" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug target/34161] -Os produces 32-bit load from 16-bit variable Date: Wed, 21 Nov 2007 11:05:00 -0000 [thread overview] Message-ID: <20071121110522.1095.qmail@sourceware.org> (raw) In-Reply-To: <bug-34161-14028@http.gcc.gnu.org/bugzilla/> ------- Comment #2 from vegard at peltkore dot net 2007-11-21 11:05 ------- It can trigger watchpoints on other members. Try this example: struct s { int dummy; short x; short y; }; void dummy(struct s *b) { } void f(struct s *a, struct s *b) { dummy(b); if (a) b->x = a->x; } static struct s x; static struct s y; int main() { f(&x, &y); return 0; } That code never touches the y member of struct s. Yet when we run this in GDB, we get this: (gdb) rwatch x.y Hardware read watchpoint 1: x.y (gdb) run Starting program: .../a.out Hardware read watchpoint 1: x.y Value = 0 0x080483c2 in main () at movzwl.c:17 17 b->x = a->x; And this doesn't really make that much sense unless you know what's going on. I'd say that following the principle of least surprise, this optimization is unfortunate at the very least. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34161
next prev parent reply other threads:[~2007-11-21 11:05 UTC|newest] Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top 2007-11-20 12:57 [Bug c/34161] New: " vegard at peltkore dot net 2007-11-20 15:41 ` [Bug c/34161] " rguenth at gcc dot gnu dot org 2007-11-21 11:05 ` vegard at peltkore dot net [this message] 2007-11-21 13:06 ` [Bug target/34161] " manu at gcc dot gnu dot org 2008-02-05 9:24 ` vegard dot nossum at gmail dot com
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20071121110522.1095.qmail@sourceware.org \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).