octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #65321] C++20 warnings about deprecated uses o


From: Rik
Subject: [Octave-bug-tracker] [bug #65321] C++20 warnings about deprecated uses of volatile variables
Date: Sat, 17 Feb 2024 21:49:26 -0500 (EST)

Follow-up Comment #8, bug#65321 (group octave):

In configure.ac there is option


### Enable float truncation to work around issues with x87 co-processors

dnl When compiling math for x87, problems may arise in some code comparing
dnl floating-point intermediate results.  The root cause is the extra
precision
dnl (~80 bits) of x87 co-processor registers versus the IEEE standard 64
bits.
dnl Generally, storing the result in a local volatile variable forces a
dnl truncation back to 64 bits, but it also degrades performance.
dnl However, this performance degradation is very minimal, if indeed
measurable.
dnl Therefore, it has been enabled for all platforms and compilers.
dnl Reported bugs indicate that --enable-float-truncate is required for MinGW
dnl and Cygwin platforms and for GCC compilers >= 5.0.  It should not be
dnl necessary for non-x87 targets or when using modern SSE math.
ENABLE_FLOAT_TRUNCATE=yes
-verxbatim-

This option is used in oct-conf-post-public.in.h as

+verbatim+
#if defined (OCTAVE_ENABLE_FLOAT_TRUNCATE)
#  define OCTAVE_FLOAT_TRUNCATE volatile
#else
#  define OCTAVE_FLOAT_TRUNCATE
#endif


This introduces a few more instances which are using keyword volatile that you
might not have caught with a direct 'hg grep volatile'.  The list is


hg grep -n OCTAVE_FLOAT_TRUNCATE
liboctave/util/oct-cmplx.cc:49:     OCTAVE_FLOAT_TRUNCATE const T ax =
std::abs (a);                        \
liboctave/util/oct-cmplx.cc:50:     OCTAVE_FLOAT_TRUNCATE const T bx =
std::abs (b);                        \
liboctave/util/oct-cmplx.cc:53:         OCTAVE_FLOAT_TRUNCATE const T ay =
std::arg (a);                    \
liboctave/util/oct-cmplx.cc:54:         OCTAVE_FLOAT_TRUNCATE const T by =
std::arg (b);                    \
liboctave/util/oct-cmplx.cc:72:     OCTAVE_FLOAT_TRUNCATE const T ax =
std::abs (a);                        \
liboctave/util/oct-cmplx.cc:73:     OCTAVE_FLOAT_TRUNCATE const T bx =
std::abs (b);                        \
liboctave/util/oct-cmplx.cc:76:         OCTAVE_FLOAT_TRUNCATE const T ay =
std::arg (a);                    \
liboctave/util/oct-cmplx.cc:87:     OCTAVE_FLOAT_TRUNCATE const T ax =
std::abs (a);                        \
liboctave/util/oct-cmplx.cc:88:     OCTAVE_FLOAT_TRUNCATE const T bx =
std::abs (b);                        \
liboctave/util/oct-cmplx.cc:91:         OCTAVE_FLOAT_TRUNCATE const T by =
std::arg (b);                    \
liboctave/util/oct-cmplx.cc:119:       OCTAVE_FLOAT_TRUNCATE const float ax =
std::abs (a);                  \
liboctave/util/oct-cmplx.cc:120:       OCTAVE_FLOAT_TRUNCATE const float bx =
std::abs (b);                  \
liboctave/util/oct-cmplx.cc:123:           OCTAVE_FLOAT_TRUNCATE const float
ay = std::arg (a);              \
liboctave/util/oct-cmplx.cc:124:           OCTAVE_FLOAT_TRUNCATE const float
by = std::arg (b);              \
liboctave/util/oct-cmplx.cc:142:       OCTAVE_FLOAT_TRUNCATE const float ax =
std::abs (a);                  \
liboctave/util/oct-cmplx.cc:143:       OCTAVE_FLOAT_TRUNCATE const float bx =
std::abs (b);                  \
liboctave/util/oct-cmplx.cc:146:           OCTAVE_FLOAT_TRUNCATE const float
ay = std::arg (a);              \
liboctave/util/oct-cmplx.cc:157:       OCTAVE_FLOAT_TRUNCATE const float ax =
std::abs (a);                  \
liboctave/util/oct-cmplx.cc:158:       OCTAVE_FLOAT_TRUNCATE const float bx =
std::abs (b);                  \
liboctave/util/oct-cmplx.cc:161:           OCTAVE_FLOAT_TRUNCATE const float
by = std::arg (b);              \




    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?65321>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]