On 1/21/25 8:48 AM, Thomas Schwinge wrote:
Hi!

On 2025-01-16T15:57:52+0100, I wrote:
I have noticed that '-fdump-tree-original-lineno' for Fortran (for
example) does dump location information, but for C/C++ it does not.
The reason is that Fortran (and other front ends) use code like:

     /* Output the GENERIC tree.  */
     dump_function (TDI_original, fndecl);

..., but 'gcc/c-family/c-gimplify.cc:c_genericize' has some special code
to "Dump the C-specific tree IR", and that (unless 'TDF_RAW') calls
'gcc/c-family/c-pretty-print.cc:print_c_tree', and appears to completely
ignore the 'dump_flags_t'.  (Ignores it in 'c_pretty_printer::statement',
and passes 'TDF_NONE' into 'dump_generic_node'.)

See the attached "Honor dump options for C/C++ '-fdump-tree-original'"
for what I have quickly hacked up.  Does that make any sense to do like
this, and if yes, how much more polish does this need, or if no, how
should we approach this issue otherwise?

(I need this, no surprise, for use in test cases.)

In addition to upcoming use of '-fdump-tree-original-lineno', this patch
actually resolves XFAILs for 'c-c++-common/goacc/pr92793-1.c', which had
gotten added as part of commit fa410314ec94c9df2ad270c1917adc51f9147c2c
"[OpenACC] Elaborate testcases that verify column location information 
[PR92793]".

With 'c-c++-common/goacc/pr92793-1.c' un-XFAILed, is it OK, for now, to
push the attached "Honor dump options for C/C++ '-fdump-tree-original'"?
I've 'make check'ed a number of different GCC targets/configurations.

OK in a week if no other comments.

Jason

Reply via email to