public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
To: Joseph Myers <joseph@codesourcery.com>
Cc: <gcc-patches@gcc.gnu.org>, Jonathan Wakely <jwakely@redhat.com>
Subject: Re: Prevent all uses of DFP when unsupported (PR c/91985)
Date: Mon, 25 Nov 2019 20:36:00 -0000	[thread overview]
Message-ID: <yddk17nhf0l.fsf@CeBiTec.Uni-Bielefeld.DE> (raw)
In-Reply-To: <alpine.DEB.2.21.1911221638140.18133@digraph.polyomino.org.uk>	(Joseph Myers's message of "Fri, 22 Nov 2019 16:40:01 +0000")

Hi Joseph,

> Code that directly uses _Decimal* types on architectures not
> supporting DFP is properly diagnosed ("error: decimal floating-point
> not supported for this target"), via a call to
> targetm.decimal_float_supported_p, if the _Decimal32, _Decimal64 or
> _Decimal128 keywords are used to access it.  Use via mode attributes
> is also diagnosed ("unable to emulate 'SD'"); so is use of the
> FLOAT_CONST_DECIMAL64 pragma.  However, it is possible to access those
> types via typeof applied to constants or built-in functions without
> such an error.  I expect that there are ways to get an ICE from this;
> certainly it uses a completely undefined ABI.
>
> This patch arranges for the types not to exist in the compiler at all
> when DFP is not supported.  As is done with unsupported _FloatN /
> _FloatNx types, the global tree nodes are left as NULL_TREE, and the
> built-in function machinery is made to use error_mark_node for them in
> that case in builtin-types.def, so that the built-in functions are
> unavailable.  Code handling constants is adjusted to give an error,
> and other code that might not work with the global tree nodes being
> NULL_TREE is also updated.
>
> Bootstrapped with no regressions for x86_64-pc-linux-gnu.  Also tested
> with no regressions for cross to aarch64-linux-gnu, as a configuration
> without DFP support.  OK to commit (the changes that aren't C front-end 
> changes)?

AFAICS this caused

+FAIL: libstdc++-abi/abi_check

on Solaris.  In libstdc++.log I find

# of added symbols:              0
# of missing symbols:            9
# of undesignated symbols:       0
# of incompatible symbols:       9

9 missing symbols
0
_ZTIDf
typeinfo for decimal32
version status: unversioned
type: object
type size: 8
status: subtracted
[...]

and a few more, all DFP related.  They used to be emitted by g++ for
__fundamental_type_info in libsupc++/fundamental_type_info.cc and lived
in the CXXABI_1.3.4 version.  However, since Solaris *does* lack DFP
support, that's no longer the case.  I'm uncertain how best to deal with
this, however.

	Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University

  parent reply	other threads:[~2019-11-25 20:34 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-22 16:47 Joseph Myers
2019-11-23 16:56 ` Jeff Law
2019-11-25 20:36 ` Rainer Orth [this message]
2019-11-26  1:05   ` Joseph Myers
2019-11-26 12:21     ` Jonathan Wakely
2019-11-27 12:18       ` Rainer Orth
2019-11-27 17:49         ` Joseph Myers
2019-11-27 18:01           ` Jakub Jelinek
2020-01-16 14:49             ` Szabolcs Nagy
2020-01-16 14:50               ` Jakub Jelinek
2019-11-26 14:02   ` Andreas Schwab
2019-11-27 21:55 ` Thomas Schwinge
2019-11-27 22:39   ` Joseph Myers
2019-11-28 14:22     ` Thomas Schwinge
2019-11-28 14:44       ` [PATCH] Fix decimal floating-point LTO streaming for offloading compilation Julian Brown
2019-11-28 15:15         ` Joseph Myers
2019-11-28 15:45           ` Segher Boessenkool
2019-11-28 18:25           ` Julian Brown
2019-11-28 19:22             ` Joseph Myers
2019-11-28 19:45           ` Richard Biener
2019-11-28 15:23         ` Thomas Schwinge

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=yddk17nhf0l.fsf@CeBiTec.Uni-Bielefeld.DE \
    --to=ro@cebitec.uni-bielefeld.de \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=joseph@codesourcery.com \
    --cc=jwakely@redhat.com \
    /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).