@@ -1804,6 +1804,12 @@ void * os::dll_load(const char *filename, char *ebuf, int ebuflen) {
1804
1804
1805
1805
void * os::Linux::dlopen_helper (const char *filename, char *ebuf, int ebuflen) {
1806
1806
#ifndef IA32
1807
+ bool ieee_handling = IEEE_subnormal_handling_OK ();
1808
+ if (!ieee_handling) {
1809
+ Events::log_dll_message (nullptr , " IEEE subnormal handling check failed before loading %s" , filename);
1810
+ log_info (os)(" IEEE subnormal handling check failed before loading %s" , filename);
1811
+ }
1812
+
1807
1813
// Save and restore the floating-point environment around dlopen().
1808
1814
// There are known cases where global library initialization sets
1809
1815
// FPU flags that affect computation accuracy, for example, enabling
@@ -1843,11 +1849,20 @@ void * os::Linux::dlopen_helper(const char *filename, char *ebuf, int ebuflen) {
1843
1849
#ifndef IA32
1844
1850
// Quickly test to make sure subnormals are correctly handled.
1845
1851
if (! IEEE_subnormal_handling_OK ()) {
1846
- // We just dlopen()ed a library that mangled the floating-point
1847
- // flags. Silently fix things now.
1852
+ // We just dlopen()ed a library that mangled the floating-point flags.
1853
+ // Attempt to fix things now.
1848
1854
int rtn = fesetenv (&default_fenv);
1849
1855
assert (rtn == 0 , " fesetenv must succeed" );
1850
- assert (IEEE_subnormal_handling_OK (), " fsetenv didn't work" );
1856
+ bool ieee_handling_after_issue = IEEE_subnormal_handling_OK ();
1857
+
1858
+ if (ieee_handling_after_issue) {
1859
+ Events::log_dll_message (nullptr , " IEEE subnormal handling had to be corrected after loading %s" , filename);
1860
+ log_info (os)(" IEEE subnormal handling had to be corrected after loading %s" , filename);
1861
+ } else {
1862
+ Events::log_dll_message (nullptr , " IEEE subnormal handling could not be corrected after loading %s" , filename);
1863
+ log_info (os)(" IEEE subnormal handling could not be corrected after loading %s" , filename);
1864
+ }
1865
+ assert (ieee_handling_after_issue, " fesetenv didn't work" );
1851
1866
}
1852
1867
#endif // IA32
1853
1868
}
0 commit comments