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

            Bug ID: 102362
           Summary: 'dump_printf_loc' doesn't work from 'gate' method of a
                    'gimple_opt_pass'
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Keywords: diagnostic
          Severity: normal
          Priority: P3
         Component: other
          Assignee: unassigned at gcc dot gnu.org
          Reporter: tschwinge at gcc dot gnu.org
                CC: dmalcolm at gcc dot gnu.org
  Target Milestone: ---

'dump_printf_loc' (guarded by the usual 'if (dump_enabled_p ())') of course
does work when called from the 'execute' method of a 'gimple_opt_pass', but I
found that it doesn't work when called from the 'gate' method:
'dumps_are_enabled' is 'false' at that point.

This may or may not be related to the "For some reason, this doesn't work"
issue I observed in commit 11b8286a83289f5b54e813f14ff56d730c3f3185 "[OpenACC
privatization] Largely extend diagnostics and corresponding testsuite coverage
[PR90115]": 'gcc/config/nvptx/nvptx.c:nvptx_goacc_expand_var_decl':

    #if 0 /* For some reason, this doesn't work.  */
    if (dump_enabled_p ())
      [dump_printf_loc ([...])]
    #else /* ..., thus emulate that, good enough for testsuite usage.  */
    [...]
    #endif

Reply via email to