This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Fix PR45052


We need to look at the stmts volatile flag.

Bootstrapped and tested on x86_64-unknown-linux-gnu, applied.

Richard.

2010-07-26  Richard Guenther  <rguenther@suse.de>

	PR tree-optimization/45052
	* ipa-pure-const.c (check_stmt): Check volatileness.

Index: gcc/ipa-pure-const.c
===================================================================
*** gcc/ipa-pure-const.c	(revision 162057)
--- gcc/ipa-pure-const.c	(working copy)
*************** check_stmt (gimple_stmt_iterator *gsip,
*** 416,421 ****
--- 416,428 ----
        print_gimple_stmt (dump_file, stmt, 0, 0);
      }
  
+   if (gimple_has_volatile_ops (stmt))
+     {
+       local->pure_const_state = IPA_NEITHER;
+       if (dump_file)
+ 	fprintf (dump_file, "    Volatile stmt is not const/pure\n");
+     }
+ 
    /* Look for loads and stores.  */
    walk_stmt_load_store_ops (stmt, local, check_load, check_store);
  


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]