public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "baldrick at free dot fr" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/30911] VRP fails to eliminate range checks in Ada code Date: Thu, 01 Mar 2007 23:07:00 -0000 [thread overview] Message-ID: <20070301230707.16123.qmail@sourceware.org> (raw) In-Reply-To: <bug-30911-13647@http.gcc.gnu.org/bugzilla/> ------- Comment #40 from baldrick at free dot fr 2007-03-01 23:07 ------- Subject: Re: VRP fails to eliminate range checks in Ada code The problem is in this transformation: /* Fold (X & C) op (Y & C) as (X ^ Y) & C op 0", and symmetries. */ X^Y may not be in the range of the type. In this case C=7 and op=NE_EXPR. The type of X and Y has range 4..5. Thus X^Y is either 0 or 2 (neither of which is in the range 4..5). Since the type of X^Y has range 4..5, the new fold code deduces that X^Y NE 0 is always true. I think the thing to do, as Richard Kenner suggested, is to convert each type to its base type right at the start of fold_comparison, at least if it has a base type (the same goes for other routines in fold). This unfortunately neutralizes your patch, since as it is right now you will only ever see base types. Thus this kind of check needs to happen at the start of fold_comparison, before the conversion to the base type. Ciao, Duncan. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30911
next prev parent reply other threads:[~2007-03-01 23:07 UTC|newest] Thread overview: 79+ messages / expand[flat|nested] mbox.gz Atom feed top 2007-02-21 13:57 [Bug tree-optimization/30911] New: " baldrick at gcc dot gnu dot org 2007-02-21 15:18 ` [Bug tree-optimization/30911] " baldrick at gcc dot gnu dot org 2007-02-21 17:55 ` steven at gcc dot gnu dot org 2007-02-21 18:01 ` ebotcazou at gcc dot gnu dot org 2007-02-22 17:04 ` rguenth at gcc dot gnu dot org 2007-02-22 17:33 ` ebotcazou at gcc dot gnu dot org 2007-02-22 17:41 ` baldrick at gcc dot gnu dot org 2007-02-22 18:01 ` ebotcazou at gcc dot gnu dot org 2007-02-22 18:14 ` baldrick at gcc dot gnu dot org 2007-02-22 18:18 ` baldrick at gcc dot gnu dot org 2007-02-22 18:19 ` ebotcazou at gcc dot gnu dot org 2007-02-22 22:54 ` baldrick at gcc dot gnu dot org 2007-02-23 5:50 ` ebotcazou at gcc dot gnu dot org 2007-02-23 9:22 ` rguenth at gcc dot gnu dot org 2007-02-23 9:39 ` baldrick at free dot fr 2007-02-23 10:03 ` baldrick at free dot fr 2007-02-23 11:37 ` rguenth at gcc dot gnu dot org 2007-02-23 11:42 ` rguenth at gcc dot gnu dot org 2007-02-23 12:36 ` baldrick at free dot fr 2007-02-23 12:41 ` rguenth at gcc dot gnu dot org 2007-02-23 13:05 ` baldrick at free dot fr 2007-02-23 14:05 ` rguenth at gcc dot gnu dot org 2007-02-23 15:15 ` rguenth at gcc dot gnu dot org 2007-02-23 15:40 ` baldrick at free dot fr 2007-02-23 15:55 ` rguenth at gcc dot gnu dot org 2007-02-23 15:59 ` baldrick at free dot fr 2007-02-23 16:01 ` baldrick at free dot fr 2007-02-23 16:05 ` charlet at gcc dot gnu dot org 2007-02-23 16:11 ` rguenth at gcc dot gnu dot org 2007-02-23 17:09 ` baldrick at free dot fr 2007-02-23 17:33 ` rguenth at gcc dot gnu dot org 2007-02-23 20:18 ` rguenth at gcc dot gnu dot org 2007-02-23 22:40 ` rguenth at gcc dot gnu dot org 2007-02-24 10:12 ` Arnaud Charlet 2007-02-24 12:32 ` Arnaud Charlet 2007-02-24 10:12 ` charlet at adacore dot com 2007-02-24 12:32 ` charlet at adacore dot com 2007-02-24 12:38 ` rguenth at gcc dot gnu dot org 2007-02-24 12:47 ` Arnaud Charlet 2007-02-24 12:48 ` charlet at adacore dot com 2007-02-28 23:30 ` baldrick at free dot fr 2007-03-01 8:18 ` baldrick at free dot fr 2007-03-01 9:50 ` rguenth at gcc dot gnu dot org 2007-03-01 23:07 ` baldrick at free dot fr [this message] 2007-03-02 9:02 ` rguenth at gcc dot gnu dot org 2007-03-02 9:16 ` baldrick at free dot fr 2007-03-02 9:53 ` rguenth at gcc dot gnu dot org 2008-03-28 12:21 ` rguenth at gcc dot gnu dot org 2008-03-28 14:59 ` baldrick at gcc dot gnu dot org 2008-03-28 19:19 ` rguenth at gcc dot gnu dot org 2008-03-28 22:13 ` rguenth at gcc dot gnu dot org 2008-03-28 22:15 ` rguenth at gcc dot gnu dot org 2008-03-28 22:36 ` rguenth at gcc dot gnu dot org 2008-03-28 22:43 ` baldrick at free dot fr 2008-03-28 22:49 ` baldrick at free dot fr 2008-03-28 22:59 ` rguenth at gcc dot gnu dot org 2008-03-30 9:15 ` ebotcazou at gcc dot gnu dot org 2008-03-30 14:15 ` baldrick at gcc dot gnu dot org 2008-03-30 14:19 ` baldrick at gcc dot gnu dot org 2008-03-30 14:27 ` baldrick at free dot fr 2008-03-30 14:53 ` rguenther at suse dot de 2008-03-30 14:56 ` rguenth at gcc dot gnu dot org 2008-03-30 15:03 ` ebotcazou at gcc dot gnu dot org 2008-03-30 15:09 ` rguenth at gcc dot gnu dot org 2008-03-30 15:17 ` baldrick at free dot fr 2008-03-30 15:46 ` ebotcazou at gcc dot gnu dot org 2008-03-30 15:56 ` rguenther at suse dot de 2008-03-30 16:03 ` baldrick at free dot fr 2008-03-30 16:16 ` ebotcazou at gcc dot gnu dot org 2008-03-30 16:19 ` ebotcazou at gcc dot gnu dot org 2008-03-30 17:04 ` baldrick at free dot fr 2008-04-03 19:53 ` rguenth at gcc dot gnu dot org 2009-11-17 11:04 ` baldrick at free dot fr 2009-11-17 11:19 ` ebotcazou at gcc dot gnu dot org 2009-11-17 15:08 ` rguenther at suse dot de 2009-11-17 15:50 ` Arnaud Charlet 2009-11-17 15:50 ` charlet at adacore dot com 2009-11-17 16:57 ` baldrick at free dot fr 2009-11-17 17:03 ` charlet 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=20070301230707.16123.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).