dfp.c uses the sig field to store encoded value and only uses access
routines in libdecnumber to manipulate it so that dfp.c can be encoding
neutral. But there are

659         decimal128 *d128;
660         *r = *op0;
661         d128 = (decimal128 *) r->sig;
662         /* Flip high bit.  */
663         d128->bytes[0] ^= 1 << 7;
664         /* Keep sign field in sync.  */
665         r->sign ^= 1;

671         decimal128 *d128;
672         *r = *op0;
673         d128 = (decimal128 *) r->sig;
674         /* Clear high bit.  */
675         d128->bytes[0] &= 0x7f;
676         /* Keep sign field in sync.  */
677         r->sign = 0;

714   if (sign)
715     r->sig[0] |= 0x80000000;

They won't work with BID encoding.


-- 
           Summary: dfp.c assumes DPD encoding
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: critical
          Priority: P3
         Component: other
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: hjl at lucon dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30530

Reply via email to