tree-dfa.c (add_referenced_var): Register initializers of global variables.
2004-07-26 Eric Christopher <echristo@redhat.com> * tree-dfa.c (add_referenced_var): Register initializers of global variables. 2004-07-26 Eric Christopher <echristo@redhat.com> * gcc.c-torture/compile/20040726-2.c: New test. From-SVN: r85214
This commit is contained in:
parent
764c35da02
commit
ff6a32068d
@ -1,4 +1,9 @@
|
||||
2004-07-22 Paolo Bonzini <bonzini@gnu.org>
|
||||
2004-07-26 Eric Christopher <echristo@redhat.com>
|
||||
|
||||
* tree-dfa.c (add_referenced_var): Register initializers of global
|
||||
variables.
|
||||
|
||||
2004-07-26 Paolo Bonzini <bonzini@gnu.org>
|
||||
|
||||
* config/i386/i386.c (function_arg): Always treat 8-
|
||||
and 16-byte wide vectors the same, even if MMX/SSE
|
||||
|
@ -1,3 +1,7 @@
|
||||
2004-07-26 Eric Christopher <echristo@redhat.com>
|
||||
|
||||
* gcc.c-torture/compile/20040726-2.c: New test.
|
||||
|
||||
2004-07-26 Andrew Pinski <apinski@apple.com>
|
||||
|
||||
* g++.dg/rtti/tinfo1.C: Xfail.
|
||||
|
22
gcc/testsuite/gcc.c-torture/compile/20040726-2.c
Normal file
22
gcc/testsuite/gcc.c-torture/compile/20040726-2.c
Normal file
@ -0,0 +1,22 @@
|
||||
/* { dg-do compile } */
|
||||
/* From a failure after the global ccp pass. */
|
||||
typedef struct
|
||||
{
|
||||
char n[129];
|
||||
} A;
|
||||
|
||||
const A C = {
|
||||
0,
|
||||
0
|
||||
};
|
||||
|
||||
extern const A *const B;
|
||||
|
||||
void bar(const char *);
|
||||
|
||||
void foo ()
|
||||
{
|
||||
bar (B->n);
|
||||
}
|
||||
|
||||
const A *const B = &C;
|
@ -903,6 +903,14 @@ add_referenced_var (tree var, struct walk_state *walk_state)
|
||||
/* Global and static variables are call-clobbered, always. */
|
||||
if (needs_to_live_in_memory (var))
|
||||
mark_call_clobbered (var);
|
||||
|
||||
/* If an initialized global variable then register the initializer
|
||||
as well. */
|
||||
if (POINTER_TYPE_P (TREE_TYPE (var))
|
||||
&& TREE_READONLY (var)
|
||||
&& DECL_INITIAL (var)
|
||||
&& TREE_CODE (DECL_INITIAL (var)) == ADDR_EXPR)
|
||||
walk_tree (&DECL_INITIAL (var), find_vars_r, walk_state, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user