[SERVER-24374] Decimal128 constructors taking integers should be constexpr Created: 02/Jun/16  Updated: 09/Jul/19  Resolved: 28/Jun/19

Status: Closed
Project: Core Server
Component/s: Internal Code
Affects Version/s: None
Fix Version/s: 4.3.1

Type: Improvement Priority: Major - P3
Reporter: Mathias Stearn Assignee: Billy Donahue
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Problem/Incident
Related
related to SERVER-41425 support for Decimal128 literals Closed
is related to SERVER-41835 symbol clashes: libgcc vs vendored In... Backlog
Backwards Compatibility: Fully Compatible
Sprint: Dev Tools 2019-06-03, Dev Tools 2019-06-17, Dev Tools 2019-07-01
Participants:
Linked BF Score: 28

 Description   

This would allow Decimal128(10) to be a true compile-time constant.



 Comments   
Comment by Githook User [ 27/Jun/19 ]

Author:

{'name': 'Billy Donahue', 'email': 'billy.donahue@mongodb.com', 'username': 'BillyDonahue'}

Message: SERVER-24374 Make Decimal128 integer ctors constexpr

Comment by Billy Donahue [ 24/Jun/19 ]

https://mongodbcr.appspot.com/443220008/

Comment by Billy Donahue [ 24/Jun/19 ]

Dynamic link complications written up in SERVER-41835.

Comment by Andrew Morrow (Inactive) [ 18/Jun/19 ]

billy.donahue - Would you mind writing a new ticket describing these findings so that we can undertake a fix?

Comment by Billy Donahue [ 17/Jun/19 ]

Ran into a not-quite-diagnosed issue with the LIBDEPS_PRIVATE change in the original attempt at this ticket,
https://github.com/mongodb/mongo/commit/668100df79

It means that the system's libgcc, which provides its own intelfp names, can seep into dynamic builds of the decimal128_test.

We're doing something wrong,

Here's a grep for _bid128_to_int32_rnint, among the 'nm' output for each dependency in the 'ldd' output from decimal128_test,
when built with dynamic gcc.

build/dynamic_gcc/mongo/unittest/libunittest_main.so:                      T __bid128_to_int32_rnint
build/dynamic_gcc/mongo/db/libserver_options_core.so:                      T __bid128_to_int32_rnint
build/dynamic_gcc/third_party/IntelRDFPMathLib20U1/libintel_decimal128.so: T __bid128_to_int32_rnint
build/dynamic_gcc/mongo/util/net/libhttp_client.so:                        T __bid128_to_int32_rnint
build/dynamic_gcc/mongo/util/libsecure_compare_memory.so:                  T __bid128_to_int32_rnint

We should solve this problem but it doesn't need to block the implementation of constexpr Decimal128 constructors.

Comment by Githook User [ 16/Jun/19 ]

Author:

{'name': 'Billy Donahue', 'email': 'billy.donahue@mongodb.com', 'username': 'BillyDonahue'}

Message: Revert "SERVER-24374 Make Decimal128 integer ctors constexpr"

This reverts commit e039271638d6dba34e5b64834e3f12e87aeb6455.
Branch: master
https://github.com/mongodb/mongo/commit/58df54d9c73b28bddfb2d83014f653f0c06ef44e

Comment by Githook User [ 16/Jun/19 ]

Author:

{'name': 'Billy Donahue', 'email': 'billy.donahue@mongodb.com', 'username': 'BillyDonahue'}

Message: SERVER-24374 Make Decimal128 integer ctors constexpr

reverts fab9fde6ba which reverted 668100df79
Branch: master
https://github.com/mongodb/mongo/commit/e039271638d6dba34e5b64834e3f12e87aeb6455

Comment by Billy Donahue [ 14/Jun/19 ]

Code Review
https://mongodbcr.appspot.com/443220008

(
a revert
of revert fab9fde6ba
of commit 668100df79
)

Comment by Githook User [ 13/Jun/19 ]

Author:

{'name': 'Blake Oler', 'email': 'blake.oler@mongodb.com', 'username': 'BlakeIsBlake'}

Message: Revert "SERVER-24374 Make Decimal128 integer ctors constexpr"

This reverts commit 668100df7982fd1ae3777fcf069de13253a05133.
Branch: master
https://github.com/mongodb/mongo/commit/fab9fde6ba3e08b710b07a42c82b635b1b31c989

Comment by Githook User [ 13/Jun/19 ]

Author:

{'name': 'A. Jesse Jiryu Davis', 'email': 'jesse@mongodb.com', 'username': 'ajdavis'}

Message: SERVER-24374 Make Decimal128 integer ctors constexpr
Branch: master
https://github.com/mongodb/mongo/commit/668100df7982fd1ae3777fcf069de13253a05133

Generated at Thu Feb 08 04:06:11 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.