public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "rakdver at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/25985] [4.2 Regression] with optimization integer math fails
Date: Thu, 16 Mar 2006 03:15:00 -0000	[thread overview]
Message-ID: <20060316031539.2203.qmail@sourceware.org> (raw)
In-Reply-To: <bug-25985-9034@http.gcc.gnu.org/bugzilla/>



------- Comment #6 from rakdver at gcc dot gnu dot org  2006-03-16 03:15 -------
Actually, my previous comment is wrong, it is ivcanon (more precisely, # of
iterations analysis).  Consider this testcase:

#include <stdio.h>

void bla(int x)
{
  if (x < -100)
   exit (0);
}

int main(void)
{
  int bits = 25;
  while (bits) {
      printf ("%d\n", bits);
      bla(bits);
      bits -= 8;
  }
  return 0;
}

We note that bits is signed, therefore it cannot overflow, and conclude the
loop must be finite.  Using this assumption, we conclude it iterates two times.
However, this would only be correct if the loop were exited through this
particular exit, as these examples demonstrate.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25985


  parent reply	other threads:[~2006-03-16  3:15 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-01-26 23:13 [Bug c/25985] New: " jurka at ejurka dot com
2006-01-26 23:28 ` [Bug middle-end/25985] [4.2 Regression] " pinskia at gcc dot gnu dot org
2006-02-20 17:50 ` [Bug tree-optimization/25985] " pinskia at gcc dot gnu dot org
2006-03-15 18:27 ` pinskia at gcc dot gnu dot org
2006-03-15 18:40 ` pinskia at gcc dot gnu dot org
2006-03-15 20:15 ` rguenth at gcc dot gnu dot org
2006-03-15 20:22 ` rakdver at gcc dot gnu dot org
2006-03-16  2:49 ` rakdver at gcc dot gnu dot org
2006-03-16  3:15 ` rakdver at gcc dot gnu dot org [this message]
2006-03-16 14:29 ` rakdver at gcc dot gnu dot org
2006-03-29  1:41 ` rakdver at gcc dot gnu dot org
2006-04-11 23:13 ` pinskia at gcc dot gnu dot org
2006-05-04  6:40 ` jakub at gcc dot gnu dot org

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=20060316031539.2203.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: link
Be 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).