summaryrefslogtreecommitdiff
path: root/gcc/tree-inline.c
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2014-02-04 13:04:37 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2014-02-04 13:04:37 +0000
commit5ceeaef0385ef8ca2dea4bc911c2a2e90859b45c (patch)
tree294855e859722fa6bd67ec674e1a393b20f63a87 /gcc/tree-inline.c
parent6562533efd46483ad6cad7c211c5a4d1b8d04c96 (diff)
downloadgcc-5ceeaef0385ef8ca2dea4bc911c2a2e90859b45c.tar.gz
PR ipa/60026
* tree-inline.c (copy_forbidden): Fail for __attribute__((optimize (0))) functions. * c-c++-common/torture/pr60026.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@207463 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-inline.c')
-rw-r--r--gcc/tree-inline.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c
index 439ef4c2933..ade78b22a12 100644
--- a/gcc/tree-inline.c
+++ b/gcc/tree-inline.c
@@ -3315,6 +3315,18 @@ copy_forbidden (struct function *fun, tree fndecl)
goto fail;
}
+ tree fs_opts;
+ fs_opts = DECL_FUNCTION_SPECIFIC_OPTIMIZATION (fun->decl);
+ if (fs_opts)
+ {
+ struct cl_optimization *os = TREE_OPTIMIZATION (fs_opts);
+ if (!os->x_optimize)
+ {
+ reason = G_("function %q+F compiled without optimizations");
+ goto fail;
+ }
+ }
+
fail:
fun->cannot_be_copied_reason = reason;
fun->cannot_be_copied_set = true;