Commit 992103ad by Uros Bizjak

re PR rtl-optimization/54457 ([x32] Fail to combine 64bit index + constant)

        PR rtl-optimization/54457
        * simplify-rtx.c (simplify_subreg):
	Simplify (subreg:M (op:N ((x:N) (y:N)), 0)
     	to (op:M (subreg:M (x:N) 0) (subreg:M (x:N) 0)), where
	the outer subreg is effectively a truncation to the original mode M.

testsuite/ChangeLog:

        PR rtl-optimization/54457
        * gcc.target/i386/pr54457.c: New test.

From-SVN: r191928
parent 4f395642
2012-10-01 Uros Bizjak <ubizjak@gmail.com>
PR rtl-optimization/54457
* simplify-rtx.c (simplify_subreg):
Simplify (subreg:M (op:N ((x:N) (y:N)), 0)
to (op:M (subreg:M (x:N) 0) (subreg:M (x:N) 0)), where
the outer subreg is effectively a truncation to the original mode M.
2012-10-01 Richard Guenther <rguenther@suse.de> 2012-10-01 Richard Guenther <rguenther@suse.de>
* builtins.def (ATTR_MATHFN_FPROUNDING): Do not use no-vops * builtins.def (ATTR_MATHFN_FPROUNDING): Do not use no-vops
...@@ -299,7 +307,8 @@ ...@@ -299,7 +307,8 @@
Undo r185605 (mostly): Undo r185605 (mostly):
* config/avr/avr-protos.h (avr_load_lpm): Remove. * config/avr/avr-protos.h (avr_load_lpm): Remove.
* config/avr/avr.c (avr_load_libgcc_p): Don't restrict to __flash loads. * config/avr/avr.c (avr_load_libgcc_p): Don't restrict to __flash
loads.
(avr_out_lpm): Also handle loads > 1 byte. (avr_out_lpm): Also handle loads > 1 byte.
(avr_load_lpm): Remove. (avr_load_lpm): Remove.
(avr_find_unused_d_reg): New static function. (avr_find_unused_d_reg): New static function.
...@@ -367,8 +376,7 @@ ...@@ -367,8 +376,7 @@
PR target/54703 PR target/54703
* simplify-rtx.c (simplify_binary_operation_1): Perform * simplify-rtx.c (simplify_binary_operation_1): Perform
(x - (x & y)) -> (x & ~y) optimization only for integral (x - (x & y)) -> (x & ~y) optimization only for integral modes.
modes.
2012-09-27 Marc Glisse <marc.glisse@inria.fr> 2012-09-27 Marc Glisse <marc.glisse@inria.fr>
...@@ -527,7 +535,7 @@ ...@@ -527,7 +535,7 @@
PR target/54641 PR target/54641
* config/avr/t-avr: Use ALL_COMPILERFLAGS instead of ALL_CFLAGS * config/avr/t-avr: Use ALL_COMPILERFLAGS instead of ALL_CFLAGS
for sources compiled with COMPILER. for sources compiled with COMPILER.
2012-09-25 Richard Guenther <rguenther@suse.de> 2012-09-25 Richard Guenther <rguenther@suse.de>
PR lto/54625 PR lto/54625
...@@ -541,8 +549,7 @@ ...@@ -541,8 +549,7 @@
one bit precision properly. one bit precision properly.
PR other/54692 PR other/54692
* configure.ac (CFLAGS, CXXFLAGS): Remove -Ofast or -Og * configure.ac (CFLAGS, CXXFLAGS): Remove -Ofast or -Og properly.
properly.
* configure: Regenerated. * configure: Regenerated.
2012-09-25 Georg-Johann Lay <avr@gjlay.de> 2012-09-25 Georg-Johann Lay <avr@gjlay.de>
...@@ -564,8 +571,7 @@ ...@@ -564,8 +571,7 @@
2012-09-24 Dehao Chen <dehao@google.com> 2012-09-24 Dehao Chen <dehao@google.com>
* tree-cfg.c (move_stmt_op): Reset the expr block only * tree-cfg.c (move_stmt_op): Reset the expr block only when necessary.
when necessary.
(move_block_to_fn): Reset the edge's goto block even (move_block_to_fn): Reset the edge's goto block even
when the goto locus is unknown. when the goto locus is unknown.
...@@ -672,7 +678,7 @@ ...@@ -672,7 +678,7 @@
2012-09-24 Janis Johnson <janisjo@codesourcery.com> 2012-09-24 Janis Johnson <janisjo@codesourcery.com>
doc/sourcebuild.texi (Selectors): Document the use of target * doc/sourcebuild.texi (Selectors): Document the use of target
and xfail used together. and xfail used together.
2012-09-24 Richard Guenther <rguenther@suse.de> 2012-09-24 Richard Guenther <rguenther@suse.de>
......
...@@ -5724,6 +5724,28 @@ simplify_subreg (enum machine_mode outermode, rtx op, ...@@ -5724,6 +5724,28 @@ simplify_subreg (enum machine_mode outermode, rtx op,
return CONST0_RTX (outermode); return CONST0_RTX (outermode);
} }
/* Simplify (subreg:SI (op:DI ((x:DI) (y:DI)), 0)
to (op:SI (subreg:SI (x:DI) 0) (subreg:SI (x:DI) 0)), where
the outer subreg is effectively a truncation to the original mode. */
if ((GET_CODE (op) == PLUS
|| GET_CODE (op) == MINUS
|| GET_CODE (op) == MULT)
&& SCALAR_INT_MODE_P (outermode)
&& SCALAR_INT_MODE_P (innermode)
&& GET_MODE_PRECISION (outermode) < GET_MODE_PRECISION (innermode)
&& byte == subreg_lowpart_offset (outermode, innermode))
{
rtx op0 = simplify_gen_subreg (outermode, XEXP (op, 0),
innermode, byte);
if (op0)
{
rtx op1 = simplify_gen_subreg (outermode, XEXP (op, 1),
innermode, byte);
if (op1)
return simplify_gen_binary (GET_CODE (op), outermode, op0, op1);
}
}
/* Simplify (subreg:QI (lshiftrt:SI (sign_extend:SI (x:QI)) C), 0) into /* Simplify (subreg:QI (lshiftrt:SI (sign_extend:SI (x:QI)) C), 0) into
to (ashiftrt:QI (x:QI) C), where C is a suitable small constant and to (ashiftrt:QI (x:QI) C), where C is a suitable small constant and
the outer subreg is effectively a truncation to the original mode. */ the outer subreg is effectively a truncation to the original mode. */
......
2012-10-01 Uros Bizjak <ubizjak@gmail.com>
PR rtl-optimization/54457
* gcc.target/i386/pr54457.c: New test.
2012-10-01 Ulrich Weigand <ulrich.weigand@linaro.org> 2012-10-01 Ulrich Weigand <ulrich.weigand@linaro.org>
* gcc.dg/lower-subreg-1.c: Disable on arm*-*-* targets. * gcc.dg/lower-subreg-1.c: Disable on arm*-*-* targets.
......
/* { dg-do compile { target { ! { ia32 } } } } */
/* { dg-options "-O2 -mx32 -maddress-mode=short" } */
extern char array[40];
char foo (long long position)
{
return array[position + 1];
}
/* { dg-final { scan-assembler-not "add\[lq\]?\[^\n\]*1" } } */
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