public inbox for gcc-prs@sourceware.org help / color / mirror / Atom feed
From: Andreas Jaeger <aj@suse.de> To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org Subject: Re: c/4302: wrong code generated Date: Wed, 12 Sep 2001 11:46:00 -0000 [thread overview] Message-ID: <20010912184601.31758.qmail@sourceware.cygnus.com> (raw) The following reply was made to PR c/4302; it has been noted by GNATS. From: Andreas Jaeger <aj@suse.de> To: Wilco van Hoogstraeten <wilco@trimedia.com> Cc: gcc-gnats@gcc.gnu.org Subject: Re: c/4302: wrong code generated Date: Wed, 12 Sep 2001 20:27:32 +0200 Wilco van Hoogstraeten <wilco@trimedia.com> writes: > Andreas Jaeger wrote: > > wilco@trimedia.com writes: >> > [...] > > > >Description: >> > Wrong code generated: >> > >> > marilyn % cat tmp.i >> > extern int printf( const char* args, ... ); >> > >> > int main( ) >> > { >> > long long X, Y; >> > >> > Y = -3000000000LL > (X = 0); >> >> There's no bug here: X is not initialized at this point. Therefore >> the value of (X=0) is undefined, >> > Excuse me???? The value of (X=0) is defined and is 0. The values of X and Y are undefined, local variables don't have any defined value. > Anyway, if you do not believe in C semantics, you could have tried > to initialise X before rejecting the bug: Please read the standards before you start accusing somebody! > extern int printf( const char* args, ... ); > > % cat tmp.i > int main( ) > { > long long X = 0, Y; > > Y = -3000000000LL > (X = 0); > > printf( "%s (%lld)\n", Y != 0 ? "FAIL" : "OK", Y ); > > return 0; > } > % gcc tmp.i > % a.out > FAIL (1) > % I've reproduced this with GCC 3.0.1 and GCC 3.1 on i686, this is really a bug. Andreas -- Andreas Jaeger SuSE Labs aj@suse.de private aj@arthur.inka.de http://www.suse.de/~aj
next reply other threads:[~2001-09-12 11:46 UTC|newest] Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top 2001-09-12 11:46 Andreas Jaeger [this message] -- strict thread matches above, loose matches on Subject: below -- 2002-02-19 7:39 jakub 2001-09-13 9:26 Andreas Jaeger 2001-09-12 9:06 Wilco van Hoogstraeten 2001-09-11 22:36 Andreas Jaeger 2001-09-11 16:26 wilco
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=20010912184601.31758.qmail@sourceware.cygnus.com \ --to=aj@suse.de \ --cc=gcc-prs@gcc.gnu.org \ --cc=nobody@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).