On Mon, Nov 12, 2018 at 03:28:47PM -0500, Fritz Reese wrote: > Actually, the gcc frontend appears to move -std= before the > language-specific options before f951 is even executed regardless of > its location compared to the -fdec flags. I don't know if this is a
That is because: #define F951_OPTIONS "%(cc1_options) %{J*} \ %{!nostdinc:-fintrinsic-modules-path finclude%s}\ %{!fsyntax-only:%(invoke_as)}" and static const char *cc1_options = "%{pg:%{fomit-frame-pointer:%e-pg and -fomit-frame-pointer are incompatible}}\ %{!iplugindir*:%{fplugin*:%:find-plugindir()}}\ %1 %{!Q:-quiet} %{!dumpbase:-dumpbase %B} %{d*} %{m*} %{aux-info*}\ %{fcompare-debug-second:%:compare-debug-auxbase-opt(%b)} \ %{!fcompare-debug-second:%{c|S:%{o*:-auxbase-strip %*}%{!o*:-auxbase %b}}}%{!c:%{!S:-auxbase %b}} \ %{g*} %{O*} %{W*&pedantic*} %{w} %{std*&ansi&trigraphs}\ %{v:-version} %{pg:-p} %{p} %{f*} %{undef}\ where %{std*&ansi&trigraphs} comes before %{f*}. I guess let's not change that behavior. > bug or if it is by design -- the feeling I get is that the gcc > frontend processes it first since it is recognized before the flang > specific options. Therefore, greedily setting the standard options the > first time flag_dec appears means the standard information is lost and > I believe your suggestion is correct: the standard flags must be set > only once in gfc_post_options. > > In fact the new testcase dec_bitwise_ops_3.f90 is a good test of this: > it uses -fdec -fno-dec -std=legacy to avoid warnings for XOR. With the > version posted previously, the -std=legacy is overwritten by -fno-dec > and warnings still appear. Here's what I'd change from the previous > patch to support this: LGTM. > > Anyway, that is all from me, I still don't want to stomp on Fortran > > maintainer's review (use my global reviewer's rights for that) and > > thus I'm deferring the review to them. When committing, please make sure > > to include Mark's email in the ChangeLog next to yours to credit him. > > Thanks for your comments. I think nobody will feel stomped on since > maintainers are sparse and busy. I will certainly make note of Mark's > contributions when committing. Ok, so I'll ack it for trunk now, but please give the other Fortran maintainers one day to disagree before committing. For the release branches, I'd wait two weeks or so before backporting it. Thanks. Jakub