Commit 68052d59 by Jakub Jelinek Committed by Jakub Jelinek

re PR tree-optimization/41841 (segfault using '-O -fipa-cp -fipa-struct-reorg…

re PR tree-optimization/41841 (segfault using '-O -fipa-cp -fipa-struct-reorg -fwhole-program -fprofile-generate')

	PR tree-optimization/41841
	* ipa-struct-reorg.c (build_data_structure): Don't attempt to look at
	local variables of not yet materialized clones.

	* gcc.dg/pr41841.c: New test.

From-SVN: r153807
parent 0fba566c
2009-11-02 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/41841
* ipa-struct-reorg.c (build_data_structure): Don't attempt to look at
local variables of not yet materialized clones.
PR debug/41893
* cfgexpand.c (expand_debug_expr): Don't attempt to create DECL_RTL
for a VOIDmode variable.
......@@ -3380,6 +3380,14 @@ build_data_structure (VEC (tree, heap) **unsuitable_types)
if (is_candidate (var, &type, unsuitable_types))
add_structure (type);
if (fn == NULL)
{
/* Skip cones that haven't been materialized yet. */
gcc_assert (c_node->clone_of
&& c_node->clone_of->decl != c_node->decl);
continue;
}
/* Check function local variables. */
for (var_list = fn->local_decls; var_list;
var_list = TREE_CHAIN (var_list))
......
2009-11-02 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/41841
* gcc.dg/pr41841.c: New test.
PR debug/41893
* gcc.dg/debug/pr41893-1.c: New test.
* gcc.dg/debug/pr41893-2.c: New file.
......
/* PR tree-optimization/41841 */
/* { dg-do compile } */
/* { dg-options "-O -fipa-struct-reorg -fwhole-program -fipa-cp" } */
typedef struct S *T;
typedef struct { } *U;
extern int f1 (void);
static void
f3 (U x, int y)
{
T a = (T) x;
y && f1 ();
}
static void
f2 (T x)
{
f3 ((U) x, 1);
}
void *volatile a __attribute__((used)) = f2;
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