[Bug c/34252] New: DEC32_MIN_EXP, DEC32_MAX_EXP don't match TR 24732

2007-11-27 Thread jeff dot sullivan at intel dot com
I discovered a few differences in the gcc implemenation of the 
macros, as compared with the ISO C Tr24732 paper. It may be more likely that
the gcc implementation is incorrect.

In any case, here's what I see in the decfloat-constants.c test from the gcc
4.3 testsuite:

  if (DEC32_MIN_EXP != -95) abort();
  if (DEC64_MIN_EXP != -383) abort();
  if (DEC128_MIN_EXP != -6143) abort();

  if (DEC32_MAX_EXP != 96) abort();
  if (DEC64_MAX_EXP != 384) abort();
  if (DEC128_MAX_EXP != 6144) abort();

Here's the info from Tr24732:

- minimum exponent

DEC32_MIN_EXP -94
DEC64_MIN_EXP -382
DEC128_MIN_EXP -6142

- maximum exponent

DEC32_MAX_EXP 97
DEC64_MAX_EXP 385
DEC128_MAX_EXP 6145

As you can see, they appear to be off-by-one (gcc is always one less). The
constants are generated by the gcc compiler (at least gcc 4.3.0 20071012, which
I am using), so the decfloat-constants test passes.

Also, gcc sets DEC32_DEN, etc:

  if (DEC32_DEN != 0.01E-95DF) abort();
  if (DEC64_DEN != 0.001E-383DD) abort();
  if (DEC128_DEN != 0.1E-6143DL) abort();

Tr24732 specifies these as DEC32_SUBNORMAL_MIN, etc:

DEC32_SUBNORMAL_MIN 0.01E-95DF
DEC62_SUBNORMAL_MIN 0.001E-383DD
DEC128_SUBNORMAL_MIN
0.1E-6143DL

See http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1241.pdf

It looks like the gcc values came from the  implementation and not
TR 24732.


-- 
   Summary:  DEC32_MIN_EXP, DEC32_MAX_EXP don't match TR 24732
   Product: gcc
   Version: 4.3.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
AssignedTo: unassigned at gcc dot gnu dot org
    ReportedBy: jeff dot sullivan at intel dot com


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



[Bug c++/36642] New: Problem with non matching template args in tr1_impl/hashtable

2008-06-26 Thread jeff dot sullivan at intel dot com
I think there may be two issues here demonstrated in the code below. The
example code is distilled from ./include/c++/4.3.0/tr1_imp/hashtable. GCC
compiles this code without a diagnostic, but both the Intel and Microsoft
compilers diagnose an error with too few template args for __detail::_Map_base'
:

% cl -c t.cpp -nologo
t.cpp
t.cpp(10) : error C2976: '__detail::_Map_base' : too few template arguments
t.cpp(4) : see declaration of '__detail::_Map_base'

% cat t.cpp
namespace __detail
{
  template struct _Map_base { };
}

struct  _Hashtable
{
  template
  friend struct __detail::_Map_base;
};

So, you may want to fix the template in  and/or try to
diagnose this case in the compilation.


-- 
   Summary: Problem with non matching template args in
tr1_impl/hashtable
   Product: gcc
   Version: 4.3.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
    ReportedBy: jeff dot sullivan at intel dot com


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