I am interested in looking at the GCC loop optimization. There are some tree
dump flags that are registered (via register_dump_files() in tree-optimize.c).
In particular, -fdump-tree-loopinit-raw and -fdump-tree-loopdone-raw that
generate warnings when they should not. Specifically:
gcc -O3 -S -fdump-tree-loopinit-raw short.c
The problem is that there is also -fdump-tree-loop-raw as well, and "loop" is
a prefix of "loopinit" and "loopdone". The function dump_switch_p_1() in tree-
dump.c calls skip_leading_substring() which works correctly for "loopinit" but
then skips only the first four bytes when processing "loop". This
leaves "init" dangling, and generates:
cc1: warning: ignoring unknown option 'init' in '-fdump-tree-loop'
Same for "done" of course.
No need to do -save-temps or look at any of the compiler output - this happens
before any processing of the input file (a 4-line C program will suffice).
Also, no urgency because the --first-- encounter where it does match the
entire option works, so you do get the requested dumps, just the incorrect
Confirmed. Note this flag only turns on the dumping for the tree based loop optimizators and not for
the RTL based ones.
I just ran into this today, as -fdump-tree-all is broken for a different reason.