From a8a8c61a49297228fbe3c68d4f85cfb903ee0557 Mon Sep 17 00:00:00 2001 From: uros Date: Sun, 17 Nov 2013 23:10:10 +0000 Subject: [PATCH] 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@204925 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 28 ++++++++++++++++------------ gcc/config/i386/i386.c | 22 ++++++---------------- gcc/testsuite/ChangeLog | 22 +++++++++++++--------- gcc/testsuite/gcc.target/i386/pr59153.c | 13 +++++++++++++ 4 files changed, 48 insertions(+), 37 deletions(-) create mode 100644 gcc/testsuite/gcc.target/i386/pr59153.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 87802f84e50..c854ffa01ea 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +2013-11-17 Uros Bizjak + + 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 * config/rs6000/rs6000.c (rs6000_frame_related): Add split_reg @@ -9,8 +18,8 @@ 2013-11-17 Andrew MacLeod - * 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. @@ -94,8 +102,7 @@ (*altivec_vperm__internal): Remove. (altivec_vperm__uns): Revert earlier little endian change. (*altivec_vperm__uns_internal): Remove. - * config/rs6000/vector.md (vec_realign_load_): Revise - commentary. + * config/rs6000/vector.md (vec_realign_load_): Revise commentary. 2013-11-15 Jeff Law @@ -117,8 +124,7 @@ 2013-11-15 James Greenhalgh - * 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. @@ -150,8 +156,7 @@ (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 @@ -165,8 +170,7 @@ 2013-11-15 Joseph Myers - * 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, diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index d581b969b0b..f7e28a570bd 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -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. */ diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index c58adf9e0dc..564ecf065cf 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2013-11-17 Uros Bizjak + + PR target/59153 + * gcc.target/i386/pr59153.c: New test. + 2013-11-17 Paolo Carlini PR c++/59123 @@ -125,7 +130,7 @@ 2013-11-14 Richard Biener * gcc.dg/tree-ssa/ssa-vrp-thread-1.c: Fix target selector. - + 2013-11-14 H.J. Lu * gnat.dg/specs/addr1.ads: XFAIL on x32. @@ -166,7 +171,7 @@ PR tree-optimization/59102 * gcc.c-torture/compile/pr59102.c: New test. - + 2013-11-13 Tom de Vries * gcc.dg/tail-merge-store.c: New test. @@ -250,8 +255,7 @@ 2013-11-12 Joseph Myers * 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. @@ -277,7 +281,7 @@ PR c++/57734 * g++.dg/cpp0x/alias-decl-enum-1.C: New. -2013-11-11 Martin Liska +2013-11-11 Martin Liska * gcc.dg/time-profiler-1.c: New test. * gcc.dg/time-profiler-2.c: Ditto. @@ -397,10 +401,10 @@ * 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 diff --git a/gcc/testsuite/gcc.target/i386/pr59153.c b/gcc/testsuite/gcc.target/i386/pr59153.c new file mode 100644 index 00000000000..262726a9453 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr59153.c @@ -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; +} -- 2.11.4.GIT