re PR target/20203 (unrecognizable insn when using long long and memset)
authorAlan Modra <amodra@bigpond.net.au>
Wed, 30 Mar 2005 03:51:12 +0000 (03:51 +0000)
committerAlan Modra <amodra@gcc.gnu.org>
Wed, 30 Mar 2005 03:51:12 +0000 (13:21 +0930)
PR target/20203
* builtins.c (get_memory_rtx): Expand address exp using EXPAND_NORMAL.
Remove convert_memory_address call duplicating that in memory_address.

From-SVN: r97233

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

index fbd8351723a4084c69b23f83e5fbc7da39369482..ad34f0ea119b5c606f0c33eb366bacc8be52948e 100644 (file)
@@ -1,3 +1,9 @@
+2005-03-30  Alan Modra  <amodra@bigpond.net.au>
+
+       PR target/20203
+       * builtins.c (get_memory_rtx): Expand address exp using EXPAND_NORMAL.
+       Remove convert_memory_address call duplicating that in memory_address.
+
 2005-03-29  Richard Henderson  <rth@redhat.com>
 
        PR c/20519
index 23bb4298884ae96eb87ea5ef7bf4b13896134911..68b91c56772b55a6c607666801e328f35b072690 100644 (file)
@@ -979,12 +979,8 @@ expand_builtin_prefetch (tree arglist)
 static rtx
 get_memory_rtx (tree exp)
 {
-  rtx addr = expand_expr (exp, NULL_RTX, ptr_mode, EXPAND_SUM);
-  rtx mem;
-
-  addr = convert_memory_address (Pmode, addr);
-
-  mem = gen_rtx_MEM (BLKmode, memory_address (BLKmode, addr));
+  rtx addr = expand_expr (exp, NULL_RTX, ptr_mode, EXPAND_NORMAL);
+  rtx mem = gen_rtx_MEM (BLKmode, memory_address (BLKmode, addr));
 
   /* Get an expression we can use to find the attributes to assign to MEM.
      If it is an ADDR_EXPR, use the operand.  Otherwise, dereference it if
index 7c7534420d7e049c47c303cc259170789748b96f..991873cb8abc8f61adb99581fd04a208595a8072 100644 (file)
@@ -1,3 +1,7 @@
+2005-03-30  Alan Modra  <amodra@bigpond.net.au>
+
+       * gcc.c-torture/compile/pr20203.c: New test.
+
 2005-03-26  Steven G. Kargl  <kargls@comcast.net>
 
        * gfortran.dg/promotion.f90:  New test.
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr20203.c b/gcc/testsuite/gcc.c-torture/compile/pr20203.c
new file mode 100644 (file)
index 0000000..1fb2a04
--- /dev/null
@@ -0,0 +1,16 @@
+void *memset (void *, int, unsigned long);
+
+typedef struct bfd_section
+{
+  unsigned long size;
+  unsigned char *contents;
+} asection;
+
+int
+_bfd_mips_elf_finish_dynamic_sections (asection *s)
+{
+  long long dummy_offset;
+  dummy_offset = s->size - 16;
+  memset (s->contents + dummy_offset, 0, 16);
+  return 1;
+}