This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug debug/40012] [4.5 Regression] Revision 146817 generated bad debug info for local variables
- From: "dje at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 2 Jun 2009 12:51:04 -0000
- Subject: [Bug debug/40012] [4.5 Regression] Revision 146817 generated bad debug info for local variables
- References: <bug-40012-7796@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #5 from dje at gcc dot gnu dot org 2009-06-02 12:51 -------
cfgexpand.c:expand_used_vars() expands and instantiates virtual-stack-vars for
INSNs when it walks the partion map:
for (i = 0; i < SA.map->num_partitions; i++)
{
tree var = partition_to_var (SA.map, i);
gcc_assert (is_gimple_reg (var));
if (TREE_CODE (SSA_NAME_VAR (var)) == VAR_DECL)
expand_one_var (var, true, true);
It then instantiates the same virtual-stack-vars in debug DECLs when it calls
expand_used_vars_for_block (outer_block, true), which calls
/* Expand all variables at this level. */
for (t = BLOCK_VARS (block); t ; t = TREE_CHAIN (t))
if (TREE_USED (t))
expand_one_var (t, toplevel, true);
The INSN var is an SSA_NAME and expand_one_stack_var_at() uses the alignment in
the DECL; the BLOCK var is not an SSA_NAME and the alignment is computed as the
STACK_BOUNDARY.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40012