public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/31023] New: Fold is agnostic of integer sub-types
@ 2007-03-02 9:53 rguenth at gcc dot gnu dot org
2007-09-12 16:05 ` [Bug middle-end/31023] " ebotcazou at gcc dot gnu dot org
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2007-03-02 9:53 UTC (permalink / raw)
To: gcc-bugs
Transformations in fold do not properly handle integer types with value ranges
(defined by TYPE_MIN_VALUE and TYPE_MAX_VALUE) that do not correspond to the
types precision.
Citing from PR30911 comment #40
"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."
another source of problems is fold_convert and its siblings that happily
create out-of-bounds constants or strip conversions to the base type.
--
Summary: Fold is agnostic of integer sub-types
Product: gcc
Version: 4.3.0
Status: UNCONFIRMED
Keywords: wrong-code
Severity: normal
Priority: P3
Component: middle-end
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: rguenth at gcc dot gnu dot org
OtherBugsDependingO 30911
nThis:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31023
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug middle-end/31023] Fold is agnostic of integer sub-types
2007-03-02 9:53 [Bug middle-end/31023] New: Fold is agnostic of integer sub-types rguenth at gcc dot gnu dot org
@ 2007-09-12 16:05 ` ebotcazou at gcc dot gnu dot org
2008-03-30 14:57 ` rguenth at gcc dot gnu dot org
2009-11-10 8:35 ` ebotcazou at gcc dot gnu dot org
2 siblings, 0 replies; 4+ messages in thread
From: ebotcazou at gcc dot gnu dot org @ 2007-09-12 16:05 UTC (permalink / raw)
To: gcc-bugs
--
ebotcazou at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |ebotcazou at gcc dot gnu dot
| |org
Status|UNCONFIRMED |NEW
Ever Confirmed|0 |1
Last reconfirmed|0000-00-00 00:00:00 |2007-09-12 16:05:25
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31023
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug middle-end/31023] Fold is agnostic of integer sub-types
2007-03-02 9:53 [Bug middle-end/31023] New: Fold is agnostic of integer sub-types rguenth at gcc dot gnu dot org
2007-09-12 16:05 ` [Bug middle-end/31023] " ebotcazou at gcc dot gnu dot org
@ 2008-03-30 14:57 ` rguenth at gcc dot gnu dot org
2009-11-10 8:35 ` ebotcazou at gcc dot gnu dot org
2 siblings, 0 replies; 4+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2008-03-30 14:57 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from rguenth at gcc dot gnu dot org 2008-03-30 14:57 -------
Subject: Bug 31023
Author: rguenth
Date: Sun Mar 30 14:56:28 2008
New Revision: 133731
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=133731
Log:
2008-03-30 Richard Guenther <rguenther@suse.de>
PR middle-end/31023
* fold-const.c (fold_sign_changed_comparison): Do leave
conversions to base-types alone.
Modified:
trunk/gcc/ChangeLog
trunk/gcc/fold-const.c
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31023
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug middle-end/31023] Fold is agnostic of integer sub-types
2007-03-02 9:53 [Bug middle-end/31023] New: Fold is agnostic of integer sub-types rguenth at gcc dot gnu dot org
2007-09-12 16:05 ` [Bug middle-end/31023] " ebotcazou at gcc dot gnu dot org
2008-03-30 14:57 ` rguenth at gcc dot gnu dot org
@ 2009-11-10 8:35 ` ebotcazou at gcc dot gnu dot org
2 siblings, 0 replies; 4+ messages in thread
From: ebotcazou at gcc dot gnu dot org @ 2009-11-10 8:35 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from ebotcazou at gcc dot gnu dot org 2009-11-10 08:34 -------
These sub-types are gone in 4.5.
--
ebotcazou at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |WONTFIX
Target Milestone|--- |4.5.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31023
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2009-11-10 8:35 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-03-02 9:53 [Bug middle-end/31023] New: Fold is agnostic of integer sub-types rguenth at gcc dot gnu dot org
2007-09-12 16:05 ` [Bug middle-end/31023] " ebotcazou at gcc dot gnu dot org
2008-03-30 14:57 ` rguenth at gcc dot gnu dot org
2009-11-10 8:35 ` ebotcazou at gcc dot gnu dot org
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).