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 c++/42871] [4.4 Regression] g++: Internal error: Segmentation fault (program cc1plus)



------- Comment #9 from rguenth at gcc dot gnu dot org  2010-01-27 12:08 -------
We're translating { {plus_expr,i_96,1}, {component_ref b2,b}, {component_ref
c3,array_ref i_96,c}, {plus_expr,i_29,1} } through

;; basic block 21, loop depth 1, count 0
;; prev block 7, next block 8
;; pred:       4 [95.5%]  (false,exec)
;; succ:       8 [100.0%]  (fallthru)
<bb 21>:

;; basic block 8, loop depth 2, count 0
;; prev block 21, next block 25
;; pred:       25 [100.0%]  (fallthru,dfs_back) 21 [100.0%]  (fallthru)
;; succ:       25 [95.5%]  (true,exec) 19 [4.5%]  (false,exec)
<bb 8>:
Invalid sum of incoming frequencies 9512, should be 9120
# i_10 = PHI <i_29(25), 0(21)>
i_29 = i_10 + 1;
if (i_29 < D.2275_92)
  goto <bb 25>;
else
  goto <bb 19>;

during partial-antic computation.  And we recurse endlessly phi-translating
{plus_expr,i_96,1} already.  Because the leader for i_96 we are translating
is {component_ref c3,array_ref i_96,c} where we recursively reach i_96
and its leader again.

The whole function:

void bar() ()
{
  unsigned int D.2295;
  unsigned int D.2294;
  struct C * D.2291;
  int * D.2287;
  unsigned int i;
  int SR.6;
  unsigned int D.2275;
  unsigned int D.2274;
  struct C * D.2271;
  int * D.2267;
  unsigned int i;
  int save_filt.3;
  void * save_eptr.2;
  register struct C * D.2182;
  int i;
  struct C c[100];
  struct B b;

<bb 2>:
  __comp_ctor  (&b, 100);

<bb 3>:
  # i_96 = PHI <i_14(28), 0(2)>
  c[i_96].c3 = i_96;
  D.2275_92 = b.b3;
  if (D.2275_92 != 0)
    goto <bb 4>;
  else
    goto <bb 20>;

<bb 20>:
  goto <bb 12>;

<bb 4>:
  D.2274_93 = b.b4;
  if (D.2274_93 != 0)
    goto <bb 5>;
  else
    goto <bb 21>;

<bb 5>:
Invalid sum of incoming frequencies 38, should be 430
  D.2271_24 = b.b2;
  D.2271_24->c3 = i_96;
  D.2267_28 = foo ();

<bb 6>:
  *D.2267_28 = 12;
  D.2295_3 = b.b3;
  if (D.2295_3 != 0)
    goto <bb 22>;
  else
    goto <bb 23>;

<bb 23>:
  goto <bb 12>;

<bb 22>:

<bb 7>:
  # D.2295_107 = PHI <D.2295_3(22), D.2295_104(19)>
  D.2294_100 = b.b4;
  if (D.2294_100 != 0)
    goto <bb 9>;
  else
    goto <bb 24>;

<bb 21>:

<bb 8>:
Invalid sum of incoming frequencies 9512, should be 9120
  # i_10 = PHI <i_29(25), 0(21)>
  i_29 = i_10 + 1;
  if (i_29 < D.2275_92)
    goto <bb 25>;
  else
    goto <bb 19>;

<bb 25>:
  goto <bb 8>;

<bb 9>:
Invalid sum of incoming frequencies 38, should be 430
  SR.6_33 = c[i_96].c3;
  D.2291_34 = b.b2;
  D.2291_34->c3 = SR.6_33;
  D.2287_38 = foo ();

<bb 10>:
  *D.2287_38 = 12;
  goto <bb 12>;

<bb 24>:

<bb 11>:
Invalid sum of incoming frequencies 9512, should be 9120
  # i_98 = PHI <i_39(26), 0(24)>
  i_39 = i_98 + 1;
  if (D.2295_107 > i_39)
    goto <bb 26>;
  else
    goto <bb 27>;

<bb 26>:
  goto <bb 11>;

<bb 27>:

<bb 12>:
  a ();

<bb 13>:
  i_14 = i_96 + 1;
  if (i_14 <= 99)
    goto <bb 28>;
  else
    goto <bb 29>;

<bb 28>:
  goto <bb 3>;

<L6>:
  save_filt.3_15 = [filter_expr] <<<filter object>>>;
  save_eptr.2_16 = [exc_ptr_expr] <<<exception object>>>;

<bb 15>:
  # D.2182_106 = PHI <D.2182_18(30), &c[100](14)>
  D.2182_18 = D.2182_106 + -4;
  if (&c[0] == D.2182_18)
    goto <bb 16>;
  else
    goto <bb 30>;

<bb 30>:
  goto <bb 15>;

<bb 16>:
Invalid sum of outgoing probabilities 0.0%
  <<<exception object>>> = save_eptr.2_16;
  <<<filter object>>> = save_filt.3_15;
  resx 1

<bb 29>:

<bb 17>:
  # D.2182_51 = PHI <D.2182_20(31), &c[100](29)>
  D.2182_20 = D.2182_51 + -4;
  if (&c[0] == D.2182_20)
    goto <bb 18>;
  else
    goto <bb 31>;

<bb 31>:
  goto <bb 17>;

<bb 18>:
  return;

<bb 19>:
  D.2295_104 = b.b3;
  goto <bb 7>;

}


-- 


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


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