re PR target/59153 (ICE: in memory_address_length, at config/i386/i386.c:24617 with...
authorUros Bizjak <uros@gcc.gnu.org>
Sun, 17 Nov 2013 23:10:10 +0000 (00:10 +0100)
committerUros Bizjak <uros@gcc.gnu.org>
Sun, 17 Nov 2013 23:10:10 +0000 (00:10 +0100)
PR target/59153
* config/i386/i386.c (ix86_address_subreg_operand): Do not
reject non-integer subregs.
(ix86_decompose_address): Do not reject invalid CONST_INT RTXes.
Move check for invalid x32 constant addresses ...
(ix86_legitimate_address_p): ... here.

testsuite/ChangeLog:

PR target/59153
* gcc.target/i386/pr59153.c: New test.

From-SVN: r204925

gcc/ChangeLog
gcc/config/i386/i386.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/i386/pr59153.c [new file with mode: 0644]

index 87802f8..c854ffa 100644 (file)
@@ -1,3 +1,12 @@
+2013-11-17  Uros Bizjak  <ubizjak@gmail.com>
+
+       PR target/59153
+       * config/i386/i386.c (ix86_address_subreg_operand): Do not
+       reject non-integer subregs.
+       (ix86_decompose_address): Do not reject invalid CONST_INT RTXes.
+       Move check for invalid x32 constant addresses ...
+       (ix86_legitimate_address_p): ... here.
+
 2011-11-17  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>
 
        * config/rs6000/rs6000.c (rs6000_frame_related): Add split_reg
@@ -9,8 +18,8 @@
 
 2013-11-17  Andrew MacLeod  <amacleod@redhat.com>
 
-       * gimple.h: Reorder prototypes to match .c declaration order, and remove
-       protyotypes for functions not in gimple.c.
+       * gimple.h: Reorder prototypes to match .c declaration order, and
+       remove protyotypes for functions not in gimple.c.
        (LABEL): Move to tree-into-ssa.c.
        * gimple.c: Remove unused prototypes.
        (get_base_address): Move to tree.c.
@@ -79,8 +88,7 @@
        (execute_expand_omp): Check flag_enable_cilkplus.
        (execute_lower_omp): Same.
        (diagnose_sb_0): Handle CILK_SIMD.
-       (diagnose_omp_structured_block_errors): Check
-       flag_enable_cilkplus.
+       (diagnose_omp_structured_block_errors): Check flag_enable_cilkplus.
        (setjmp_or_longjmp_p): New.
        (scan_omp_1_stmt): Error on setjmp/longjmp in a simd construct.
        * tree-pretty-print.c (dump_generic_node): Add case for CILK_SIMD.
        (*altivec_vperm_<mode>_internal): Remove.
        (altivec_vperm_<mode>_uns): Revert earlier little endian change.
        (*altivec_vperm_<mode>_uns_internal): Remove.
-       * config/rs6000/vector.md (vec_realign_load_<mode>): Revise
-       commentary.
+       * config/rs6000/vector.md (vec_realign_load_<mode>): Revise commentary.
 
 2013-11-15  Jeff Law  <law@redhat.com>
 
 
 2013-11-15  James Greenhalgh  <james.greenhalgh@arm.com>
 
-       * config/aarch64/aarch64-simd.md: Remove simd_type from all
-       patterns.
+       * config/aarch64/aarch64-simd.md: Remove simd_type from all patterns.
        * config/aarch64/aarch64.md: Likewise, correct "type" attribute
        where it is incorrect or missing.
 
        (compute_points_to_sets): Remove heap variable globalization.
        (ipa_escaped_pt): Adjust initializer.
        (pass_data_ipa_pta): Do not run TODO_update_ssa.
-       * gimple-pretty-print.c (pp_points_to_solution): Print split
-       flags.
+       * gimple-pretty-print.c (pp_points_to_solution): Print split flags.
        * tree-ssa-alias.c (dump_points_to_solution): Likewise.
 
 2013-11-15  Richard Biener  <rguenther@suse.de>
 
 2013-11-15  Joseph Myers  <joseph@codesourcery.com>
 
-       * acinclude.m4 (GCC_GLIBC_VERSION_GTE_IFELSE): New configure
-       macro.
+       * acinclude.m4 (GCC_GLIBC_VERSION_GTE_IFELSE): New configure macro.
        * configure.ac: Determine target_header_dir earlier.
        (--with-glibc-version): New configure option.
        Use GCC_GLIBC_VERSION_GTE_IFELSE in enable_gnu_unique_object,
index d581b96..f7e28a5 100644 (file)
@@ -11785,9 +11785,6 @@ ix86_address_subreg_operand (rtx op)
 
   mode = GET_MODE (op);
 
-  if (GET_MODE_CLASS (mode) != MODE_INT)
-    return false;
-
   /* Don't allow SUBREGs that span more than a word.  It can lead to spill
      failures when the register is one word out of a two word structure.  */
   if (GET_MODE_SIZE (mode) > UNITS_PER_WORD)
@@ -11962,19 +11959,6 @@ ix86_decompose_address (rtx addr, struct ix86_address *out)
       scale = 1 << scale;
       retval = -1;
     }
-  else if (CONST_INT_P (addr))
-    {
-      if (!x86_64_immediate_operand (addr, VOIDmode))
-       return 0;
-
-      /* Constant addresses are sign extended to 64bit, we have to
-        prevent addresses from 0x80000000 to 0xffffffff in x32 mode.  */
-      if (TARGET_X32
-         && val_signbit_known_set_p (SImode, INTVAL (addr)))
-       return 0;
-
-      disp = addr;
-    }
   else
     disp = addr;                       /* displacement */
 
@@ -12706,6 +12690,12 @@ ix86_legitimate_address_p (enum machine_mode mode ATTRIBUTE_UNUSED,
               && !x86_64_immediate_operand (disp, VOIDmode))
        /* Displacement is out of range.  */
        return false;
+      /* In x32 mode, constant addresses are sign extended to 64bit, so
+        we have to prevent addresses from 0x80000000 to 0xffffffff.  */
+      else if (TARGET_X32 && !(index || base)
+              && CONST_INT_P (disp)
+              && val_signbit_known_set_p (SImode, INTVAL (disp)))
+       return false;
     }
 
   /* Everything looks valid.  */
index c58adf9..564ecf0 100644 (file)
@@ -1,3 +1,8 @@
+2013-11-17  Uros Bizjak  <ubizjak@gmail.com>
+
+       PR target/59153
+       * gcc.target/i386/pr59153.c: New test.
+
 2013-11-17  Paolo Carlini  <paolo.carlini@oracle.com>
 
        PR c++/59123
 2013-11-14  Richard Biener  <rguenther@suse.de>
 
        * gcc.dg/tree-ssa/ssa-vrp-thread-1.c: Fix target selector.
+
 2013-11-14  H.J. Lu  <hongjiu.lu@intel.com>
 
        * gnat.dg/specs/addr1.ads: XFAIL on x32.
 
        PR tree-optimization/59102
        * gcc.c-torture/compile/pr59102.c: New test.
-        
+
 2013-11-13  Tom de Vries  <tom@codesourcery.com>
 
        * gcc.dg/tail-merge-store.c: New test.
 2013-11-12  Joseph Myers  <joseph@codesourcery.com>
 
        * gcc.dg/c90-thread-local-1.c, gcc.dg/c99-thread-local-1.c,
-       gcc.dg/c11-thread-local-1.c, gcc.dg/c11-thread-local-2.c: New
-       tests.
+       gcc.dg/c11-thread-local-1.c, gcc.dg/c11-thread-local-2.c: New tests.
        * gcc.dg/tls/diag-2.c, objc.dg/tls/diag-2.m: Update expected
        diagnostics.
 
        PR c++/57734
        * g++.dg/cpp0x/alias-decl-enum-1.C: New.
 
-2013-11-11  Martin Liska       <marxin.liska@gmail.com>
+2013-11-11  Martin Liska  <marxin.liska@gmail.com>
 
        * gcc.dg/time-profiler-1.c: New test.
        * gcc.dg/time-profiler-2.c: Ditto.
 
        * gcc.dg/tree-ssa/loop-39.c: New test.
 
-        * gcc.dg/unroll_1.c: Add -fno-tree-vrp to dg-options.
-        * gcc.dg/unroll_2.c: Likewise.
-        * gcc.dg/unroll_3.c: Likewise.
-        * gcc.dg/unroll_4.c: Likewise.
+       * gcc.dg/unroll_1.c: Add -fno-tree-vrp to dg-options.
+       * gcc.dg/unroll_2.c: Likewise.
+       * gcc.dg/unroll_3.c: Likewise.
+       * gcc.dg/unroll_4.c: Likewise.
        * gcc.dg/vrp90.c: New test.
 
 2013-11-07  Paolo Carlini  <paolo.carlini@oracle.com>
diff --git a/gcc/testsuite/gcc.target/i386/pr59153.c b/gcc/testsuite/gcc.target/i386/pr59153.c
new file mode 100644 (file)
index 0000000..262726a
--- /dev/null
@@ -0,0 +1,13 @@
+/* { dg-do compile } */
+/* { dg-options "-O -flive-range-shrinkage -mdispatch-scheduler -march=bdver1" } */
+
+int foo (float f)
+{
+  union
+  {
+    float f;
+    int i;
+  } z = { .f = f };
+
+  return z.i - 1;
+}