Commit 3e56ed50 by Jakub Jelinek Committed by Jakub Jelinek

re PR rtl-optimization/57568 (wrong code for assignment in conditional at -Os)

	PR target/57568
	* config/i386/i386.md (TARGET_READ_MODIFY_WRITE peepholes): Ensure
	that operands[2] doesn't overlap with operands[0].

	* gcc.c-torture/execute/pr57568.c: New test.

From-SVN: r199870
parent 5beb1657
2013-06-09 Jakub Jelinek <jakub@redhat.com>
PR target/57568
* config/i386/i386.md (TARGET_READ_MODIFY_WRITE peepholes): Ensure
that operands[2] doesn't overlap with operands[0].
2013-06-09 David Edelsohn <dje.gcc@gmail.com> 2013-06-09 David Edelsohn <dje.gcc@gmail.com>
Jan Hubicka <jh@suse.cz> Jan Hubicka <jh@suse.cz>
......
...@@ -16591,6 +16591,7 @@ ...@@ -16591,6 +16591,7 @@
"(TARGET_READ_MODIFY_WRITE || optimize_insn_for_size_p ()) "(TARGET_READ_MODIFY_WRITE || optimize_insn_for_size_p ())
&& peep2_reg_dead_p (4, operands[0]) && peep2_reg_dead_p (4, operands[0])
&& !reg_overlap_mentioned_p (operands[0], operands[1]) && !reg_overlap_mentioned_p (operands[0], operands[1])
&& !reg_overlap_mentioned_p (operands[0], operands[2])
&& (<MODE>mode != QImode && (<MODE>mode != QImode
|| immediate_operand (operands[2], QImode) || immediate_operand (operands[2], QImode)
|| q_regs_operand (operands[2], QImode)) || q_regs_operand (operands[2], QImode))
...@@ -16655,6 +16656,7 @@ ...@@ -16655,6 +16656,7 @@
|| immediate_operand (operands[2], SImode) || immediate_operand (operands[2], SImode)
|| q_regs_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])
&& !reg_overlap_mentioned_p (operands[0], operands[2])
&& ix86_match_ccmode (peep2_next_insn (3), && ix86_match_ccmode (peep2_next_insn (3),
(GET_CODE (operands[3]) == PLUS (GET_CODE (operands[3]) == PLUS
|| GET_CODE (operands[3]) == MINUS) || GET_CODE (operands[3]) == MINUS)
......
2013-06-09 Jakub Jelinek <jakub@redhat.com>
PR target/57568
* gcc.c-torture/execute/pr57568.c: New test.
2013-06-09 Paolo Carlini <paolo.carlini@oracle.com> 2013-06-09 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/37404 PR c++/37404
......
/* PR target/57568 */
extern void abort (void);
int a[6][9] = { }, b = 1, *c = &a[3][5];
int
main ()
{
if (b && (*c = *c + *c))
abort ();
return 0;
}
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