gold: Make Ordering::operator() even more complex
authorH.J. Lu <hjl.tools@gmail.com>
Fri, 1 May 2020 17:06:15 +0000 (10:06 -0700)
committerH.J. Lu <hjl.tools@gmail.com>
Fri, 1 May 2020 17:06:31 +0000 (10:06 -0700)
GCC 9 generates the same function size for Ordering::operator() in
odr_violation1.cc and odr_violation2.cc on x32:

  134: 00000000    31 FUNC    WEAK   DEFAULT   64 _ZN8OrderingclEii
   40: 00000000    31 FUNC    GLOBAL DEFAULT   10 _ZN8OrderingclEii

This patch makes Ordering::operator() even more complex

   134: 00000000    31 FUNC    WEAK   DEFAULT   64 _ZN8OrderingclEii
    42: 00000000    35 FUNC    GLOBAL DEFAULT   11 _ZN8OrderingclEii

* testsuite/odr_violation2.cc (Ordering::operator()): Make
expression even more complex.

gold/ChangeLog
gold/testsuite/odr_violation2.cc

index 7bc3893f3496bd6b5b6c2014141220a83fd9f093..97044b6f7288c38f078295c0285e3dca369e14ed 100644 (file)
@@ -1,3 +1,8 @@
+2020-05-01  H.J. Lu  <hongjiu.lu@intel.com>
+
+       * testsuite/odr_violation2.cc (Ordering::operator()): Make
+       expression even more complex.
+
 2020-05-01  H.J. Lu  <hongjiu.lu@intel.com>
 
        * testsuite/ver_test_pr16504.sh: Updated.
index aa9868fc27c9166bb56ce61e978ec5a6be4bc875..35dd454704bf4861caefd94d0cce415248cf8a43 100644 (file)
@@ -12,7 +12,7 @@ class Ordering {
 bool Ordering::operator()(int a, int b) {
   // Optimization makes this operator() a different size than the one
   // in odr_violation1.cc.
-  return a + 12345 > b / 67;
+  return (a * 30 + b + 12345) > b / 67;
 }
 
 void SortDescending(int array[], int size) {
This page took 0.025441 seconds and 4 git commands to generate.