- Notifications
You must be signed in to change notification settings - Fork5k
Commitfdb5dd6
committed
Be more paranoid in configure's checks for CRC and POPCNT intrinsics.
In these tests, we need to verify not only that the compiler has heardof these intrinsics, but that lower-level tools cope with them too.(For example, the assembler must also know the instructions, and onsome platforms there might be library support involved.) The hazardis that the compiler might optimize away the calls altogether,allowing the configure check to succeed only to have the build faillater if lower-level support is missing. The existing code tried toprevent that by ensuring that the result of the intrinsic is usedfor something, but that's really insufficient because we were feedingconstant input to it. So the compiler would be perfectly entitled tooptimize away the calls anyway. Fix by making the inputs into globalvariables. (Hypothetically, LTO optimization could still remove thecode --- but that's well past where we'd be likely to hit trouble.)It is not known that any current compiler would actually optimizeaway these calls, and even if that happened it would be unlikelythat any problem would manifest. Our concern for this stems fromlargely-bygone days when it was common to install gcc on platformswith some other native compiler, so that a compiler-vs-librarysupport discrepancy was more probable. Still, there's littlepoint in defending against such cases in a way that is visiblyincomplete.I'm content to fix this in master for now; we can back-patch ifany indication appears that it's a live problem for someone.Discussion:https://postgr.es/m/3368102.1741993462@sss.pgh.pa.us1 parent50ba65e commitfdb5dd6
3 files changed
+36
-31
lines changedLines changed: 16 additions & 12 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
553 | 553 |
| |
554 | 554 |
| |
555 | 555 |
| |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
556 | 560 |
| |
557 | 561 |
| |
558 | 562 |
| |
559 | 563 |
| |
| 564 | + | |
560 | 565 |
| |
561 | 566 |
| |
562 | 567 |
| |
563 | 568 |
| |
564 | 569 |
| |
565 |
| - | |
566 | 570 |
| |
567 | 571 |
| |
568 | 572 |
| |
| |||
593 | 597 |
| |
594 | 598 |
| |
595 | 599 |
| |
596 |
| - | |
597 |
| - | |
598 |
| - | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
599 | 603 |
| |
600 | 604 |
| |
601 | 605 |
| |
| |||
628 | 632 |
| |
629 | 633 |
| |
630 | 634 |
| |
631 |
| - | |
632 |
| - | |
633 |
| - | |
| 635 | + | |
| 636 | + | |
634 | 637 |
| |
635 | 638 |
| |
636 | 639 |
| |
| |||
680 | 683 |
| |
681 | 684 |
| |
682 | 685 |
| |
683 |
| - | |
| 686 | + | |
684 | 687 |
| |
| 688 | + | |
| 689 | + | |
685 | 690 |
| |
686 | 691 |
| |
687 | 692 |
| |
688 | 693 |
| |
689 | 694 |
| |
690 |
| - | |
691 | 695 |
| |
692 | 696 |
| |
693 |
| - | |
694 |
| - | |
| 697 | + | |
| 698 | + | |
695 | 699 |
| |
696 | 700 |
| |
697 | 701 |
| |
698 |
| - | |
| 702 | + | |
699 | 703 |
| |
700 | 704 |
| |
701 | 705 |
| |
|
Lines changed: 13 additions & 13 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
17334 | 17334 |
| |
17335 | 17335 |
| |
17336 | 17336 |
| |
| 17337 | + | |
| 17338 | + | |
17337 | 17339 |
| |
17338 | 17340 |
| |
17339 | 17341 |
| |
17340 | 17342 |
| |
17341 | 17343 |
| |
17342 |
| - | |
17343 | 17344 |
| |
17344 | 17345 |
| |
17345 |
| - | |
17346 |
| - | |
| 17346 | + | |
| 17347 | + | |
17347 | 17348 |
| |
17348 | 17349 |
| |
17349 | 17350 |
| |
| |||
17387 | 17388 |
| |
17388 | 17389 |
| |
17389 | 17390 |
| |
| 17391 | + | |
17390 | 17392 |
| |
17391 | 17393 |
| |
17392 | 17394 |
| |
17393 | 17395 |
| |
17394 | 17396 |
| |
17395 |
| - | |
17396 | 17397 |
| |
17397 | 17398 |
| |
17398 | 17399 |
| |
| |||
17459 | 17460 |
| |
17460 | 17461 |
| |
17461 | 17462 |
| |
| 17463 | + | |
17462 | 17464 |
| |
17463 | 17465 |
| |
17464 | 17466 |
| |
17465 |
| - | |
17466 |
| - | |
| 17467 | + | |
17467 | 17468 |
| |
17468 | 17469 |
| |
17469 | 17470 |
| |
| |||
17500 | 17501 |
| |
17501 | 17502 |
| |
17502 | 17503 |
| |
| 17504 | + | |
17503 | 17505 |
| |
17504 | 17506 |
| |
17505 | 17507 |
| |
17506 |
| - | |
17507 |
| - | |
| 17508 | + | |
17508 | 17509 |
| |
17509 | 17510 |
| |
17510 | 17511 |
| |
| |||
17541 | 17542 |
| |
17542 | 17543 |
| |
17543 | 17544 |
| |
| 17545 | + | |
17544 | 17546 |
| |
17545 | 17547 |
| |
17546 | 17548 |
| |
17547 |
| - | |
17548 |
| - | |
| 17549 | + | |
17549 | 17550 |
| |
17550 | 17551 |
| |
17551 | 17552 |
| |
| |||
17585 | 17586 |
| |
17586 | 17587 |
| |
17587 | 17588 |
| |
17588 |
| - | |
| 17589 | + | |
17589 | 17590 |
| |
17590 | 17591 |
| |
17591 | 17592 |
| |
17592 |
| - | |
17593 |
| - | |
| 17593 | + | |
17594 | 17594 |
| |
17595 | 17595 |
| |
17596 | 17596 |
| |
|
Lines changed: 7 additions & 6 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2259 | 2259 |
| |
2260 | 2260 |
| |
2261 | 2261 |
| |
| 2262 | + | |
2262 | 2263 |
| |
2263 | 2264 |
| |
2264 | 2265 |
| |
2265 | 2266 |
| |
2266 | 2267 |
| |
2267 | 2268 |
| |
2268 |
| - | |
2269 | 2269 |
| |
2270 | 2270 |
| |
2271 |
| - | |
2272 |
| - | |
| 2271 | + | |
| 2272 | + | |
2273 | 2273 |
| |
2274 | 2274 |
| |
2275 | 2275 |
| |
| |||
2317 | 2317 |
| |
2318 | 2318 |
| |
2319 | 2319 |
| |
| 2320 | + | |
2320 | 2321 |
| |
2321 | 2322 |
| |
2322 | 2323 |
| |
2323 | 2324 |
| |
2324 | 2325 |
| |
2325 | 2326 |
| |
2326 |
| - | |
2327 | 2327 |
| |
2328 | 2328 |
| |
2329 | 2329 |
| |
| |||
2352 | 2352 |
| |
2353 | 2353 |
| |
2354 | 2354 |
| |
| 2355 | + | |
2355 | 2356 |
| |
2356 | 2357 |
| |
2357 | 2358 |
| |
2358 |
| - | |
2359 | 2359 |
| |
2360 | 2360 |
| |
2361 | 2361 |
| |
| |||
2390 | 2390 |
| |
2391 | 2391 |
| |
2392 | 2392 |
| |
| 2393 | + | |
| 2394 | + | |
2393 | 2395 |
| |
2394 | 2396 |
| |
2395 |
| - | |
2396 | 2397 |
| |
2397 | 2398 |
| |
2398 | 2399 |
| |
|
0 commit comments
Comments
(0)