[Bug rtl-optimization/68330] [6 Regression]: FAIL: gcc.target/alpha/pr42269-1.c scan-assembler-not addl on alpha-linux-gnu

2015-11-18 Thread ubizjak at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68330

Uroš Bizjak  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--- Comment #5 from Uroš Bizjak  ---
Fixed.

[Bug rtl-optimization/68330] [6 Regression]: FAIL: gcc.target/alpha/pr42269-1.c scan-assembler-not addl on alpha-linux-gnu

2015-11-16 Thread segher at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68330

--- Comment #4 from Segher Boessenkool  ---
Author: segher
Date: Mon Nov 16 15:51:33 2015
New Revision: 230429

URL: https://gcc.gnu.org/viewcvs?rev=230429=gcc=rev
Log:
simplify-rtx: Simplify sign_extend of lshiftrt to zero_extend (PR68330)

Since r230164, in PR68330 combine ends up with a sign_extend of an
lshiftrt by some constant, and it does not know to morph that into a
zero_extract (the extend will always extend with zeroes).  I think
it is best to let simplify-rtx always replace such a sign_extend by
a zero_extend, after which everything works as expected.


2015-11-15  Segher Boessenkool  

PR rtl-optimization/68330
* simplify-rtx.c (simplify_unary_operation_1): Simplify SIGN_EXTEND
of LSHIFTRT by a non-zero constant integer.

Modified:
trunk/gcc/ChangeLog
trunk/gcc/simplify-rtx.c

[Bug rtl-optimization/68330] [6 Regression]: FAIL: gcc.target/alpha/pr42269-1.c scan-assembler-not addl on alpha-linux-gnu

2015-11-13 Thread ubizjak at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68330

Uroš Bizjak  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEW
   Last reconfirmed||2015-11-13
 CC||segher at gcc dot gnu.org
   Target Milestone|--- |6.0
 Ever confirmed|0   |1

[Bug rtl-optimization/68330] [6 Regression]: FAIL: gcc.target/alpha/pr42269-1.c scan-assembler-not addl on alpha-linux-gnu

2015-11-13 Thread segher at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68330

Segher Boessenkool  changed:

   What|Removed |Added

   Assignee|unassigned at gcc dot gnu.org  |segher at gcc dot 
gnu.org

--- Comment #2 from Segher Boessenkool  ---
Hrm, I don't think your analysis is entirely correct yet -- you say
with the old compiler insn 19 is removed, but that sets reg 73 which
is still used in insn 20.

Anyway, mine, I'll figure it out.

[Bug rtl-optimization/68330] [6 Regression]: FAIL: gcc.target/alpha/pr42269-1.c scan-assembler-not addl on alpha-linux-gnu

2015-11-13 Thread ubizjak at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68330

--- Comment #1 from Uroš Bizjak  ---
(In reply to Uroš Bizjak from comment #0)
> Revision r230164 [1] regressed:
> 
> FAIL: gcc.target/alpha/pr42269-1.c scan-assembler-not addl
> 
> on alpha-linux-gnu.
> 
> The difference starts in combine, where before the patch, we were able
> to combine insns:

Please scrap this, the correct analysis is below.

We start with following sequence:

(insn 19 18 20 2 (set (reg/v:DI 73 [ x ])
(sign_extend:DI (subreg:SI (reg:DI 90) 0))) pr42269.c:9 2
{*extendsidi2_1}
 (expr_list:REG_DEAD (reg:DI 90)
(nil)))
(insn 20 19 21 2 (set (reg:DI 91 [ x ])
(zero_extend:DI (subreg/s/u:SI (reg/v:DI 73 [ x ]) 0))) pr42269.c:10 48
{zero_extendsidi2}
 (nil))

where before the referred patch, combine pass removes (insn 19), leaving only:

(insn 20 19 21 2 (set (reg:DI 91 [ x ])
(zero_extend:DI (subreg/s/u:SI (reg/v:DI 73 [ x ]) 0))) pr42269.c:10 48
{zero_extendsidi2}
 (nil))
(note 21 20 22 2 NOTE_INSN_DELETED)

With the patched gcc, we still have:

(insn 19 18 20 2 (set (reg/v:DI 73 [ x ])
(sign_extend:DI (subreg:SI (reg:DI 90) 0))) pr42269-fail.c:9 2
{*extendsidi2_1}
 (expr_list:REG_DEAD (reg:DI 90)
(nil)))
(insn 20 19 21 2 (set (reg:DI 91 [ x ])
(zero_extend:DI (subreg/s/u:SI (reg/v:DI 73 [ x ]) 0)))
pr42269-fail.c:10 48 {zero_extendsidi2}
 (nil))

Please note that (insn 19) above is redundant.

BTW: I wonder if combine pass is the correct place to perform this optimization
(please see PR 42269), we have ree pass that should remove redundant
extensions.

[Bug rtl-optimization/68330] [6 Regression]: FAIL: gcc.target/alpha/pr42269-1.c scan-assembler-not addl on alpha-linux-gnu

2015-11-13 Thread ubizjak at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68330

--- Comment #3 from Uroš Bizjak  ---
(In reply to Segher Boessenkool from comment #2)
> Hrm, I don't think your analysis is entirely correct yet -- you say
> with the old compiler insn 19 is removed, but that sets reg 73 which
> is still used in insn 20.

For some reason, the transformation slightly mixes insn numbers:

(note 18 15 19 2 NOTE_INSN_DELETED)
(insn 19 18 20 2 (set (reg/v:DI 73 [ x ])
(xor:DI (reg/v:DI 71 [ x ])
(reg:DI 72 [ _4 ]))) pr42269.c:9 58 {xordi3}
 (expr_list:REG_DEAD (reg/v:DI 71 [ x ])
(expr_list:REG_DEAD (reg:DI 72 [ _4 ])
(nil
(insn 20 19 21 2 (set (reg:DI 91 [ x ])
(zero_extend:DI (subreg/s/u:SI (reg/v:DI 73 [ x ]) 0))) pr42269.c:10 48
{zero_extendsidi2}
 (nil))