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]

[testcase] -fssa -fssa-ccp -march=i686 ICE


Hi!

Another -fssa failure (though again I don't think it has anything to do with
ssa).
This ICEs in ix86_match_ccmode because recog_for_combine passes a different
pattern than the instruction already has:
x0:
(set (reg:CCNO 17 flags)
    (compare:CCNO (and:SI (reg:SI 70)
            (const_int 32896 [0x8080]))
        (const_int 0 [0x0])))
insn:
(insn 40 38 41 (set:SI (reg/f:SI 66)
        (plus:SI (reg/f:SI 67)
            (const_int 2 [0x2]))) 192 {*lea_1} (nil)
    (nil))

(unlike all other recog invocation where it seems like PATTERN(insn) is
always used). As ix86_match_ccmode is testing the whole instruction and not
the pattern passed to recog, this looses.
Either all abort() calls in ix86_match_ccmode need to be replaced with
return 0; (but even then it is IMHO wrong because recog is testing something
else than it should), or recog_for_combine needs to temporarily modify the
instruction by setting its pattern to pat and back (be it either
patsave = PATTERN (insn); PATTERN (insn) = pat; recog (); PATTERN (insn) = patsave;
or, if modifying insn is not an option, making a dummy insn with PATTERN pat
and reg notes copied over).
What do you think?

2002-02-01  Jakub Jelinek  <jakub@redhat.com>

	* gcc.dg/20020201-2.c: New test.

--- gcc/testsuite/gcc.dg/20020201-2.c.jj	Thu Aug 30 22:30:55 2001
+++ gcc/testsuite/gcc.dg/20020201-2.c	Sat Feb  2 01:14:29 2002
@@ -0,0 +1,14 @@
+/* { dg-do compile } */
+/* { dg-options "-O2 -fssa -fssa-ccp" } */
+/* { dg-options "-O2 -march=i686 -fssa -fssa-ccp" { target i?86-*-* } } */
+
+extern int bar (char *);
+
+int
+foo (void)
+{
+  char b[512];
+
+  bar (b);
+  return __builtin_strlen (b);
+}

	Jakub


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