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

--- Comment #2 from anlauf at gcc dot gnu.org ---
(In reply to Paul Thomas from comment #1)
> Harald and Andre: If you have any ideas on how to fix it, please let me know
> or take it over. The testcase fails on all branches that I have to hand but
> works fine with nagfor and ifort. 

I have no idea, but played around:

- changed the main so that the function result is first stored to a variable
  -> looks like we get random junk as result

- removed all PURE attributes and add print statements

The critical procedure is child_reset: adding a print there "fixes" the bug

- The dump-trees do not seem helpful

- the module file module1.mod has an IMPLICIT_PURE for child_reset even if I
  add an explicit IMPURE!  Is that a bug or feature?  I need to add a print
  (helps) or a save statement to a temporary variable (does not help) to get
  rid of IMPLICIT_PURE

- the IMPLICIT_PURE is likely a red herring, as SAVE does not help

Strange.

Reply via email to