Page MenuHomePhabricator

Move f optimizations to clang_ignored_gcc_optimization_f_Group

Authored by bubbles231 on Jul 11 2014, 8:55 AM.



Moved 25 flags to clang_ignored_gcc_optimization_f_Group. Will display a warning to the user if they try to pass those optimizations.

Patch by Arthur Marble <> in the context of Debian Google Summer of code 2014.

Diff Detail

Event Timeline

bubbles231 updated this revision to Diff 11320.Jul 11 2014, 8:55 AM
bubbles231 retitled this revision from to Move f optimizations to clang_ignored_gcc_optimization_f_Group.
bubbles231 updated this object.
bubbles231 edited the test plan for this revision. (Show Details)
sylvestre.ledru added inline comments.

This one too


For other reviewers, it is an optim flag.

sylvestre.ledru updated this object.
sylvestre.ledru added a subscriber: Unknown Object (MLST).
bubbles231 updated this revision to Diff 11330.Jul 11 2014, 2:37 PM

Add -fdefer-pop to the group and update the code so it applies with new revisions.

bubbles231 updated this revision to Diff 11441.Jul 15 2014, 7:15 AM

Update patch to be compatible with new revision.

rnk added inline comments.Jul 15 2014, 1:19 PM

This isn't an optimization flag, IMO. This is the equivalent of changing all discardable (linkonce / linkonce_odr) globals to non-discardable globals (weak / weak_odr). I know it's in GCC optimization flag docs, but it's more of a correctness workaround for invalid code.


ditto, not optimization.

Actually, while you're at it, can you make this a BooleanFFlag to reduce duplication?


Hm, these are probably easy to implement in LLVM today. No action needed, though, this change is right.


These are lots of subprocess invocations. You can speed up the test significantly by making this all one compiler invocation along the lines of:

// RUN: %clang -### %s \
// RUN:  -fflag \
// ...
// RUN: 2>&1 | FileCheck --check-prefix=CHECK-WARNING %s
// CHECK-WARNING-DAG: optimization flag '-fflag' is not supported
// ...
bubbles231 updated this revision to Diff 11477.Jul 15 2014, 4:25 PM

Make requested changes.

sylvestre.ledru accepted this revision.Jul 17 2014, 4:40 AM
sylvestre.ledru edited edge metadata.

rnk, is it ok with you too?

This revision is now accepted and ready to land.Jul 17 2014, 4:40 AM

Merged by Arthur on my request as commit r213365 to make sure it gets in 3.5.
rnk, don't hesitate to drop us a mail if you see anything wrong.