Commit 877fb450 by H.J. Lu

Disallow negative constant address for x32

gcc/

2012-02-10  Uros Bizjak  <ubizjak@gmail.com>

	PR target/52146
	* config/i386/i386.c (ix86_legitimate_address_p): Disallow
	negative constant address for x32.

gcc/testsuite/

2012-02-10  H.J. Lu  <hongjiu.lu@intel.com>

	PR target/52146
	* gcc.target/i386/pr52146.c: New.

From-SVN: r184111
parent 75cee7c6
2012-02-10 Uros Bizjak <ubizjak@gmail.com>
PR target/52146
* config/i386/i386.c (ix86_legitimate_address_p): Disallow
negative constant address for x32.
2012-02-10 Richard Henderson <rth@redhat.com> 2012-02-10 Richard Henderson <rth@redhat.com>
* tree-ssa-dce.c (propagate_necessity): Handle GIMPLE_TRANSACTION. * tree-ssa-dce.c (propagate_necessity): Handle GIMPLE_TRANSACTION.
......
...@@ -11932,6 +11932,13 @@ ix86_legitimate_address_p (enum machine_mode mode ATTRIBUTE_UNUSED, ...@@ -11932,6 +11932,13 @@ ix86_legitimate_address_p (enum machine_mode mode ATTRIBUTE_UNUSED,
rtx base, index, disp; rtx base, index, disp;
HOST_WIDE_INT scale; HOST_WIDE_INT scale;
/* Since constant address in x32 is signed extended to 64bit,
we have to prevent addresses from 0x80000000 to 0xffffffff. */
if (TARGET_X32
&& CONST_INT_P (addr)
&& INTVAL (addr) < 0)
return false;
if (ix86_decompose_address (addr, &parts) <= 0) if (ix86_decompose_address (addr, &parts) <= 0)
/* Decomposition failed. */ /* Decomposition failed. */
return false; return false;
2012-02-10 H.J. Lu <hongjiu.lu@intel.com>
PR target/52146
* gcc.target/i386/pr52146.c: New.
2012-02-10 Jakub Jelinek <jakub@redhat.com> 2012-02-10 Jakub Jelinek <jakub@redhat.com>
PR middle-end/52177 PR middle-end/52177
......
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