re PR other/43564 (ICE on code with optimize attribute and inlining)

PR 43564
	* toplev.c (process_options): Set optimization_default_node
	and optimization_current_node.
	* opts.c (decode_options): Don't set optimization_default_node
	and optimization_current_node.

	testsuite/
	PR 43564
	* gcc.dg/pr43564.c: New test.

From-SVN: r157795
This commit is contained in:
Jie Zhang 2010-03-29 13:06:50 +00:00 committed by Jie Zhang
parent 10fa280a98
commit 3b34d92c9c
5 changed files with 34 additions and 7 deletions

View File

@ -1,3 +1,11 @@
2010-03-29 Jie Zhang <jie@codesourcery.com>
PR 43564
* toplev.c (process_options): Set optimization_default_node
and optimization_current_node.
* opts.c (decode_options): Don't set optimization_default_node
and optimization_current_node.
2010-03-29 Ralf Corsépius <ralf.corsepius@rtems.org>
* config/rtems.h: Abandon -qrtems_debug.

View File

@ -1034,6 +1034,7 @@ decode_options (unsigned int argc, const char **argv)
flag_pic = flag_pie;
if (flag_pic && !flag_pie)
flag_shlib = 1;
first_time_p = false;
}
if (optimize == 0)
@ -1112,13 +1113,6 @@ decode_options (unsigned int argc, const char **argv)
flag_ira_algorithm = IRA_ALGORITHM_PRIORITY;
}
/* Save the current optimization options if this is the first call. */
if (first_time_p)
{
optimization_default_node = build_optimization_node ();
optimization_current_node = optimization_default_node;
first_time_p = false;
}
if (flag_conserve_stack)
{
if (!PARAM_SET_P (PARAM_LARGE_STACK_FRAME))

View File

@ -1,3 +1,8 @@
2010-03-29 Jie Zhang <jie@codesourcery.com>
PR 43564
* gcc.dg/pr43564.c: New test.
2010-03-29 Tobias Burnus <burnus@net-b.de>
PR fortran/43551

View File

@ -0,0 +1,16 @@
/* { dg-options "-O0" } */
/* { dg-do compile } */
static inline __attribute__ ((__always_inline__))
unsigned __clz (unsigned input)
{
unsigned output;
__asm__ __volatile__ ("clz %0, %1":"=r" (output):"r" (input));
}
__attribute__ ((optimize ("O2")))
void foo ()
{
unsigned a;
unsigned b;
a = __clz (b);
}

View File

@ -2148,6 +2148,10 @@ process_options (void)
"for correctness");
flag_omit_frame_pointer = 0;
}
/* Save the current optimization options. */
optimization_default_node = build_optimization_node ();
optimization_current_node = optimization_default_node;
}
/* This function can be called multiple times to reinitialize the compiler