Bug 64339 - reject unsafe options in pragma GCC optimize
Summary: reject unsafe options in pragma GCC optimize
Status: NEW
Alias: None
Product: gcc
Classification: Unclassified
Component: middle-end (show other bugs)
Version: unknown
: P3 enhancement
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: accepts-invalid, diagnostic
Depends on:
Blocks:
 
Reported: 2014-12-17 12:52 UTC by Manuel López-Ibáñez
Modified: 2021-02-27 16:58 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2017-09-28 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Manuel López-Ibáñez 2014-12-17 12:52:03 UTC
Some options are known to be unsafe to set via pragma GCC optimize. See: https://sourceware.org/ml/libc-alpha/2014-12/msg00597.html and https://sourceware.org/ml/libc-alpha/2014-12/msg00599.html

It would be better to add a flag to the *.opt files to mark safe options explicitly, such that specifying any option that is not safe produces a fatal error.
Comment 1 Eric Gallager 2017-09-28 21:51:38 UTC
(In reply to Manuel López-Ibáñez from comment #0)
> Some options are known to be unsafe to set via pragma GCC optimize. See:
> https://sourceware.org/ml/libc-alpha/2014-12/msg00597.html and
> https://sourceware.org/ml/libc-alpha/2014-12/msg00599.html
> 
> It would be better to add a flag to the *.opt files to mark safe options
> explicitly, such that specifying any option that is not safe produces a
> fatal error.

Taking Joseph's comments in the linked thread as confirmation.
Comment 2 Eric Gallager 2018-09-24 01:44:06 UTC
(In reply to Eric Gallager from comment #1)
> (In reply to Manuel López-Ibáñez from comment #0)
> > Some options are known to be unsafe to set via pragma GCC optimize. See:
> > https://sourceware.org/ml/libc-alpha/2014-12/msg00597.html and
> > https://sourceware.org/ml/libc-alpha/2014-12/msg00599.html
> > 
> > It would be better to add a flag to the *.opt files to mark safe options
> > explicitly, such that specifying any option that is not safe produces a
> > fatal error.
> 
> Taking Joseph's comments in the linked thread as confirmation.

...and cc-ing him.