public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/25623]  New: DOM messes up "incoming frequencies" for some BBs
@ 2006-01-01 17:37 pinskia at gcc dot gnu dot org
  2006-01-17 12:35 ` [Bug tree-optimization/25623] " pinskia at gcc dot gnu dot org
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-01-01 17:37 UTC (permalink / raw)
  To: gcc-bugs

Testcase:
SUBROUTINE S42(a,b,c,N)
 IMPLICIT NONE
 integer :: N
 real*8  :: a(N),b(N),c(N),tmp,tmp2,tmp4
 real*8, parameter :: p=1.0D0/3.0D0
 integer :: i
 c=0.0D0
 DO i=1,N
   tmp=a(i)**p ! could even be done with a cube root
   tmp2=tmp*tmp
   tmp4=tmp2*tmp2
   b(i)=b(i)+tmp4
   c(i)=c(i)+tmp2
 ENDDO
END SUBROUTINE
------------
in .t50.dom2:
<bb 2>:
  D.824_4 = *n_3;
  if (D.824_4 <= 0) goto <L16>; else goto <L1>;

  # S.7_5 = PHI <S.7_32(3), 1(2)>;
<L1>:;
  D.826_31 = S.7_5 + -1;
  (*c_26)[D.826_31] = 0.0;
  S.7_32 = S.7_5 + 1;
  if (D.824_4 < S.7_32) goto L.4; else goto <L1>;

Invalid sum of incoming frequencies 900, should be 0
L.4:;

Invalid sum of incoming frequencies 0, should be 766
  # i_11 = PHI <1(4)>;
<L3>:;

  # i_1 = PHI <1(5), i_30(6)>;
<L11>:;
  D.828_13 = i_1 + -1;
  D.820_15 = (*a_14)[D.828_13];
  tmp_16 = __builtin_pow (D.820_15,
3.33333333333333314829616256247390992939472198486e-1);
  tmp2_17 = __builtin_pow (tmp_16, 2.0e+0);
  tmp4_18 = __builtin_pow (tmp2_17, 2.0e+0);
  D.829_22 = (*b_21)[D.828_13];
  D.830_23 = D.829_22 + tmp4_18;
  (*b_21)[D.828_13] = D.830_23;
  D.831_27 = (*c_26)[D.828_13];
  D.832_28 = D.831_27 + tmp2_17;
  (*c_26)[D.828_13] = D.832_28;
  i_30 = i_1 + 1;
  if (i_1 == D.824_4) goto <L7>; else goto <L11>;

Invalid sum of incoming frequencies 866, should be 1000
<L7>:;
  return;

<L16>:;
  goto <bb 7> (<L7>);

------------------------------------------------------
in .t49.copyrename2:
<bb 2>:
  D.824_4 = *n_3;
  if (D.824_4 <= 0) goto L.4; else goto <L1>;

  # S.7_5 = PHI <S.7_32(3), 1(2)>;
<L1>:;
  D.826_31 = S.7_5 + -1;
  (*c_26)[D.826_31] = 0.0;
  S.7_32 = S.7_5 + 1;
  if (D.824_4 < S.7_32) goto L.4; else goto <L1>;

L.4:;
  if (D.824_4 > 0) goto <L3>; else goto <L7>;

  # i_11 = PHI <1(4)>;
<L3>:;

  # i_1 = PHI <i_11(5), i_30(6)>;
<L11>:;
  D.828_13 = i_1 + -1;
  D.820_15 = (*a_14)[D.828_13];
  tmp_16 = __builtin_pow (D.820_15,
3.33333333333333314829616256247390992939472198486e-1);
  tmp2_17 = __builtin_pow (tmp_16, 2.0e+0);
  tmp4_18 = __builtin_pow (tmp2_17, 2.0e+0);
  D.829_22 = (*b_21)[D.828_13];
  D.830_23 = D.829_22 + tmp4_18;
  (*b_21)[D.828_13] = D.830_23;
  D.831_27 = (*c_26)[D.828_13];
  D.832_28 = D.831_27 + tmp2_17;
  (*c_26)[D.828_13] = D.832_28;
  i_30 = i_1 + 1;
  if (i_1 == D.824_4) goto <L7>; else goto <L11>;

<L7>:;
  return;


-- 
           Summary: DOM messes up "incoming frequencies" for some BBs
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: pinskia at gcc dot gnu dot org


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



^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug tree-optimization/25623] DOM messes up "incoming frequencies" for some BBs
  2006-01-01 17:37 [Bug tree-optimization/25623] New: DOM messes up "incoming frequencies" for some BBs pinskia at gcc dot gnu dot org
@ 2006-01-17 12:35 ` pinskia at gcc dot gnu dot org
  2006-03-02 12:53 ` [Bug tree-optimization/25623] jump threading " pinskia at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-01-17 12:35 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from pinskia at gcc dot gnu dot org  2006-01-17 12:35 -------
Here is another testcase:
void rs6000_emit_move (int mode, int t, int tt)
{
  if (t == 1)
    if (mode != 2)
      t = tttt();
  if (t == 1)
    if (mode != 2)
        __builtin_abort ();
}


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |law at gcc dot gnu dot org


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


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug tree-optimization/25623] jump threading messes up "incoming frequencies" for some BBs
  2006-01-01 17:37 [Bug tree-optimization/25623] New: DOM messes up "incoming frequencies" for some BBs pinskia at gcc dot gnu dot org
  2006-01-17 12:35 ` [Bug tree-optimization/25623] " pinskia at gcc dot gnu dot org
@ 2006-03-02 12:53 ` pinskia at gcc dot gnu dot org
  2006-03-02 12:57 ` rguenth at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-03-02 12:53 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from pinskia at gcc dot gnu dot org  2006-03-02 12:53 -------
This still happens as of today.  
with the C testcase from comment #1, we get:
Invalid sum of incoming frequencies 894, should be 9
<L5>:;
  __builtin_abort ();

Invalid sum of incoming frequencies 9106, should be 9991
<L6>:;
  return;


-- 


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


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug tree-optimization/25623] jump threading messes up "incoming frequencies" for some BBs
  2006-01-01 17:37 [Bug tree-optimization/25623] New: DOM messes up "incoming frequencies" for some BBs pinskia at gcc dot gnu dot org
  2006-01-17 12:35 ` [Bug tree-optimization/25623] " pinskia at gcc dot gnu dot org
  2006-03-02 12:53 ` [Bug tree-optimization/25623] jump threading " pinskia at gcc dot gnu dot org
@ 2006-03-02 12:57 ` rguenth at gcc dot gnu dot org
  2006-03-02 13:00 ` rguenth at gcc dot gnu dot org
  2006-03-11  5:05 ` pinskia at gcc dot gnu dot org
  4 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2006-03-02 12:57 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from rguenth at gcc dot gnu dot org  2006-03-02 12:57 -------
Confirmed.  It's dom2 messing up.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2006-03-02 12:57:12
               date|                            |


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


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug tree-optimization/25623] jump threading messes up "incoming frequencies" for some BBs
  2006-01-01 17:37 [Bug tree-optimization/25623] New: DOM messes up "incoming frequencies" for some BBs pinskia at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2006-03-02 12:57 ` rguenth at gcc dot gnu dot org
@ 2006-03-02 13:00 ` rguenth at gcc dot gnu dot org
  2006-03-11  5:05 ` pinskia at gcc dot gnu dot org
  4 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2006-03-02 13:00 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from rguenth at gcc dot gnu dot org  2006-03-02 13:00 -------
4.1.0 has also after dom2:

Invalid sum of incoming frequencies 673, should be 21
<L5>:;
  __builtin_abort ();

Invalid sum of incoming frequencies 9327, should be 9979
<L6>:;
  return;

4.0.2 has even different mismatched frequencies.  So at least not a regression.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to fail|                            |4.1.0 4.2.0


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


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug tree-optimization/25623] jump threading messes up "incoming frequencies" for some BBs
  2006-01-01 17:37 [Bug tree-optimization/25623] New: DOM messes up "incoming frequencies" for some BBs pinskia at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2006-03-02 13:00 ` rguenth at gcc dot gnu dot org
@ 2006-03-11  5:05 ` pinskia at gcc dot gnu dot org
  4 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-03-11  5:05 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from pinskia at gcc dot gnu dot org  2006-03-11 05:05 -------
Actually looking at this again, I am starting to think cfg cleanup is causing
this and not jump threading really.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  BugsThisDependsOn|                            |26602


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


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug tree-optimization/25623] jump threading messes up "incoming frequencies" for some BBs
       [not found] <bug-25623-4@http.gcc.gnu.org/bugzilla/>
@ 2021-08-08 17:17 ` pinskia at gcc dot gnu.org
  0 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-08-08 17:17 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=25623

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|2006-03-02 12:57:12         |2021-8-8
      Known to fail|                            |4.4.7, 4.9.1, 5.1.0, 7.1.0

--- Comment #6 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
For comment #1 in GCC 8+, the problem shows up in thread1:
;;   Invalid sum of incoming counts 332256647 (estimated locally), should be
365072220 (estimated locally)


On the trunk in thread1:
;;   basic block 6, loop depth 0, count 0 (precise), probably never executed
;;   Invalid sum of incoming counts 20359759 (estimated locally), should be 0
(precise)
;;    prev block 5, next block 7, flags: (NEW, VISITED)
;;    pred:       4 [never]  count:0 (precise) (TRUE_VALUE,EXECUTABLE)
;;                5 [11.4% (guessed)]  count:20359759 (estimated locally)
(TRUE_VALUE,EXECUTABLE)
  # .MEM_16 = PHI <.MEM_11(4), .MEM_12(5)>
  # .MEM_8 = VDEF <.MEM_16>
  # USE = nonlocal 
  # CLB = nonlocal 
  abortD.1081 ();
;;    succ:      

;;   basic block 7, loop depth 0, count 1073741824 (estimated locally), maybe
hot
;;   Invalid sum of incoming counts 1053382065 (estimated locally), should be
1073741824 (estimated locally)
;;    prev block 6, next block 1, flags: (NEW, VISITED)
;;    pred:       5 [88.6% (guessed)]  count:158087543 (estimated locally)
(FALSE_VALUE,EXECUTABLE)
;;                4 [always]  count:186624922 (estimated locally)
(FALSE_VALUE,EXECUTABLE)
;;                2 [66.0% (guessed)]  count:708669600 (estimated locally)
(FALSE_VALUE,EXECUTABLE)
  # .MEM_9 = PHI <.MEM_12(5), .MEM_11(4), .MEM_4(D)(2)>
  # VUSE <.MEM_9>
  return;
;;    succ:       EXIT [always]  count:1073741824 (estimated locally)
(EXECUTABLE)

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-08-08 17:17 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-01-01 17:37 [Bug tree-optimization/25623] New: DOM messes up "incoming frequencies" for some BBs pinskia at gcc dot gnu dot org
2006-01-17 12:35 ` [Bug tree-optimization/25623] " pinskia at gcc dot gnu dot org
2006-03-02 12:53 ` [Bug tree-optimization/25623] jump threading " pinskia at gcc dot gnu dot org
2006-03-02 12:57 ` rguenth at gcc dot gnu dot org
2006-03-02 13:00 ` rguenth at gcc dot gnu dot org
2006-03-11  5:05 ` pinskia at gcc dot gnu dot org
     [not found] <bug-25623-4@http.gcc.gnu.org/bugzilla/>
2021-08-08 17:17 ` pinskia at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).