Bug 20061 - Certain flags generate warnings when they should not.
Summary: Certain flags generate warnings when they should not.
Status: NEW
Alias: None
Product: gcc
Classification: Unclassified
Component: middle-end (show other bugs)
Version: 4.0.0
: P3 minor
Target Milestone: ---
Assignee: Not yet assigned to anyone
Keywords: diagnostic
Depends on:
Reported: 2005-02-18 17:35 UTC by Bill Mahoney
Modified: 2007-01-26 16:10 UTC (History)
3 users (show)

See Also:
Known to work:
Known to fail:
Last reconfirmed: 2006-02-13 03:53:33


Note You need to log in before you can comment on or make changes to this bug.
Description Bill Mahoney 2005-02-18 17:35:47 UTC
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 
Comment 1 Andrew Pinski 2005-02-18 18:38:08 UTC
Confirmed. Note this flag only turns on the dumping for the tree based loop optimizators and not for 
the RTL based ones.
Comment 2 Andrew Pinski 2005-04-15 20:23:59 UTC
I just ran into this today, as -fdump-tree-all is broken for a different reason.