public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "gcc at breakpoint dot cc" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/64294] invalid code, zero check gets optimized away Date: Sat, 13 Dec 2014 21:12:00 -0000 [thread overview] Message-ID: <bug-64294-4-eimneMYxpX@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-64294-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64294 Sebastian Andrzej Siewior <gcc at breakpoint dot cc> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |UNCONFIRMED Resolution|INVALID |--- --- Comment #5 from Sebastian Andrzej Siewior <gcc at breakpoint dot cc> --- I re-open it. This time I attached the whole .i twice: - "macro" contains the second CLI_ISCONTAINED() invocation as a macro - "static" contains the second CLI_ISCONTAINED() as a static function The first one (macro) segfaults, the second one (static) works as a expected. The only obvious change I made in the static version is that the size argument is not signed but unsigned. Changing the type of sb_size to signed int results in the segfault again. I saw this problem with gcc-4.8 and 4.9. gcc 4.7 seems not to miss compile it. Comparing the disassemble between those two .i I see: - macro + static <label>: - 8b 44 24 44 mov 0x44(%esp),%eax - 89 c1 mov %eax,%ecx + 8b 44 24 20 mov 0x20(%esp),%eax + 85 c0 test %eax,%eax + 0f 84 8c fb ff ff je 3f0 <petite_inflate2x_1to9+0x3f0> + 8b 4c 24 58 mov 0x58(%esp),%ecx + 8b 44 24 20 mov 0x20(%esp),%eax For me as a no-compiler guy it looks like the zero check has been removed because for some reason the size argument has to be != 0. I'm not sure if this is related but #26763 fixed a problem with the same macro. Sebastian
next prev parent reply other threads:[~2014-12-13 21:12 UTC|newest] Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top 2014-12-12 22:25 [Bug rtl-optimization/64294] New: " gcc at breakpoint dot cc 2014-12-12 22:43 ` [Bug rtl-optimization/64294] " schwab@linux-m68k.org 2014-12-12 22:54 ` gcc at breakpoint dot cc 2014-12-13 20:58 ` gcc at breakpoint dot cc 2014-12-13 20:59 ` gcc at breakpoint dot cc 2014-12-13 21:12 ` gcc at breakpoint dot cc [this message] 2014-12-20 11:53 ` mikpelinux at gmail dot com 2014-12-20 14:30 ` gcc at breakpoint dot cc 2014-12-20 14:35 ` gcc at breakpoint dot cc 2014-12-20 15:24 ` mikpelinux at gmail dot com 2014-12-20 21:21 ` gcc at breakpoint dot cc
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=bug-64294-4-eimneMYxpX@http.gcc.gnu.org/bugzilla/ \ --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).