From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2136) id EBD28385AC33; Mon, 5 Sep 2022 15:57:39 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EBD28385AC33 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1662393459; bh=4dcwtMHJT3lsb4pz+Fc4OizFHWyzVp0L62oAifS817Q=; h=From:To:Subject:Date:From; b=TRYSJLOay+2LaIGp3Cmmzh2T8wOtnT8H/iBqFyTUe3N6AAY0OV+J6e/71g2s+IvjH HLKuAuh2NWAs+LZIJapX+f+9432tK86mhNcsX4ecXXLhfq5iJ+cHTRl0WmWlNoJgPL DJzhE4ravkHJ4aeXhx8PdQKUf5E0rj0wSzUa/Jqc= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Aldy Hernandez To: gcc-cvs@gcc.gnu.org Subject: [gcc r13-2445] Disable decimal floating point in frange. X-Act-Checkin: gcc X-Git-Author: Aldy Hernandez X-Git-Refname: refs/heads/master X-Git-Oldrev: ba0db24386107ffa237a2af0d1fdef9030460157 X-Git-Newrev: b4d8a56a4c62ba8bca55469ae2b841fb4e1334a4 Message-Id: <20220905155739.EBD28385AC33@sourceware.org> Date: Mon, 5 Sep 2022 15:57:39 +0000 (GMT) List-Id: https://gcc.gnu.org/g:b4d8a56a4c62ba8bca55469ae2b841fb4e1334a4 commit r13-2445-gb4d8a56a4c62ba8bca55469ae2b841fb4e1334a4 Author: Aldy Hernandez Date: Mon Sep 5 15:41:39 2022 +0200 Disable decimal floating point in frange. As Jakub mentioned in the PR, because many numbers have multiple possible representations, we can't reliably return true for singleton_p. For that matter, we may not be capable of modeling them just yet. Disabling them until someone with DFP knowledge can opine or extend frange. PR middle-end/106831 gcc/ChangeLog: * value-range.h (frange::supports_p): Disable decimal floats. * range-op-float.cc (frange_drop_inf): Remove DECIMAL_FLOAT_MODE_P check. (frange_drop_ninf): Same. Diff: --- gcc/range-op-float.cc | 10 ---------- gcc/value-range.h | 5 ++++- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/gcc/range-op-float.cc b/gcc/range-op-float.cc index 7301e5a060b..050f07a9867 100644 --- a/gcc/range-op-float.cc +++ b/gcc/range-op-float.cc @@ -204,11 +204,6 @@ frelop_early_resolve (irange &r, tree type, static inline void frange_drop_inf (frange &r, tree type) { - // FIXME: build_real() bails on decimal float modes when called with - // a max representable endpoint. - if (DECIMAL_FLOAT_MODE_P (TYPE_MODE (type))) - return; - REAL_VALUE_TYPE max; real_max_representable (&max, type); frange tmp (type, r.lower_bound (), max); @@ -221,11 +216,6 @@ frange_drop_inf (frange &r, tree type) static inline void frange_drop_ninf (frange &r, tree type) { - // FIXME: build_real() bails on decimal float modes when called with - // a max representable endpoint. - if (DECIMAL_FLOAT_MODE_P (TYPE_MODE (type))) - return; - REAL_VALUE_TYPE min; real_min_representable (&min, type); frange tmp (type, min, r.upper_bound ()); diff --git a/gcc/value-range.h b/gcc/value-range.h index bc00f3d5b08..645dc76c33a 100644 --- a/gcc/value-range.h +++ b/gcc/value-range.h @@ -338,7 +338,10 @@ public: value_range_kind = VR_RANGE); static bool supports_p (const_tree type) { - return SCALAR_FLOAT_TYPE_P (type); + // ?? Decimal floats can have multiple representations for the + // same number. Supporting them may be as simple as just + // disabling them in singleton_p. No clue. + return SCALAR_FLOAT_TYPE_P (type) && !DECIMAL_FLOAT_TYPE_P (type); } virtual tree type () const override; virtual void set (tree, tree, value_range_kind = VR_RANGE) override;