OSDN Git Service

PR target/12898
authorfalk <falk@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 21 Jan 2004 15:52:47 +0000 (15:52 +0000)
committerfalk <falk@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 21 Jan 2004 15:52:47 +0000 (15:52 +0000)
        * config/alpha/alpha.c (alpha_emit_set_const_1): If
        no_new_pseudos, use gen_rtx_SET directly for SImode constants
        which need multiple instructions to emit.

        * testsuite/gcc.c-torture/compile/20040121-1.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@76283 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/config/alpha/alpha.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/compile/20040121-1.c [new file with mode: 0644]

index 5eaac36..ac0537f 100644 (file)
@@ -1,3 +1,10 @@
+2004-01-21  Falk Hueffner  <falk@debian.org>
+
+       PR target/12898
+       * config/alpha/alpha.c (alpha_emit_set_const_1): If
+       no_new_pseudos, use gen_rtx_SET directly for SImode constants
+       which need multiple instructions to emit.
+
 2004-01-21  Inaoka Kazuhiro  <inaoka.kazuhiro@renesas.com>
 
        * config/m32r/m32r.h (CPP_SPEC): Define.
index f6485a0..581d344 100644 (file)
@@ -2503,7 +2503,14 @@ alpha_emit_set_const_1 (rtx target, enum machine_mode mode,
        }
       else if (n >= 2 + (extra != 0))
        {
-         temp = copy_to_suggested_reg (GEN_INT (high << 16), subtarget, mode);
+         if (no_new_pseudos)
+           {
+             emit_insn (gen_rtx_SET (VOIDmode, target, GEN_INT (high << 16)));
+             temp = target;
+           }
+         else
+           temp = copy_to_suggested_reg (GEN_INT (high << 16),
+                                         subtarget, mode);
 
          /* As of 2002-02-23, addsi3 is only available when not optimizing.
             This means that if we go through expand_binop, we'll try to
index 9b022b8..35f7953 100644 (file)
@@ -1,3 +1,7 @@
+2004-01-21  Falk Hueffner  <falk@debian.org>
+
+       * gcc.c-torture/compile/20040121-1.c: New test.
+
 2004-01-21  Zack Weinberg  <zack@codesourcery.com>
 
        * gcc.dg/noncompile/20020213-1.c: Add another dg-warning line.
diff --git a/gcc/testsuite/gcc.c-torture/compile/20040121-1.c b/gcc/testsuite/gcc.c-torture/compile/20040121-1.c
new file mode 100644 (file)
index 0000000..2039472
--- /dev/null
@@ -0,0 +1,41 @@
+/* PR target/12898
+   0x8000 needs multiple instructions to be emitted on Alpha; the
+   fluff around it causes it to be emitted in a no_new_pseudos
+   context, which triggered a problem in alpha.c.  */
+
+void f (const char *, ...);
+int g (void);
+void *p (void);
+
+int isymBase, ilineBase, sym_hdr, want_line, proc_desc;
+char *lines;
+
+void print_file_desc (int *fdp)
+{
+  char *str_base = p ();
+  int symi, pdi = g ();
+
+  for (symi = 0; isymBase;)
+    {
+      int proc_ptr = proc_desc + pdi;
+      f("1", isymBase, proc_ptr + *fdp, str_base);
+      if (want_line && *fdp)
+       {
+         int delta;
+         long cur_line = proc_ptr;
+         char *line_ptr = lines + proc_ptr;
+         char *line_end = p ();
+
+         f("2", sym_hdr);
+         while (line_ptr < line_end)
+           {
+             delta = *line_ptr;
+             if (delta)
+               line_ptr++;
+             else
+               delta = line_ptr[1] ^ 0x8000;
+             f("3", cur_line, delta);
+           }
+       }
+    }
+}