public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "Steve at Zook dot com" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/13312] New: C++ produces stack frame damaging code for Coldfire Date: Fri, 05 Dec 2003 06:31:00 -0000 [thread overview] Message-ID: <20031205063124.13312.Steve@Zook.com> (raw) Under unclear circumstances, some functions cause code to copy function parameters to local area of stack frame. Parameters are copied at declared size (unsigned short gets 2 bytes). If parameters are modified in function body, emitted code may use a long (4 byte) mode directly to the copied parameter in the local stack frame. I have an example from a fragment of the lwIP TCP/IP source that causes the problem. An unsigned short parameter was copied to -2(% a6) and then later in the function an add.l %d1,-2(%a6) was emitted to perform a ++ operation on the parameter. This blows %a6 when the function returns and crashes the code. This particular instance only occurs when -O2 is used and only on Coldfire targets. On other m68k family processors, an add.w %d1,-2(%a6) is generated instead which works OK. With lower optimization levels, the code loads the value into a register, modifies it, and stores it with a move.w %d1,-2 (%a6). It is possible that this bug relates to bug #8309. I have a file tcpout2.ii (which I can provide) that demonstrates the problem. My host and build system is Cygwin under Win 2000. My command line is: m68k-elf-gcc -m5200 - O2 -S tcpout2.ii -- Summary: C++ produces stack frame damaging code for Coldfire Product: gcc Version: 3.3.2 Status: UNCONFIRMED Severity: normal Priority: P2 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: Steve at Zook dot com CC: gcc-bugs at gcc dot gnu dot org GCC build triplet: i686-pc-cygwin GCC host triplet: i686-pc-cygwin GCC target triplet: m68k-elf http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13312
next reply other threads:[~2003-12-05 6:31 UTC|newest] Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top 2003-12-05 6:31 Steve at Zook dot com [this message] 2003-12-05 6:34 ` [Bug c++/13312] " Steve at Zook dot com 2003-12-05 6:39 ` [Bug target/13312] " pinskia at gcc dot gnu dot org 2004-01-18 17:55 ` [Bug target/13312] [m68k] " dhazeghi at yahoo dot com 2004-01-19 5:05 ` bernie at develer dot com 2004-01-21 17:00 ` dhazeghi at yahoo dot com 2004-01-24 7:08 ` Steve at Zook dot com 2004-01-25 5:01 ` Steve at Zook dot com 2004-01-25 9:59 ` bernie at develer dot com 2004-01-29 3:31 ` dhazeghi at yahoo dot com 2004-01-29 13:38 ` bernie at develer dot com 2004-06-10 8:03 ` bernie at develer 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=20031205063124.13312.Steve@Zook.com \ --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).