On Wed, 13 Jul 2011, Jakub Jelinek wrote: > Ideally we'd just include explicitly passed options from command line that > haven't been overridden by other command line options, and would sort them, > so that there are higher chances of DW_AT_producer strings being merged > (e.g. -O2 -ffast-math vs. -ffast-math -O2 are now different strings, and > similarly -O2 vs. -O3 -O2 vs. -O0 -O1 -Ofast -O2), but I'm not sure if it is > easily possible using current option handling framework.
I don't think there's enough structure for that, although prune_options could always be enhanced to cover more cases of overridden options. > + default: > + if (save_decoded_options[j].orig_option_with_args_text[0] != '-') > + continue; Should instead be ignoring OPT_SPECIAL_*. > + switch (save_decoded_options[j].orig_option_with_args_text[1]) > + { > + case 'M': > + case 'i': > + case 'W': It would be better to check the canonical option text rather than the original text. Normally this wouldn't make any difference because the driver will have passed canonical options to cc1, but if someone calls cc1 directly then I think aliases should still act the same as the options they are aliases for in this regard. > + continue; > + case 'n': > + if (save_decoded_options[j].orig_option_with_args_text[2] > + == 'o') > + continue; When would a "-no" option ever get passed to cc1? -- Joseph S. Myers jos...@codesourcery.com