re PR inline-asm/56405 (ICE on questionable "m" argument)
authorJakub Jelinek <jakub@redhat.com>
Thu, 21 Feb 2013 09:33:49 +0000 (10:33 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Thu, 21 Feb 2013 09:33:49 +0000 (10:33 +0100)
PR inline-asm/56405
* expr.c (expand_expr_real_1) <case TARGET_MEM_REF, MEM_REF>: Don't
use movmisalign or extract_bit_field for EXPAND_MEMORY modifier.

* gcc.c-torture/compile/pr56405.c: New test.

From-SVN: r196195

gcc/ChangeLog
gcc/expr.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/compile/pr56405.c [new file with mode: 0644]

index 98d18c0bc5ce0af45e2054af260e85571d99313b..6859906dbc8d96e2ea8f1fb40e82cbc28da88dfb 100644 (file)
@@ -1,3 +1,9 @@
+2013-02-21  Jakub Jelinek  <jakub@redhat.com>
+
+       PR inline-asm/56405
+       * expr.c (expand_expr_real_1) <case TARGET_MEM_REF, MEM_REF>: Don't
+       use movmisalign or extract_bit_field for EXPAND_MEMORY modifier.
+
 2013-02-20  Jan Hubicka  <jh@suse.cz>
 
        PR tree-optimization/56265
index 08c5c9d0c589c61c9d4d11126c438da62e165c8a..d225479e84ea2668d23d2c4ea33e9d7420604373 100644 (file)
@@ -9551,6 +9551,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
        set_mem_addr_space (temp, as);
        align = get_object_alignment (exp);
        if (modifier != EXPAND_WRITE
+           && modifier != EXPAND_MEMORY
            && mode != BLKmode
            && align < GET_MODE_ALIGNMENT (mode)
            /* If the target does not have special handling for unaligned
@@ -9639,6 +9640,7 @@ expand_expr_real_1 (tree exp, rtx target, enum machine_mode tmode,
        if (TREE_THIS_VOLATILE (exp))
          MEM_VOLATILE_P (temp) = 1;
        if (modifier != EXPAND_WRITE
+           && modifier != EXPAND_MEMORY
            && mode != BLKmode
            && align < GET_MODE_ALIGNMENT (mode))
          {
index d79a94f9641cdf4844b4b27d246f0878810a4863..3ae4dc0c36d1133f921916f120b4a23fe6f03eff 100644 (file)
@@ -1,3 +1,8 @@
+2013-02-21  Jakub Jelinek  <jakub@redhat.com>
+
+       PR inline-asm/56405
+       * gcc.c-torture/compile/pr56405.c: New test.
+
 2013-02-20  Jan Hubicka  <jh@suse.cz>
 
        PR tree-optimization/56265
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr56405.c b/gcc/testsuite/gcc.c-torture/compile/pr56405.c
new file mode 100644 (file)
index 0000000..6e6a56e
--- /dev/null
@@ -0,0 +1,7 @@
+/* PR inline-asm/56405 */
+
+void
+foo (void)
+{
+  asm volatile ("" : "+m" (*(volatile unsigned short *) 0x1001UL));
+}