Skip to content

Commit

Permalink
PR target/53358
Browse files Browse the repository at this point in the history
	* config/i386/i386.md (*addqi_2 peephole with QImode addition): Check
	that operands[2] is either immediate, or q_regs_operand.

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


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@187544 138bc75d-0d04-0410-961f-82ee72b054a4
  • Loading branch information
jakub committed May 15, 2012
1 parent cd4797f commit f2a4755
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 0 deletions.
6 changes: 6 additions & 0 deletions gcc/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
2012-05-15 Jakub Jelinek <jakub@redhat.com>

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

2012-05-15 Richard Guenther <rguenther@suse.de>

* cgraphunit.c (thunk_adjust): Use make_rename_temp.
Expand Down
3 changes: 3 additions & 0 deletions gcc/config/i386/i386.md
Original file line number Diff line number Diff line change
Expand Up @@ -17465,6 +17465,9 @@
"(TARGET_READ_MODIFY_WRITE || optimize_insn_for_size_p ())
&& peep2_reg_dead_p (4, operands[0])
&& !reg_overlap_mentioned_p (operands[0], operands[1])
&& (<MODE>mode != QImode
|| immediate_operand (operands[2], QImode)
|| q_regs_operand (operands[2], QImode))
&& ix86_match_ccmode (peep2_next_insn (3),
(GET_CODE (operands[3]) == PLUS
|| GET_CODE (operands[3]) == MINUS)
Expand Down
5 changes: 5 additions & 0 deletions gcc/testsuite/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
2012-05-15 Jakub Jelinek <jakub@redhat.com>

PR target/53358
* gcc.dg/pr53358.c: New test.

2012-05-15 Paolo Carlini <paolo.carlini@oracle.com>

PR c++/11856
Expand Down
22 changes: 22 additions & 0 deletions gcc/testsuite/gcc.dg/pr53358.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/* PR target/53358 */
/* { dg-do compile } */
/* { dg-options "-O2" } */
/* { dg-additional-options "-fpic" { target fpic } } */
/* { dg-additional-options "-mtune=pentium4" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */

struct S { unsigned char s, t[17]; };
int bar (void);

void
foo (struct S *x)
{
unsigned char i, z;
if (bar ())
{
z = bar ();
bar ();
x->s += z;
for (i = 0; i < x->s; i++)
x->t[i] = bar ();
}
}

0 comments on commit f2a4755

Please sign in to comment.