tree-sra.c (tree_non_mode_aligned_mem_p): Strip conversions and return false for...
authorMartin Jambor <mjambor@suse.cz>
Tue, 26 Jul 2011 17:21:21 +0000 (19:21 +0200)
committerMartin Jambor <jamborm@gcc.gnu.org>
Tue, 26 Jul 2011 17:21:21 +0000 (19:21 +0200)
2011-07-26  Martin Jambor  <mjambor@suse.cz>

* tree-sra.c (tree_non_mode_aligned_mem_p): Strip conversions and
return false for invariants.

From-SVN: r176797

gcc/ChangeLog
gcc/tree-sra.c

index ab5aaff9003c69cd74617e50e3f23a0e3417c959..bc2fd587c1b346488cde5214251c26aa9196416b 100644 (file)
@@ -1,3 +1,8 @@
+2011-07-26  Martin Jambor  <mjambor@suse.cz>
+
+       * tree-sra.c (tree_non_mode_aligned_mem_p): Strip conversions and
+       return false for invariants.
+
 2011-07-26  Uros Bizjak  <ubizjak@gmail.com>
 
        * config/i386/i386.md (add->lea splitter): Implement using SWI
index cbebb81ba02dc78959d5572dd3466c9d34de3f86..cc5cd36123f5030c3386bad00074d593c4f49f08 100644 (file)
@@ -1075,9 +1075,13 @@ tree_non_mode_aligned_mem_p (tree exp)
   enum machine_mode mode = TYPE_MODE (TREE_TYPE (exp));
   unsigned int align;
 
+  if (TREE_CODE (exp) == VIEW_CONVERT_EXPR)
+    exp = TREE_OPERAND (exp, 0);
+
   if (TREE_CODE (exp) == SSA_NAME
       || TREE_CODE (exp) == MEM_REF
       || mode == BLKmode
+      || is_gimple_min_invariant (exp)
       || !STRICT_ALIGNMENT)
     return false;