diff options
author | Jakub Jelinek <jakub@redhat.com> | 2012-05-15 17:19:10 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2012-05-15 17:19:10 +0200 |
commit | 64137a35b55d65be8e9c515b7393840550b71aac (patch) | |
tree | 14e9e1948be9eb04afb20dc19f71e139339cd67a | |
parent | d02924ef4968840d16aa5c2e187576e1206d051e (diff) | |
download | gcc-64137a35b55d65be8e9c515b7393840550b71aac.zip gcc-64137a35b55d65be8e9c515b7393840550b71aac.tar.gz gcc-64137a35b55d65be8e9c515b7393840550b71aac.tar.bz2 |
re PR target/53358 (ICE due to TARGET_READ_MODIFY_WRITE peephole2)
PR target/53358
* 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.
From-SVN: r187544
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/config/i386/i386.md | 3 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/pr53358.c | 22 |
4 files changed, 36 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 0854c18..d564c10 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -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. diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md index 01e2421..67281d8 100644 --- a/gcc/config/i386/i386.md +++ b/gcc/config/i386/i386.md @@ -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) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 3294c2a..f9bd64d 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -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 diff --git a/gcc/testsuite/gcc.dg/pr53358.c b/gcc/testsuite/gcc.dg/pr53358.c new file mode 100644 index 0000000..494090a --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr53358.c @@ -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 (); + } +} |