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
This commit is contained in:
parent
0fba566cb5
commit
68052d59d6
@ -1,5 +1,9 @@
|
||||
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))
|
||||
|
@ -1,5 +1,8 @@
|
||||
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.
|
||||
|
22
gcc/testsuite/gcc.dg/pr41841.c
Normal file
22
gcc/testsuite/gcc.dg/pr41841.c
Normal file
@ -0,0 +1,22 @@
|
||||
/* 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;
|
Loading…
Reference in New Issue
Block a user