re PR ipa/60026 (ICE at -O3 on valid code (with the optimize pragma) on x86_64-linux-gnu)

PR ipa/60026
	* tree-inline.c (copy_forbidden): Fail for
	__attribute__((optimize (0))) functions.

	* c-c++-common/torture/pr60026.c: New test.

From-SVN: r207463
This commit is contained in:
Jakub Jelinek 2014-02-04 14:04:37 +01:00 committed by Jakub Jelinek
parent 30540e7958
commit eb259c4a32
4 changed files with 47 additions and 0 deletions

View File

@ -1,5 +1,9 @@
2014-02-04 Jakub Jelinek <jakub@redhat.com>
PR ipa/60026
* tree-inline.c (copy_forbidden): Fail for
__attribute__((optimize (0))) functions.
PR other/58712
* omp-low.c (simd_clone_struct_copy): If from->inbranch
is set, copy one less argument.

View File

@ -1,5 +1,8 @@
2014-02-04 Jakub Jelinek <jakub@redhat.com>
PR ipa/60026
* c-c++-common/torture/pr60026.c: New test.
PR rtl-optimization/57915
* gcc.target/i386/pr57915.c: New test.

View File

@ -0,0 +1,28 @@
/* PR ipa/60026 */
/* { dg-do compile } */
struct S { int f; } a;
__attribute__((optimize (0)))
struct S foo (int x, struct S y)
{
int b = y.f;
return a;
}
void
bar ()
{
while (a.f)
{
struct S c = {0};
foo (0, c);
}
}
int
main ()
{
bar ();
return 0;
}

View File

@ -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;