]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Remove lra_in_progress check for ARG_POINTER_REGNUM
authorhjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 30 Oct 2012 22:56:52 +0000 (22:56 +0000)
committerhjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 30 Oct 2012 22:56:52 +0000 (22:56 +0000)
gcc/

PR rtl-optimization/55093
* rtlanal.c (simplify_subreg_regno): Remove lra_in_progress
check for ARG_POINTER_REGNUM.

gcc/testsuite/

PR rtl-optimization/55093
* gcc.target/i386/pr55093.c: New file.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@193000 138bc75d-0d04-0410-961f-82ee72b054a4

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

index 80c968c349b3b23ca335784261e7a724e60c7604..d4622cc06ad7e827ab688007e947e7c8c7241658 100644 (file)
@@ -1,3 +1,9 @@
+2012-10-30  H.J. Lu  <hongjiu.lu@intel.com>
+
+       PR rtl-optimization/55093
+       * rtlanal.c (simplify_subreg_regno): Remove lra_in_progress
+       check for ARG_POINTER_REGNUM.
+
 2012-10-30  Steve Ellcey  <sellcey@mips.com>
 
        * config/mips/mti-linux.h (SYSROOT_SUFFIX_SPEC): Change order
index 43d4cb829bd835c57a7f0d824d504ddd02827b20..33be5487386889da2993245da8e77a12c9fa2014 100644 (file)
@@ -3494,10 +3494,7 @@ simplify_subreg_regno (unsigned int xregno, enum machine_mode xmode,
     return -1;
 
   if (FRAME_POINTER_REGNUM != ARG_POINTER_REGNUM
-      /* We should convert arg register in LRA after the elimination
-        if it is possible.  */
-      && xregno == ARG_POINTER_REGNUM
-      && ! lra_in_progress)
+      && xregno == ARG_POINTER_REGNUM)
     return -1;
 
   if (xregno == STACK_POINTER_REGNUM
index b6dd6fc85c5634dcb241915d3a44565fe7bf890a..f984aa6b584a275a3b5a2c4d651681da481402d8 100644 (file)
@@ -1,3 +1,8 @@
+2012-10-30  H.J. Lu  <hongjiu.lu@intel.com>
+
+       PR rtl-optimization/55093
+       * gcc.target/i386/pr55093.c: New file.
+
 2012-10-30  H.J. Lu  <hongjiu.lu@intel.com>
 
        * gcc.target/i386/pr55116.c: Renamed to ...
diff --git a/gcc/testsuite/gcc.target/i386/pr55093.c b/gcc/testsuite/gcc.target/i386/pr55093.c
new file mode 100644 (file)
index 0000000..76b4042
--- /dev/null
@@ -0,0 +1,80 @@
+/* { dg-do compile { target { ! { ia32 } } } } */
+/* { dg-options "-O2 -mx32 -maddress-mode=long" } */
+
+typedef union tree_node *tree;
+typedef const union tree_node *const_tree;
+typedef struct {
+  unsigned long long low;
+  long long high;
+} double_int;
+struct real_value {
+};
+struct real_format {
+  int has_signed_zero;
+};
+extern const struct real_format *   real_format_for_mode[];
+extern int real_isnegzero (const struct real_value *);
+enum tree_code { REAL_CST, SSA_NAME };
+struct tree_base {
+  enum tree_code code : 16;
+  union {
+    unsigned int version;
+  }
+  u;
+};
+extern void tree_check_failed (const_tree, const char *, int, const char *,           ...) __attribute__ ((__noreturn__));
+union tree_node {
+  struct tree_base base;
+};
+inline tree tree_check (tree __t, const char *__f, int __l, const char *__g, enum tree_code __c) {
+  if (((enum tree_code) (__t)->base.code) != __c)
+    tree_check_failed (__t, __f, __l, __g, __c, 0);
+  return __t;
+}
+struct prop_value_d {
+  int lattice_val;
+  tree value;
+  double_int mask;
+};
+typedef struct prop_value_d prop_value_t;
+static prop_value_t *const_val;
+static void canonicalize_float_value (prop_value_t *);
+typedef void (*ssa_prop_visit_stmt_fn) (prop_value_t);
+typedef void (*ssa_prop_visit_phi_fn) (void);
+typedef void (*ssa_prop_fold_stmt_fn) (void *gsi);
+typedef void (*ssa_prop_get_value_fn) ( prop_value_t *val);
+void ssa_propagate (ssa_prop_visit_stmt_fn, ssa_prop_visit_phi_fn);
+int substitute_and_fold (ssa_prop_get_value_fn, ssa_prop_fold_stmt_fn);
+void ccp_fold_stmt (void *);
+static void get_constant_value (prop_value_t *val) {
+  canonicalize_float_value (val);
+}
+static void canonicalize_float_value (prop_value_t *val) {
+  int mode;
+  struct real_value d;
+  if (val->lattice_val != 1
+      || ((enum tree_code) (val->value)->base.code) != REAL_CST)
+    return;
+  mode = val->lattice_val;
+  if (real_format_for_mode[mode]->has_signed_zero && real_isnegzero (&d))
+    ccp_fold_stmt (0);
+}
+static void set_lattice_value (tree var, prop_value_t new_val) {
+  prop_value_t *old_val = &const_val[(tree_check ((var), "",
+                                                 0, "",
+                                                 (SSA_NAME)))->base.u.version];
+  canonicalize_float_value (&new_val);
+  canonicalize_float_value (old_val);
+}
+static void ccp_visit_phi_node (void) {
+  prop_value_t new_val;
+  set_lattice_value (0, new_val);
+}
+static void ccp_visit_stmt (prop_value_t v) {
+  set_lattice_value (0, v);
+}
+unsigned int do_ssa_ccp (void) {
+  ssa_propagate (ccp_visit_stmt, ccp_visit_phi_node);
+  substitute_and_fold (get_constant_value, ccp_fold_stmt);
+  return 0;
+}