Commit ffc5b2bb by Richard Biener Committed by Richard Biener

re PR bootstrap/55792 (Bad memory access with profiledbootstrap and LTO)

2013-01-10  Richard Biener  <rguenther@suse.de>

	PR bootstrap/55792
	* tree-into-ssa.c (rewrite_add_phi_arguments): Do not set
	locations for virtual PHI arguments.
	(rewrite_update_phi_arguments): Likewise.

From-SVN: r195084
parent e9772e16
2013-01-10 Richard Biener <rguenther@suse.de>
PR bootstrap/55792
* tree-into-ssa.c (rewrite_add_phi_arguments): Do not set
locations for virtual PHI arguments.
(rewrite_update_phi_arguments): Likewise.
2013-01-10 Joel Sherrill <joel.sherrill@OARcorp.com> 2013-01-10 Joel Sherrill <joel.sherrill@OARcorp.com>
* config/v850/rtems.h (ASM_SPEC): Pass -m8byte-align and -mgcc-abi * config/v850/rtems.h (ASM_SPEC): Pass -m8byte-align and -mgcc-abi
......
...@@ -1355,13 +1355,18 @@ rewrite_add_phi_arguments (basic_block bb) ...@@ -1355,13 +1355,18 @@ rewrite_add_phi_arguments (basic_block bb)
for (gsi = gsi_start_phis (e->dest); !gsi_end_p (gsi); for (gsi = gsi_start_phis (e->dest); !gsi_end_p (gsi);
gsi_next (&gsi)) gsi_next (&gsi))
{ {
tree currdef; tree currdef, res;
gimple stmt; location_t loc;
phi = gsi_stmt (gsi); phi = gsi_stmt (gsi);
currdef = get_reaching_def (SSA_NAME_VAR (gimple_phi_result (phi))); res = gimple_phi_result (phi);
stmt = SSA_NAME_DEF_STMT (currdef); currdef = get_reaching_def (SSA_NAME_VAR (res));
add_phi_arg (phi, currdef, e, gimple_location (stmt)); /* Virtual operand PHI args do not need a location. */
if (virtual_operand_p (res))
loc = UNKNOWN_LOCATION;
else
loc = gimple_location (SSA_NAME_DEF_STMT (currdef));
add_phi_arg (phi, currdef, e, loc);
} }
} }
} }
...@@ -2018,20 +2023,26 @@ rewrite_update_phi_arguments (basic_block bb) ...@@ -2018,20 +2023,26 @@ rewrite_update_phi_arguments (basic_block bb)
/* Update the argument if there is a reaching def. */ /* Update the argument if there is a reaching def. */
if (reaching_def) if (reaching_def)
{ {
gimple stmt;
source_location locus; source_location locus;
int arg_i = PHI_ARG_INDEX_FROM_USE (arg_p); int arg_i = PHI_ARG_INDEX_FROM_USE (arg_p);
SET_USE (arg_p, reaching_def); SET_USE (arg_p, reaching_def);
stmt = SSA_NAME_DEF_STMT (reaching_def);
/* Single element PHI nodes behave like copies, so get the /* Virtual operands do not need a location. */
location from the phi argument. */ if (virtual_operand_p (reaching_def))
if (gimple_code (stmt) == GIMPLE_PHI && locus = UNKNOWN_LOCATION;
gimple_phi_num_args (stmt) == 1)
locus = gimple_phi_arg_location (stmt, 0);
else else
locus = gimple_location (stmt); {
gimple stmt = SSA_NAME_DEF_STMT (reaching_def);
/* Single element PHI nodes behave like copies, so get the
location from the phi argument. */
if (gimple_code (stmt) == GIMPLE_PHI
&& gimple_phi_num_args (stmt) == 1)
locus = gimple_phi_arg_location (stmt, 0);
else
locus = gimple_location (stmt);
}
gimple_phi_arg_set_location (phi, arg_i, locus); gimple_phi_arg_set_location (phi, arg_i, locus);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment