[Bug middle-end/82004] [8 Regression] SPEC CPU2017 628.pop2_s miscompare

jakub at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Mar 26 17:40:00 GMT 2018


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

--- Comment #34 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Ok, I can now reproduce, but only with -flto, not without that.
Without -flto, before pre I see:
  <bb 34> [local count: 85892]:
  # logchl_591 = PHI
<-3.0099999999999997868371792719699442386627197265625e+0(33), logchl_701(129)>
  # mc_799 = PHI <mc_795(D)(33), mc_715(129)>
  # n_623 = PHI <0(33), _789(129)>
  # DEBUG n => n_623
  # DEBUG mc => mc_799
  # DEBUG logchl => logchl_591
  dlogchl.345_699 = dlogchl;
  logchl_701 = logchl_591 + dlogchl.345_699;
  # DEBUG logchl => logchl_701
  _702 = __builtin_pow (1.0e+1, logchl_701);
  chlamnt = _702;
  # DEBUG m => 1
  # DEBUG m => 1
...
in -fdump-tree-pre-details dump I see:
SCC consists of 67: logchl_591 .MEM_621 dlogchl.345_699 logchl_701 _702
.MEM_913 .MEM_914 .MEM_915 .MEM_916 .MEM_917 .MEM_918 stdout.350_714 .MEM_9
19 .MEM_920 .MEM_921 .MEM_922 .MEM_923 .MEM_924 .MEM_807 _718 _719 _723 _724
w2_725 w1_726 _727 _728 _729 _730 _731 .MEM_925 _732 _733 _734 _735 _7
36 .MEM_926 _737 _738 _739 _740 _741 .MEM_927 _742 _743 _744 _745 _746 .MEM_928
.MEM_944 mpercm.360_758 .MEM_622 _755 _757 _759 M.119_814 _761 _762
 _765 _767 _768 M.120_202 _770 _771 _773 _774 .MEM_946
Starting iteration 1
Value numbering logchl_591 stmt = logchl_591 = PHI
<-3.0099999999999997868371792719699442386627197265625e+0(33), logchl_701(129)>
Setting value number of logchl_591 to
-3.0099999999999997868371792719699442386627197265625e+0 (changed)
Value numbering .MEM_621 stmt = .MEM_621 = PHI <.MEM_898(33), .MEM_946(129)>
Setting value number of .MEM_621 to .MEM_898 (changed)
Value numbering dlogchl.345_699 stmt = dlogchl.345_699 = dlogchl;
Setting value number of dlogchl.345_699 to
1.00000000000000002081668171172168513294309377670288085938e-2 (changed)
Value numbering logchl_701 stmt = logchl_701 = logchl_591 + dlogchl.345_699;
Match-and-simplified logchl_591 + dlogchl.345_699 to -3.0e+0
RHS logchl_591 + dlogchl.345_699 simplified to -3.0e+0
Setting value number of logchl_701 to -3.0e+0 (changed)
Value numbering _702 stmt = _702 = __builtin_pow (1.0e+1, logchl_701);
Match-and-simplified __builtin_pow (1.0e+1, logchl_701) to
1.00000000000000002081668171172168513294309377670288085938e-3
call __builtin_pow (1.0e+1, logchl_701) simplified to
1.00000000000000002081668171172168513294309377670288085938e-3
Setting value number of _702 to
1.00000000000000002081668171172168513294309377670288085938e-3 (changed)

With -flto, I see just similar:
  <bb 34> [local count: 16255]:
  # n_925 = PHI <0(33), _1128(129)>
  # logchl_926 = PHI
<-3.0099999999999997868371792719699442386627197265625e+0(33), logchl_1040(129)>
  # mc_928 = PHI <mc_1134(D)(33), mc_1054(129)>
  # a1_lsm.5953_134 = PHI <a1_lsm.5953_1135(33), a1_lsm.5953_1120(129)>
  # a2_lsm.5954_1153 = PHI <a2_lsm.5954_135(33), a2_lsm.5954_127(129)>
  # b1_lsm.5955_1099 = PHI <b1_lsm.5955_136(33), b1_lsm.5955_128(129)>
  # b2_lsm.5956_139 = PHI <b2_lsm.5956_1233(33), b2_lsm.5956_129(129)>
  # DEBUG n => n_925
  # DEBUG mc => mc_928
  # DEBUG logchl => logchl_926
  logchl_1040 = logchl_926 +
1.00000000000000002081668171172168513294309377670288085938e-2;
  # DEBUG logchl => logchl_1040
  _1041 = __builtin_pow (1.0e+1, logchl_1040);
  chlamnt_lsm.5952_1150 = _1041;
  # DEBUG m => 1
  # DEBUG m => 1
before pre, but instead:
SCC consists of 2: logchl_926 logchl_1040
Starting iteration 1
Value numbering logchl_926 stmt = logchl_926 = PHI
<-3.0099999999999997868371792719699442386627197265625e+0(33), logchl_1040(129)>
Setting value number of logchl_926 to
-3.0099999999999997868371792719699442386627197265625e+0 (changed)
Value numbering logchl_1040 stmt = logchl_1040 = logchl_926 +
1.00000000000000002081668171172168513294309377670288085938e-2;
Match-and-simplified logchl_926 +
1.00000000000000002081668171172168513294309377670288085938e-2 to -3.0e+0
RHS logchl_926 + 1.00000000000000002081668171172168513294309377670288085938e-2
simplified to -3.0e+0
Setting value number of logchl_1040 to -3.0e+0 (changed)
Starting iteration 2
Value numbering logchl_926 stmt = logchl_926 = PHI
<-3.0099999999999997868371792719699442386627197265625e+0(33), logchl_1040(129)>
Setting value number of logchl_926 to logchl_926 (changed)
Value numbering logchl_1040 stmt = logchl_1040 = logchl_926 +
1.00000000000000002081668171172168513294309377670288085938e-2;
Setting value number of logchl_1040 to logchl_1040 (changed)
Processing SCC needed 3 iterations
Value numbering _1093 stmt = _1093 = (long int) k_1137;
Setting value number of _1093 to _1093 (changed)
Value numbering _1103 stmt = _1103 = _1091 + _1093;
Setting value number of _1103 to _1103 (changed)
Value numbering _1041 stmt = _1041 = __builtin_pow (1.0e+1, logchl_1040);
Setting value number of _1041 to _1041 (changed)

so this precomputation of the first iteration doesn't happen in that case. 
Richard, any way to debug why?  I'll attach the log files (lim2 and
pre-details).


More information about the Gcc-bugs mailing list