[Bug target/63783] [4.9/5 Regression] [SH] Miscompilation of boolean negation on SH4 using -O2

2014-11-24 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63783 Richard Biener rguenth at gcc dot gnu.org changed: What|Removed |Added Status|NEW |RESOLVED

[Bug target/63783] [4.9/5 Regression] [SH] Miscompilation of boolean negation on SH4 using -O2

2014-11-22 Thread gcc-bugzilla at mkarcher dot dialup.fu-berlin.de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63783 --- Comment #18 from Michael Karcher gcc-bugzilla at mkarcher dot dialup.fu-berlin.de --- As I said, I did not try your patch, but just read the source. The assembly you quoted convinces me that there is no problem in the code actually produced

[Bug target/63783] [4.9/5 Regression] [SH] Miscompilation of boolean negation on SH4 using -O2

2014-11-22 Thread olegendo at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63783 --- Comment #19 from Oleg Endo olegendo at gcc dot gnu.org --- (In reply to Michael Karcher from comment #18) As I said, I did not try your patch, but just read the source. The assembly you quoted convinces me that there is no problem in the

[Bug target/63783] [4.9/5 Regression] [SH] Miscompilation of boolean negation on SH4 using -O2

2014-11-22 Thread gcc-bugzilla at mkarcher dot dialup.fu-berlin.de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63783 --- Comment #20 from Michael Karcher gcc-bugzilla at mkarcher dot dialup.fu-berlin.de --- (In reply to Oleg Endo from comment #19) The or-then-SImode-compare optimization has an adverse effect on the test coverage, it seems. In both cases,

[Bug target/63783] [4.9/5 Regression] [SH] Miscompilation of boolean negation on SH4 using -O2

2014-11-22 Thread olegendo at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63783 --- Comment #21 from Oleg Endo olegendo at gcc dot gnu.org --- (In reply to Michael Karcher from comment #20) Of course. The instructions involving src_reg in make_not_reg_insn dealing with src_reg are completely quoted here: + // On SH we

[Bug target/63783] [4.9/5 Regression] [SH] Miscompilation of boolean negation on SH4 using -O2

2014-11-22 Thread gcc-bugzilla at mkarcher dot dialup.fu-berlin.de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63783 --- Comment #22 from Michael Karcher gcc-bugzilla at mkarcher dot dialup.fu-berlin.de --- OK, in that case I retract my objections and I think the patch is fine. I am sorry for that mistake.

[Bug target/63783] [4.9/5 Regression] [SH] Miscompilation of boolean negation on SH4 using -O2

2014-11-22 Thread olegendo at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63783 --- Comment #23 from Oleg Endo olegendo at gcc dot gnu.org --- Author: olegendo Date: Sat Nov 22 15:50:10 2014 New Revision: 217969 URL: https://gcc.gnu.org/viewcvs?rev=217969root=gccview=rev Log: gcc/ PR target/63783 PR target/51244

[Bug target/63783] [4.9/5 Regression] [SH] Miscompilation of boolean negation on SH4 using -O2

2014-11-22 Thread olegendo at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63783 --- Comment #24 from Oleg Endo olegendo at gcc dot gnu.org --- Author: olegendo Date: Sat Nov 22 16:07:25 2014 New Revision: 217970 URL: https://gcc.gnu.org/viewcvs?rev=217970root=gccview=rev Log: gcc/ Backport from mainline 2014-11-22

[Bug target/63783] [4.9/5 Regression] [SH] Miscompilation of boolean negation on SH4 using -O2

2014-11-21 Thread gcc-bugzilla at mkarcher dot dialup.fu-berlin.de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63783 --- Comment #15 from Michael Karcher gcc-bugzilla at mkarcher dot dialup.fu-berlin.de --- I did not get around to test your proposed patch yet, but it seems like the new logical not operation always compares only the low 32 bit against zero,

[Bug target/63783] [4.9/5 Regression] [SH] Miscompilation of boolean negation on SH4 using -O2

2014-11-21 Thread olegendo at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63783 Oleg Endo olegendo at gcc dot gnu.org changed: What|Removed |Added Attachment #34062|0 |1 is

[Bug target/63783] [4.9/5 Regression] [SH] Miscompilation of boolean negation on SH4 using -O2

2014-11-21 Thread olegendo at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63783 --- Comment #17 from Oleg Endo olegendo at gcc dot gnu.org --- (In reply to Michael Karcher from comment #15) I did not get around to test your proposed patch yet, but it seems like the new logical not operation always compares only the low 32

[Bug target/63783] [4.9/5 Regression] [SH] Miscompilation of boolean negation on SH4 using -O2

2014-11-20 Thread olegendo at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63783 --- Comment #14 from Oleg Endo olegendo at gcc dot gnu.org --- Created attachment 34062 -- https://gcc.gnu.org/bugzilla/attachment.cgi?id=34062action=edit Proposed patch I'm now testing the attached patch.

[Bug target/63783] [4.9/5 Regression] [SH] Miscompilation of boolean negation on SH4 using -O2

2014-11-19 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63783 Richard Biener rguenth at gcc dot gnu.org changed: What|Removed |Added Target Milestone|--- |4.9.3

[Bug target/63783] [4.9/5 Regression] [SH] Miscompilation of boolean negation on SH4 using -O2

2014-11-16 Thread olegendo at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63783 --- Comment #6 from Oleg Endo olegendo at gcc dot gnu.org --- (In reply to Michael Karcher from comment #5) (In reply to Oleg Endo from comment #4) I'm not sure about this. The first hunk of your patch that removes the example in the top

[Bug target/63783] [4.9/5 Regression] [SH] Miscompilation of boolean negation on SH4 using -O2

2014-11-16 Thread gcc-bugzilla at mkarcher dot dialup.fu-berlin.de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63783 --- Comment #7 from Michael Karcher gcc-bugzilla at mkarcher dot dialup.fu-berlin.de --- (In reply to Oleg Endo from comment #6) For the transformation to be valid, you would need a logical not instruction instead of the bitwise not

[Bug target/63783] [4.9/5 Regression] [SH] Miscompilation of boolean negation on SH4 using -O2

2014-11-16 Thread gcc-bugzilla at mkarcher dot dialup.fu-berlin.de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63783 --- Comment #8 from Michael Karcher gcc-bugzilla at mkarcher dot dialup.fu-berlin.de --- Actually, the whole issue got me curious - I will try prepare a different patch along your suggestions and compare the compiler output. If I don't report

[Bug target/63783] [4.9/5 Regression] [SH] Miscompilation of boolean negation on SH4 using -O2

2014-11-16 Thread olegendo at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63783 --- Comment #9 from Oleg Endo olegendo at gcc dot gnu.org --- (In reply to Michael Karcher from comment #8) Actually, the whole issue got me curious - I will try prepare a different patch along your suggestions and compare the compiler output.

[Bug target/63783] [4.9/5 Regression] [SH] Miscompilation of boolean negation on SH4 using -O2

2014-11-16 Thread gcc-bugzilla at mkarcher dot dialup.fu-berlin.de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63783 --- Comment #10 from Michael Karcher gcc-bugzilla at mkarcher dot dialup.fu-berlin.de --- Created attachment 33991 -- https://gcc.gnu.org/bugzilla/attachment.cgi?id=33991action=edit Fix logical negation of registers, SImode only In fact, it

[Bug target/63783] [4.9/5 Regression] [SH] Miscompilation of boolean negation on SH4 using -O2

2014-11-16 Thread gcc-bugzilla at mkarcher dot dialup.fu-berlin.de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63783 --- Comment #11 from Michael Karcher gcc-bugzilla at mkarcher dot dialup.fu-berlin.de --- Putting things straight after trying it out: (In reply to Michael Karcher from comment #7) [...] and this gets (except SH2A with nott) transformed to (by

[Bug target/63783] [4.9/5 Regression] [SH] Miscompilation of boolean negation on SH4 using -O2

2014-11-16 Thread gcc-bugzilla at mkarcher dot dialup.fu-berlin.de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63783 --- Comment #12 from Michael Karcher gcc-bugzilla at mkarcher dot dialup.fu-berlin.de --- Further digging into this showed that there actually is a pass that would merge the two tst r1,r1 instructions - the jump2 pass in cfgclenup.c. The

[Bug target/63783] [4.9/5 Regression] [SH] Miscompilation of boolean negation on SH4 using -O2

2014-11-16 Thread olegendo at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63783 --- Comment #13 from Oleg Endo olegendo at gcc dot gnu.org --- (In reply to Michael Karcher from comment #12) Further digging into this showed that there actually is a pass that would merge the two tst r1,r1 instructions - the jump2 pass in

[Bug target/63783] [4.9/5 Regression] [SH] Miscompilation of boolean negation on SH4 using -O2

2014-11-15 Thread olegendo at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63783 --- Comment #4 from Oleg Endo olegendo at gcc dot gnu.org --- (In reply to Michael Karcher from comment #3) Created attachment 33954 [details] Remove assumption that not is logical negate Indeed the treg combine pass is broken. Thanks to the

[Bug target/63783] [4.9/5 Regression] [SH] Miscompilation of boolean negation on SH4 using -O2

2014-11-15 Thread gcc-bugzilla at mkarcher dot dialup.fu-berlin.de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63783 --- Comment #5 from Michael Karcher gcc-bugzilla at mkarcher dot dialup.fu-berlin.de --- (In reply to Oleg Endo from comment #4) I'm not sure about this. The first hunk of your patch that removes the example in the top comment block should be

[Bug target/63783] [4.9/5 Regression] [SH] Miscompilation of boolean negation on SH4 using -O2

2014-11-12 Thread gcc-bugzilla at mkarcher dot dialup.fu-berlin.de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63783 Michael Karcher gcc-bugzilla at mkarcher dot dialup.fu-berlin.de changed: What|Removed |Added CC|

[Bug target/63783] [4.9/5 Regression] [SH] Miscompilation of boolean negation on SH4 using -O2

2014-11-08 Thread kkojima at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63783 Kazumoto Kojima kkojima at gcc dot gnu.org changed: What|Removed |Added Target||sh*-*-*

[Bug target/63783] [4.9/5 Regression] [SH] Miscompilation of boolean negation on SH4 using -O2

2014-11-08 Thread olegendo at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63783 --- Comment #2 from Oleg Endo olegendo at gcc dot gnu.org --- Thanks for tracing this down. Yes, it looks like a sh_treg_combine bug. I will have a look at it, but probably only in 2 weeks from now.