[Bug target/65979] [4.9/5/6 Regression] [SH] Wrong code is generated with stage1 compiler

2015-05-26 Thread olegendo at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65979

--- Comment #29 from Oleg Endo olegendo at gcc dot gnu.org ---
BTW, there is still one unresolved known problem which can silently generate
wrong code: PR 56451
Although the testsuite FAIL might have disappeared, the issue hasn't been
actually fixed, as far as I know.  In the worst case, delay slot stuffing can
be disabled with -fno-delayed-branch.


[Bug target/65979] [4.9/5/6 Regression] [SH] Wrong code is generated with stage1 compiler

2015-05-26 Thread kkojima at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65979

--- Comment #30 from Kazumoto Kojima kkojima at gcc dot gnu.org ---
Author: kkojima
Date: Tue May 26 22:32:11 2015
New Revision: 223721

URL: https://gcc.gnu.org/viewcvs?rev=223721root=gccview=rev
Log:
PR target/65979
* config/sh/sh.md (tstsi_t peephole2): Use gen_rtx_SET and take into
  account the case that operands[1] and operands[2] are the same register.


Modified:
trunk/gcc/ChangeLog
trunk/gcc/config/sh/sh.md


[Bug target/65979] [4.9/5/6 Regression] [SH] Wrong code is generated with stage1 compiler

2015-05-26 Thread kkojima at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65979

--- Comment #31 from Kazumoto Kojima kkojima at gcc dot gnu.org ---
Author: kkojima
Date: Tue May 26 22:37:06 2015
New Revision: 223722

URL: https://gcc.gnu.org/viewcvs?rev=223722root=gccview=rev
Log:
PR target/65979
* config/sh/sh.md (tstsi_t peephole2): Use gen_rtx_SET and take into
  account the case that operands[1] and operands[2] are the same register.


Modified:
branches/gcc-5-branch/gcc/ChangeLog
branches/gcc-5-branch/gcc/config/sh/sh.md


[Bug target/65979] [4.9/5/6 Regression] [SH] Wrong code is generated with stage1 compiler

2015-05-25 Thread glaubitz at physik dot fu-berlin.de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65979

--- Comment #28 from John Paul Adrian Glaubitz glaubitz at physik dot 
fu-berlin.de ---
 It doesn't bootstrap because the D compiler fails the compare test. This
 happens both on gcc-4.8 and gcc-4.9, here's the excerpt from 4.8 [1]:
 
 Comparing stages 2 and 3
 warning: gcc/cc1objplus-checksum.o differs
 warning: gcc/cc1-checksum.o differs
 warning: gcc/cc1plus-checksum.o differs
 warning: gcc/cc1obj-checksum.o differs
 Bootstrap comparison failure!
 gcc/d/ctfeexpr.dmd.o differs

Hmm, now I'm confused. The comparision actually also failed before but the
build was still successful [1] for gcc_4.8.4-1:

Comparing stages 2 and 3
warning: gcc/cc1objplus-checksum.o differs
warning: gcc/cc1-checksum.o differs
warning: gcc/cc1plus-checksum.o differs
warning: gcc/cc1obj-checksum.o differs
Comparison successful.

For gcc_4.8.4-2, the problem is not ignored [2] and the build therefore fails:

Comparing stages 2 and 3
warning: gcc/cc1objplus-checksum.o differs
warning: gcc/cc1-checksum.o differs
warning: gcc/cc1plus-checksum.o differs
warning: gcc/cc1obj-checksum.o differs
Bootstrap comparison failure!

Interesting. So apparently this is _not_ a regression. Maybe we should split
the comparison failure of stage 2 and stage 3 into a different bug report.

Adrian

 [1] 
 http://buildd.debian-ports.org/status/fetch.php?pkg=gcc-4.8arch=sh4ver=4.8.4-1stamp=1422178262
 [2] 
 http://buildd.debian-ports.org/status/fetch.php?pkg=gcc-4.8arch=sh4ver=4.8.4-2stamp=1432515052


[Bug target/65979] [4.9/5/6 Regression] [SH] Wrong code is generated with stage1 compiler

2015-05-25 Thread glaubitz at physik dot fu-berlin.de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65979

--- Comment #27 from John Paul Adrian Glaubitz glaubitz at physik dot 
fu-berlin.de ---
(In reply to Oleg Endo from comment #25)
 So, if I understand correctly ...
 - 4.9.something doesn't bootstrap because of something unknown

It doesn't bootstrap because the D compiler fails the compare test. This
happens both on gcc-4.8 and gcc-4.9, here's the excerpt from 4.8 [1]:

Comparing stages 2 and 3
warning: gcc/cc1objplus-checksum.o differs
warning: gcc/cc1-checksum.o differs
warning: gcc/cc1plus-checksum.o differs
warning: gcc/cc1obj-checksum.o differs
Bootstrap comparison failure!
gcc/d/ctfeexpr.dmd.o differs

 - 5.something doesn't bootstrap because of c#19
 
 ... right?

Yeah, that seems to be unrelated. Sorry for the confusion. I assumed those were
the same.

 Adrian, which compiler do you use to build the SH native compiler(s)?
 Last time I've tried to do a native GCC 5 build on the SH4 debian box,
 vanilla GCC would not build and I gave up.  Sorry for my impatience.

gcc-4.9.2_10 which is SVN_r218987 (20141220).

  But in any case, I am super happy you guys are fixing this. I will be back
  in Japan in October, so if I have a chance to meet either of you, I owe you
  some beer/sake/wine etc :).
 
 Will trade beer for Mohnkuchen.
 Will trade many other things for an SH4A-X4 8-core board with 2+ GB RAM.

Heh. I could try to talk to Nobuhiro again. Maybe he has some ideas where to
get hold of faster SH4 hardware.

Adrian

 [1] 
 http://buildd.debian-ports.org/status/fetch.php?pkg=gcc-4.8arch=sh4ver=4.8.4-2stamp=1432515052


[Bug target/65979] [4.9/5/6 Regression] [SH] Wrong code is generated with stage1 compiler

2015-05-21 Thread kkojima at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65979

Kazumoto Kojima kkojima at gcc dot gnu.org changed:

   What|Removed |Added

Summary|Multiple issues in  |[4.9/5/6 Regression] [SH]
   |conftest.c prevent build on |Wrong code is generated
   |sh4-linux-gnu   |with stage1 compiler

--- Comment #22 from Kazumoto Kojima kkojima at gcc dot gnu.org ---
(In reply to Oleg Endo from comment #21)

OK, I'll commit your patch when all tests are done.
BTW, I'd like to change the summary of the PR to clarify that this is
a 4.9/5/6 regression.


[Bug target/65979] [4.9/5/6 Regression] [SH] Wrong code is generated with stage1 compiler

2015-05-21 Thread olegendo at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65979

--- Comment #25 from Oleg Endo olegendo at gcc dot gnu.org ---
(In reply to John Paul Adrian Glaubitz from comment #24)
 
 I am partially to be blamed for that. I initially reported the gcc-5 issue
 here, then saw gcc-4.9 failed to build as well and then assumed both were
 the same problem.

So, if I understand correctly ...
- 4.9.something doesn't bootstrap because of something unknown
- 5.something doesn't bootstrap because of c#19

... right?

Adrian, which compiler do you use to build the SH native compiler(s)?
Last time I've tried to do a native GCC 5 build on the SH4 debian box, vanilla
GCC would not build and I gave up.  Sorry for my impatience.

 But in any case, I am super happy you guys are fixing this. I will be back
 in Japan in October, so if I have a chance to meet either of you, I owe you
 some beer/sake/wine etc :).

Will trade beer for Mohnkuchen.
Will trade many other things for an SH4A-X4 8-core board with 2+ GB RAM.


[Bug target/65979] [4.9/5/6 Regression] [SH] Wrong code is generated with stage1 compiler

2015-05-21 Thread glaubitz at physik dot fu-berlin.de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65979

--- Comment #24 from John Paul Adrian Glaubitz glaubitz at physik dot 
fu-berlin.de ---
(In reply to Kazumoto Kojima from comment #23)
 Ouch.  The peephole in problem was added at gcc-5 not at 4.9.  The above
 patch should fix the original conftest.c issue, but debien 4.9-16 problem
 would be an another issue.  Sorry for my confusion.

I am partially to be blamed for that. I initially reported the gcc-5 issue
here, then saw gcc-4.9 failed to build as well and then assumed both were the
same problem.

But in any case, I am super happy you guys are fixing this. I will be back in
Japan in October, so if I have a chance to meet either of you, I owe you some
beer/sake/wine etc :).

Thanks!


[Bug target/65979] [4.9/5/6 Regression] [SH] Wrong code is generated with stage1 compiler

2015-05-21 Thread kkojima at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65979

--- Comment #23 from Kazumoto Kojima kkojima at gcc dot gnu.org ---
Ouch.  The peephole in problem was added at gcc-5 not at 4.9.  The above
patch should fix the original conftest.c issue, but debien 4.9-16 problem
would be an another issue.  Sorry for my confusion.


[Bug target/65979] [4.9/5/6 Regression] [SH] Wrong code is generated with stage1 compiler

2015-05-21 Thread kkojima at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65979

--- Comment #26 from Kazumoto Kojima kkojima at gcc dot gnu.org ---
(In reply to Oleg Endo from comment #25)
 So, if I understand correctly ...
 - 4.9.something doesn't bootstrap because of something unknown
 - 5.something doesn't bootstrap because of c#19
 
 ... right?

You are right.  I've missed the reason of debian 4.9.2-16 bootstrap
failure described in #c6.  It's a stage2/3 comparison failure of
gcc/d/ctfeexpr.dmd.o which means debian adds D lang to FSF GCC tree.
BTW, warnings for cc1*-checksum.o would mean that Adrian's board
enables randomize_va_space feature which I always make it disable
with 'sudo echo 0 /proc/sys/kernel/randomize_va_space' on my GCC
work.  I don't know why/how debian packages D lang together with
the vanilla GCC.  It seems 4.9.2-16 could bootstrap without D lang.