https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103432
Jan Hubicka <hubicka at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Ever confirmed|0 |1 Target Milestone|12.0 |--- Keywords|wrong-code | Known to work|11.2.0 | Status|UNCONFIRMED |ASSIGNED Last reconfirmed| |2021-11-26 Assignee|unassigned at gcc dot gnu.org |hubicka at gcc dot gnu.org CC| |hubicka at gcc dot gnu.org Component|ipa |tree-optimization --- Comment #1 from Jan Hubicka <hubicka at gcc dot gnu.org> --- It fails with ./xgcc -B ./ -O2 d.ii -fdbg-cnt=ipa_mod_ref_pta:189 -fdump-tree-all-details -fdump-ipa-all-details and works ./xgcc -B ./ -O2 d.ii -fdbg-cnt=ipa_mod_ref_pta:188 -fdump-tree-all-details -fdump-ipa-all-details The difference in optimized dump is: int main () { struct DCTFrom D.11418; @@ -2805,12 +2810,7 @@ float x[4]; struct DCTTo D.11356; struct DCTFrom D.11355; - float _3; - float _4; - double _6; struct FILE * stderr.3_8; - double _9; - struct FILE * stderr.4_11; float _12; float _13; double _15; @@ -2996,30 +2996,10 @@ {anonymous}::IDCT1DWrapper.constprop<4, 1, {anonymous}::DCTFrom, {anonymous}::DCTTo> (&D.11400, &D.11356); D.11400 ={v} {CLOBBER}; D.11356 ={v} {CLOBBER}; - _3 = out[2]; - _4 = _3 - 1.0e+0; - actual_accuracy_5 = ABS_EXPR <_4>; - if (actual_accuracy_5 > 9.999999974752427078783512115478515625e-7) - goto <bb 11>; [0.04%] - else - goto <bb 12>; [99.96%] - - <bb 11> [local count: 429325]: - _6 = (double) actual_accuracy_5; stderr.3_8 = stderr; - fprintf (stderr.3_8, "ERROR: Too low accuracy: exp=%f act=%f\n", 9.999999974752427078783512115478515625e-7, _6); + fprintf (stderr.3_8, "ERROR: Too low accuracy: exp=%f act=%f\n", 9.999999974752427078783512115478515625e-7, 1.0e+0); exit (1); - <bb 12> [local count: 1072883004]: - _9 = (double) actual_accuracy_5; - stderr.4_11 = stderr; - fprintf (stderr.4_11, "OK: Good accuracy: exp=%f act=%f\n", 9.999999974752427078783512115478515625e-7, _9); - x ={v} {CLOBBER}; - out ={v} {CLOBBER}; - coeffs ={v} {CLOBBER}; - scratch_space ={v} {CLOBBER}; - return 0; - } And I suppose we are not expected to optimize out the "Good accuracy" message :) So it looks out is modified by {anonymous}::IDCT1DWrapper.constprop<4, 1, {anonymous}::DCTFrom, {anonymous}::DCTTo> (&D.11400, &D.11356); but for some reason ipa propagation gets no_indirect_clobber for param1. This seems wrong since to->data is written to, so it is an indirect clobber. I may be able to look more into this only tomorrow - it is bit late.