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

[Bug tree-optimization/51680] [4.7 Regression] g++ 4.7 fails to inline trivial template stuff


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51680

--- Comment #10 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-01-02 10:43:03 UTC ---
Analyzing function body size: float add1(float)
                Accounting size:2.00, time:0.00 on new predicate:(not inlined)

 BB 2 predicate:(true)
  D.2207_2 = x_1(D) + 1.0e+0;
                freq:1.00 size:  1 time:  1
                Accounting size:1.00, time:1.00 on predicate:(true)
  return D.2207_2;
                freq:1.00 size:  1 time:  2
                Will be eliminated by inlining
                Accounting size:1.00, time:2.00 on predicate:(not inlined)

Inline summary for float add1(float)/0 inlinable
  self time:       3
  global time:     0
  self size:       4
  global size:     0
  self stack:      0
  global stack:    0
    size:1.000000, time:1.000000, predicate:(true)
    size:3.000000, time:2.000000, predicate:(not inlined)
  calls:

float add1(float) (float x)
{
  float D.2207;

<bb 2>:
  D.2207_2 = x_1(D) + 1.0e+0;
  return D.2207_2;

}


Analyzing function body size: void process_fun_at(const Fun&, T) [with Fun =
float(float); T = float]
                Accounting size:2.00, time:0.00 on new predicate:(not inlined)

 BB 2 predicate:(true)
  D.2206_3 = fun_1(D) (x_2(D));
                freq:1.00 size:  5 time: 17
  D.2205_4 = D.2206_3;
                freq:1.00 size:  0 time:  0
  process (D.2205_4);
                freq:1.00 size:  2 time: 11
  return;
                freq:1.00 size:  1 time:  2
                Will be eliminated by inlining
                Accounting size:1.00, time:2.00 on predicate:(not inlined)

Inline summary for void process_fun_at(const Fun&, T) [with Fun = float(float);
T = float]/2 inlinable
  self time:       30
  global time:     0
  self size:       10
  global size:     0
  self stack:      0
  global stack:    0
    size:0.000000, time:0.000000, predicate:(true)
    size:3.000000, time:2.000000, predicate:(not inlined)
  calls:
    void process(float)/3 function body not available
      loop depth: 0 freq:1000 size: 2 time: 11 callee size: 0 stack: 0
    indirect call loop depth: 0 freq:1000 size: 5 time: 17

Inline summary for void test(float)/1 inlinable
  self time:       14
  global time:     0
  self size:       6
  global size:     0
  self stack:      0
  global stack:    0
    size:0.000000, time:0.000000, predicate:(true)
    size:3.000000, time:2.000000, predicate:(not inlined)
  calls:
    void process_fun_at(const Fun&, T) [with Fun = float(float); T = float]/2
function not considered for inlining
      loop depth: 0 freq:1000 size: 3 time: 12 callee size: 5 stack: 0

void test(float) (float i)
{
<bb 2>:
  process_fun_at<float(float), float> (add1, i_1(D));
  return;

}

during early inlining we decide:

;; Function void test(float) (_Z4testf, funcdef_no=2, decl_uid=2196,
cgraph_uid=1)

Considering inline candidate void process_fun_at(const Fun&, T) [with Fun =
float(float); T = float].
   Estimating body: void process_fun_at(const Fun&, T) [with Fun =
float(float); T = float]/2
   Known to be false: not inlined
   size:7 time:28
   Estimating body: void process_fun_at(const Fun&, T) [with Fun =
float(float); T = float]/2
   Known to be false: not inlined
   size:7 time:28
  will not early inline: void test(float)/1->void process_fun_at(const Fun&, T)
[with Fun = float(float); T = float]/2, callee is not leaf and code would grow
by 4
Iterations: 0
void test(float) (float i)
{
<bb 2>:
  process_fun_at<float(float), float> (add1, i_1(D));

because we'd replace one call with two.  Not sure what the

Inline summary for void process_fun_at(const Fun&, T) [with Fun = float(float);
T = float]/2 inlinable
...
    size:0.000000, time:0.000000, predicate:(true)
    size:3.000000, time:2.000000, predicate:(not inlined)

lines mean.  Honza?


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