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]

Re: [PATCH] add split condition to *fix_trunchi_1


Joseph S. Myers wrote:

This patch was commited to mainline (bootstrapped on i686-pc-linux-gnu,
regtested c,c++:

2004-11-18 Uros Bizjak <uros@kss-loka.si>

* configure/i386/i386.md (*fix_trunch_1): Add "&& 1" to
insn split constraint.
(define_peephole2): Remove unneeded "&& 1" from peephole2
constraints.


Attached patch should revert the (define_peephole2) part of my commit.

However, adding and removing "&& 1" should have no effect on the code, so IMHO a bug is hidden here, and my patch just uncovers it. These two patterns are claimed to be the same:

(define_peephole2
 [(match_scratch:DI 2 "r")
  (set (match_operand:DI 0 "push_operand" "")
       (match_operand:DI 1 "immediate_operand" ""))]
 "TARGET_64BIT && !symbolic_operand (operands[1], DImode)
  && !x86_64_immediate_operand (operands[1], DImode)"
 [(set (match_dup 2) (match_dup 1))
  (set (match_dup 0) (match_dup 2))]
 "")

(define_peephole2
[(set (match_operand:DI 0 "push_operand" "")
(match_operand:DI 1 "immediate_operand" ""))]
"TARGET_64BIT && !symbolic_operand (operands[1], DImode)
&& !x86_64_immediate_operand (operands[1], DImode) && 1"
[(set (match_dup 0) (match_dup 1))
(set (match_dup 2) (match_dup 3))]
"split_di (operands + 1, 1, operands + 2, operands + 3);
operands[1] = gen_lowpart (DImode, operands[2]);
operands[2] = gen_rtx_MEM (SImode, gen_rtx_PLUS (DImode, stack_pointer_rtx,
GEN_INT (4)));
")


This part is actually the same in both patterns:

(set (match_operand:DI 0 "push_operand" "")
       (match_operand:DI 1 "immediate_operand" ""))

It looks that compiler free to process only above part, even when sequence of

  (match_scratch:DI 2 "r")
  (set (match_operand:DI 0 "push_operand" "")
       (match_operand:DI 1 "immediate_operand" ""))

is found. Attached patch will enable bootstrap on x86_64 by sweeping this possible bug under the carpet...

Uros.

Index: i386.md
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/i386/i386.md,v
retrieving revision 1.563
diff -u -p -r1.563 i386.md
--- i386.md	18 Nov 2004 07:34:55 -0000	1.563
+++ i386.md	18 Nov 2004 13:37:31 -0000
@@ -1870,7 +1870,7 @@
   [(set (match_operand:DI 0 "push_operand" "")
         (match_operand:DI 1 "immediate_operand" ""))]
   "TARGET_64BIT && !symbolic_operand (operands[1], DImode)
-   && !x86_64_immediate_operand (operands[1], DImode)"
+   && !x86_64_immediate_operand (operands[1], DImode) && 1"
   [(set (match_dup 0) (match_dup 1))
    (set (match_dup 2) (match_dup 3))]
   "split_di (operands + 1, 1, operands + 2, operands + 3);
@@ -2136,7 +2136,7 @@
   [(set (match_operand:DI 0 "memory_operand" "")
         (match_operand:DI 1 "immediate_operand" ""))]
   "TARGET_64BIT && !symbolic_operand (operands[1], DImode)
-   && !x86_64_immediate_operand (operands[1], DImode)"
+   && !x86_64_immediate_operand (operands[1], DImode) && 1"
   [(set (match_dup 2) (match_dup 3))
    (set (match_dup 4) (match_dup 5))]
   "split_di (operands, 2, operands + 2, operands + 4);")

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