Commit 903e49f5 by Jakub Jelinek Committed by Jakub Jelinek

re PR target/52086 (ICE caused by wrong peephole2 for QImode mem += reg followed by test)

	PR target/52086
	* config/i386/i386.md (*addqi_2 peephole with SImode addition): Check
	that operands[2] is either immediate, or q_regs_operand.

	* gcc.dg/pr52086.c: New test.

From-SVN: r183830
parent 13c931c9
2012-02-02 Jakub Jelinek <jakub@redhat.com> 2012-02-02 Jakub Jelinek <jakub@redhat.com>
PR target/52086
* config/i386/i386.md (*addqi_2 peephole with SImode addition): Check
that operands[2] is either immediate, or q_regs_operand.
PR tree-optimization/52073 PR tree-optimization/52073
* tree-vect-stmts.c (vect_mark_relevant): When checking uses of * tree-vect-stmts.c (vect_mark_relevant): When checking uses of
a pattern stmt for pattern uses, ignore uses outside of the loop. a pattern stmt for pattern uses, ignore uses outside of the loop.
......
;; GCC machine description for IA-32 and x86-64. ;; GCC machine description for IA-32 and x86-64.
;; Copyright (C) 1988, 1994, 1995, 1996, 1997, 1998, 1999, 2000, ;; Copyright (C) 1988, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
;; 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 ;; 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
;; Free Software Foundation, Inc. ;; Free Software Foundation, Inc.
;; Mostly by William Schelter. ;; Mostly by William Schelter.
;; x86_64 support added by Jan Hubicka ;; x86_64 support added by Jan Hubicka
...@@ -17232,6 +17232,9 @@ ...@@ -17232,6 +17232,9 @@
&& REG_P (operands[0]) && REG_P (operands[4]) && REG_P (operands[0]) && REG_P (operands[4])
&& REGNO (operands[0]) == REGNO (operands[4]) && REGNO (operands[0]) == REGNO (operands[4])
&& peep2_reg_dead_p (4, operands[0]) && peep2_reg_dead_p (4, operands[0])
&& (<MODE>mode != QImode
|| immediate_operand (operands[2], SImode)
|| q_regs_operand (operands[2], SImode))
&& !reg_overlap_mentioned_p (operands[0], operands[1]) && !reg_overlap_mentioned_p (operands[0], operands[1])
&& ix86_match_ccmode (peep2_next_insn (3), && ix86_match_ccmode (peep2_next_insn (3),
(GET_CODE (operands[3]) == PLUS (GET_CODE (operands[3]) == PLUS
......
2012-02-02 Jakub Jelinek <jakub@redhat.com> 2012-02-02 Jakub Jelinek <jakub@redhat.com>
PR target/52086
* gcc.dg/pr52086.c: New test.
PR tree-optimization/52073 PR tree-optimization/52073
* gcc.c-torture/compile/pr52073.c: New test. * gcc.c-torture/compile/pr52073.c: New test.
......
/* PR target/52086 */
/* { dg-do compile } */
/* { dg-options "-O2" } */
/* { dg-additional-options "-fpic" { target fpic } } */
struct S { char a; char b[100]; };
int bar (void);
int baz (int);
void
foo (struct S *x)
{
if (bar () & 1)
{
char c = bar ();
baz (4);
x->a += c;
while (x->a)
x->b[c] = bar ();
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment