From: rguenth Date: Tue, 4 Nov 2014 20:46:52 +0000 (+0000) Subject: 2014-11-04 Richard Biener X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7fd22aaebc6c2d8c64123ad2f928f1a8945ea65b;p=thirdparty%2Fgcc.git 2014-11-04 Richard Biener * c-common.c (shorten_compare): Do not shorten mixed DFP and non-DFP compares. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@217101 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog index a28ef60b9846..861ba073f358 100644 --- a/gcc/c-family/ChangeLog +++ b/gcc/c-family/ChangeLog @@ -1,3 +1,8 @@ +2014-11-04 Richard Biener + + * c-common.c (shorten_compare): Do not shorten mixed + DFP and non-DFP compares. + 2014-11-01 Edward Smith-Rowland <3dw4rd@verizon.net> * g++.dg/cpp1y/feat-cxx11.C: Commentary and rearrangement of tests. diff --git a/gcc/c-family/c-common.c b/gcc/c-family/c-common.c index 03137febc080..532923cb798b 100644 --- a/gcc/c-family/c-common.c +++ b/gcc/c-family/c-common.c @@ -4313,10 +4313,16 @@ shorten_compare (location_t loc, tree *op0_ptr, tree *op1_ptr, /* If either arg is decimal float and the other is float, find the proper common type to use for comparison. */ + else if (real1 && real2 + && DECIMAL_FLOAT_MODE_P (TYPE_MODE (TREE_TYPE (primop0))) + && DECIMAL_FLOAT_MODE_P (TYPE_MODE (TREE_TYPE (primop1)))) + type = common_type (TREE_TYPE (primop0), TREE_TYPE (primop1)); + + /* If either arg is decimal float and the other is float, fail. */ else if (real1 && real2 && (DECIMAL_FLOAT_MODE_P (TYPE_MODE (TREE_TYPE (primop0))) || DECIMAL_FLOAT_MODE_P (TYPE_MODE (TREE_TYPE (primop1))))) - type = common_type (TREE_TYPE (primop0), TREE_TYPE (primop1)); + return 0; else if (real1 && real2 && (TYPE_PRECISION (TREE_TYPE (primop0))