At the end of decode_options, flag_var_tracking is still
AUTODETECT_VALUE,
which is 2. It's set to 0 in process_options if we pass no options in
command line. Currently. we create optimization_default_node at the end
of
decode_options. So flag_var_tracking is recorded as 2 in
optimization_default_node. After processing a function with optimize
attribute, options are reset to optimization_default_node, which set
flag_var_tracking to 2. Thus var_location and debug_insn will be
generated
for the next functions, although we pass no debug options in command
line.
Then if the function with var_location is inlined into a function with
optimize attribute. the tree operand of var_location will have no chance
to
be expanded into RTL and eventually cause an ICE.
To fix this bug, this patch just move initialization of
optimization_default_node from decode_options to process_options, where
flag_var_tracking and friends have been initialized properly.
Regression testing has not been done yet.
Is it OK if no regressions?