This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Wconversion: decimal float support (last try)


These two patches add decimal float support to Wconversion. Basically,
they are the same patches that have been in the patch queue since
December 2006. The patch is divided in two parts that have been tested
independently. The first part adds the functionality to detect whether
a decimal<->binary conversion alters a value. The second part adds the
logic for Wconversion and testcases.

There are two versions of the first part: part1-try1 [1] normalises
and compares with bitwise identity; part1-try2 [2] compares equality
in value. Not sure which one is more correct or efficient (if any).

Bootstrapped and regression tested with --enable-languages=all
--enable-decimal-float in i686-pc-linux-gnu.

If no one else is (really) interested in seeing this committed, I am
not going to pursue this any further because I want to focus now on
other things (this year GSoC project for example).


Changelog for wconversion-dfp-part1-try1.diff

2007-05-19   Janis Johnson  <>
                  Manuel Lopez-Ibanez <>

  * dfp.c (decimal_normalize): Define.
  * dfp.h (decimal_normalize): Declare.
  * real.c (normalize): Normalize also dfp values.
  (exact_real_truncate): Handle truncating from dfp to
binary and viceversa.
  (real_isinteger): Add dfp support.

Changelog for wconversion-dfp-part1-try2.diff

2006-11-30 Manuel Lopez-Ibanez <>

 * real.c  (exact_real_truncate): Use REAL_VALUES_EQUAL to compare
decimal floating point values instead of real_identical since dfp
values are not normalised by design.
 (real_isinteger): Likewise.

Changelog for wconversion-dfp-part2.diff

2007-05-20 Manuel Lopez-Ibanez <>

 * c-typeck.c (convert_arguments): Delete code that handles
conversions between decimal and binary float types.
 * c-common.c (conversion_warning): Handle conversions between
decimal and binary float types.

 * gcc.dg/dfp/Wconversion-dfp.c: New.
 * gcc.dg/dfp/Wtraditional-conversion-2.c: Remove.
 * gcc.dg/dfp/wtr-conversion-1.c: Remove.

Attachment: wconversion-dfp-part1-try1.diff
Description: Text document

Attachment: wconversion-dfp-part1-try2.diff
Description: Text document

Attachment: wconversion-dfp-part2.diff
Description: Text document

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]