[Bug target/85993] config/sh/sh.c:10878: suspicious if .. else chain

2019-09-28 Thread olegendo at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85993

--- Comment #7 from Oleg Endo  ---
Author: olegendo
Date: Sat Sep 28 07:29:06 2019
New Revision: 276239

URL: https://gcc.gnu.org/viewcvs?rev=276239=gcc=rev
Log:
gcc/
2019-09-28  Oleg Endo  

Backport from mainline
2018-07-15  Jeff Law  

PR target/85993
* config/sh/sh.c (output_mi_thunk): Remove dead conditional
block.


Modified:
branches/gcc-7-branch/gcc/ChangeLog
branches/gcc-7-branch/gcc/config/sh/sh.c

[Bug target/85993] config/sh/sh.c:10878: suspicious if .. else chain

2019-09-28 Thread olegendo at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85993

--- Comment #6 from Oleg Endo  ---
Author: olegendo
Date: Sat Sep 28 07:23:10 2019
New Revision: 276237

URL: https://gcc.gnu.org/viewcvs?rev=276237=gcc=rev
Log:
gcc/
2018-09-28  Oleg Endo  

Backport from mainline
2018-07-15  Jeff Law  

PR target/85993
* config/sh/sh.c (output_mi_thunk): Remove dead conditional
block.


Modified:
branches/gcc-8-branch/gcc/ChangeLog
branches/gcc-8-branch/gcc/config/sh/sh.c

[Bug target/85993] config/sh/sh.c:10878: suspicious if .. else chain

2018-07-15 Thread law at redhat dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85993

Jeffrey A. Law  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||law at redhat dot com
 Resolution|--- |FIXED

--- Comment #5 from Jeffrey A. Law  ---
Fixed on the trunk.

[Bug target/85993] config/sh/sh.c:10878: suspicious if .. else chain

2018-07-15 Thread law at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85993

--- Comment #4 from Jeffrey A. Law  ---
Author: law
Date: Sun Jul 15 20:28:15 2018
New Revision: 262671

URL: https://gcc.gnu.org/viewcvs?rev=262671=gcc=rev
Log:
PR target/85993
* config/sh/sh.c (output_mi_thunk): Remove dead conditional
block.

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

[Bug target/85993] config/sh/sh.c:10878: suspicious if .. else chain

2018-05-31 Thread olegendo at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85993

Oleg Endo  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2018-05-31
 Ever confirmed|0   |1

--- Comment #3 from Oleg Endo  ---
(In reply to David Binderman from comment #0)
> config/sh/sh.c:10878:12: warning: duplicated ‘if’ condition
> [-Wduplicated-cond]
> 
> Source code is
> 
>  else if (scratch0 != scratch1)
> {
>   emit_move_insn (scratch1, GEN_INT (vcall_offset));
>   emit_insn (gen_add2_insn (scratch0, scratch1));
>   offset_addr = scratch0;
> }
> 
> but earlier is code
> 
>  else if (scratch0 != scratch1)
> {
>   /* scratch0 != scratch1, and we have indexed loads.  Get better
>  schedule by loading the offset into r1 and using an indexed
>  load - then the load of r1 can issue before the load from
>  (this_rtx + delta) finishes.  */
>   emit_move_insn (scratch1, GEN_INT (vcall_offset));
>   offset_addr = gen_rtx_PLUS (Pmode, scratch0, scratch1);
> }
> 
> Interestingly, the two blocks of code in the ifs aren't the same.

The line 10864 used to be:

  else if (! TARGET_SH5 && scratch0 != scratch1)

and I chopped it off to be 

  else if (scratch0 != scratch1)

when removing support for SH5.  I haven't noticed that the 2nd else if block
became unreachable.  It can be removed.

[Bug target/85993] config/sh/sh.c:10878: suspicious if .. else chain

2018-05-30 Thread amylaar at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85993

Jorn Wolfgang Rennecke  changed:

   What|Removed |Added

 CC||olegendo at gcc dot gnu.org

--- Comment #2 from Jorn Wolfgang Rennecke  ---
(In reply to David Binderman from comment #0)
> config/sh/sh.c:10878:12: warning: duplicated ‘if’ condition
> [-Wduplicated-cond]
> 
> Source code is
> 
>  else if (scratch0 != scratch1)
> {
>   emit_move_insn (scratch1, GEN_INT (vcall_offset));
>   emit_insn (gen_add2_insn (scratch0, scratch1));
>   offset_addr = scratch0;
> }
> 
> but earlier is code
> 
>  else if (scratch0 != scratch1)
> {
>   /* scratch0 != scratch1, and we have indexed loads.  Get better
>  schedule by loading the offset into r1 and using an indexed
>  load - then the load of r1 can issue before the load from
>  (this_rtx + delta) finishes.  */
>   emit_move_insn (scratch1, GEN_INT (vcall_offset));
>   offset_addr = gen_rtx_PLUS (Pmode, scratch0, scratch1);
> }

The condition for this block used to be:
  else if (! TARGET_SH5 && scratch0 != scratch1)
because the SH5 SHcompact indexed addressing doesn't actually work
the way GCC expects indexed addressing to work.

Thus, the second block (quoted first) is SH5 code.

[Bug target/85993] config/sh/sh.c:10878: suspicious if .. else chain

2018-05-30 Thread dcb314 at hotmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85993

David Binderman  changed:

   What|Removed |Added

 CC||amylaar at gcc dot gnu.org

--- Comment #1 from David Binderman  ---
svn blame says

 64248amylaar   else if (scratch0 != scratch1)
 64248amylaar   {
 64248amylaar emit_move_insn (scratch1, GEN_INT (vcall_offset));
 64248amylaar emit_insn (gen_add2_insn (scratch0, scratch1));
 64248amylaar offset_addr = scratch0;
 64248amylaar   }

Adding amylaar