This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ 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]

Re: [RFA] libstdc++/22203, aka PowerPC vs numeric_limits<integer>::traps


Paolo Carlini <pcarlini@suse.de> writes:

| Hi,
| 
| submitter maintains that PowerPC integer divide does not trap and
| therefore, according to this comment in std_limits.h:
| 
| // GCC only intrinsicly supports modulo integral types.  The only remaining
| // integral exceptional values is division by zero.  Only targets that
| do not
| // signal division by zero in some "hard to ignore" way should use false.
| #ifndef __glibcxx_integral_traps
| # define __glibcxx_integral_traps true
| #endif
| 
| we should define __glibcxx_integral_traps to false for powerpc-*.
| 
| Today I verified the substance of the PR with Ulrich Weigand, and I'd
| like to double check with you all that indeed for libstdc++-v3 it's
| appropriate defining __glibcxx_integral_traps to false. That would
| require a bit of configury, likely a new empty
| config/cpu/generic/cpu_defines.h, included by c++config.h (and therefore
| by std_limits.h), and specialized in config/cpu/powerpc/, not a big
| deal, overall.

If PPC claims integer arithmetic does not trap then we do need
*testcases* to go with the patch.  The snipped provided in the PR does
not test anything.  We do need actual program that tests that the
operations don't trap.  With that modification, the patch is OK.

-- Gaby


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