re PR c/31072 ([4.2 Rgression] Wrong code for volatile var with initalization and optimization)

2007-03-08  Andrew Pinski  <andrew_pinski@playstation.sony.com>

        PR C/31072
        * c-decl.c (merge_decls): Don't call make_var_volatile.
        * varasm.c (make_var_volatile): Remove.
        * output.h (make_var_volatile): Remove.

2007-03-08  Andrew Pinski  <andrew_pinski@playstation.sony.com>

        PR C/31072
        * gcc.c-torture/execute/pr31072.c: New test.

From-SVN: r122736
This commit is contained in:
Andrew Pinski 2007-03-09 00:32:34 +00:00 committed by Andrew Pinski
parent 99681c8b0f
commit ee9f69b425
6 changed files with 23 additions and 20 deletions

View File

@ -1,3 +1,10 @@
2007-03-08 Andrew Pinski <andrew_pinski@playstation.sony.com>
PR C/31072
* c-decl.c (merge_decls): Don't call make_var_volatile.
* varasm.c (make_var_volatile): Remove.
* output.h (make_var_volatile): Remove.
2007-03-08 Zdenek Dvorak <dvorakz@suse.cz>
PR tree-optimization/31085

View File

@ -1690,11 +1690,7 @@ merge_decls (tree newdecl, tree olddecl, tree newtype, tree oldtype)
TREE_READONLY (olddecl) = 1;
if (TREE_THIS_VOLATILE (newdecl))
{
TREE_THIS_VOLATILE (olddecl) = 1;
if (TREE_CODE (newdecl) == VAR_DECL)
make_var_volatile (newdecl);
}
TREE_THIS_VOLATILE (olddecl) = 1;
/* Merge deprecatedness. */
if (TREE_DEPRECATED (newdecl))

View File

@ -170,10 +170,6 @@ extern void emutls_finish (void);
Prefixes such as % are optional. */
extern int decode_reg_name (const char *);
/* Make the rtl for variable VAR be volatile.
Use this only for static variables. */
extern void make_var_volatile (tree);
extern void assemble_alias (tree, tree);
extern void default_assemble_visibility (tree, int);

View File

@ -1,3 +1,8 @@
2007-03-08 Andrew Pinski <andrew_pinski@playstation.sony.com>
PR C/31072
* gcc.c-torture/execute/pr31072.c: New test.
2007-03-08 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* gcc.dg/builtins-55.c: Test *lceil* and *lfloor*.

View File

@ -0,0 +1,10 @@
extern volatile int ReadyFlag_NotProperlyInitialized;
volatile int ReadyFlag_NotProperlyInitialized=1;
int main(void)
{
if (ReadyFlag_NotProperlyInitialized != 1)
__builtin_abort ();
return 0;
}

View File

@ -1403,17 +1403,6 @@ make_decl_rtl (tree decl)
if (flag_mudflap && TREE_CODE (decl) == VAR_DECL)
mudflap_enqueue_decl (decl);
}
/* Make the rtl for variable VAR be volatile.
Use this only for static variables. */
void
make_var_volatile (tree var)
{
gcc_assert (MEM_P (DECL_RTL (var)));
MEM_VOLATILE_P (DECL_RTL (var)) = 1;
}
/* Output a string of literal assembler code
for an `asm' keyword used between functions. */