aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH.J. Lu <hongjiu.lu@intel.com>2011-07-05 15:47:40 +0000
committerH.J. Lu <hjl@gcc.gnu.org>2011-07-05 08:47:40 -0700
commita7adbbcbc3ad385e2b54716ce410c79a42ac5bce (patch)
tree6b97e30e7822188bb3003d4aef4bd4008684cf75
parentcec11ec4142e5d300aa36cbee1b54adefdee7711 (diff)
downloadgcc-a7adbbcbc3ad385e2b54716ce410c79a42ac5bce.zip
gcc-a7adbbcbc3ad385e2b54716ce410c79a42ac5bce.tar.gz
gcc-a7adbbcbc3ad385e2b54716ce410c79a42ac5bce.tar.bz2
Promote the function argument before checking non-legitimate constant.
2011-07-05 H.J. Lu <hongjiu.lu@intel.com> PR middle-end/47715 * calls.c (precompute_register_parameters): Promote the function argument before checking non-legitimate constant. From-SVN: r175864
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/calls.c12
2 files changed, 12 insertions, 6 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 418f5dc..0331368 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2011-07-05 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR middle-end/47715
+ * calls.c (precompute_register_parameters): Promote the function
+ argument before checking non-legitimate constant.
+
2011-07-05 Sebastian Pop <sebastian.pop@amd.com>
PR tree-optimization/47654
diff --git a/gcc/calls.c b/gcc/calls.c
index bba477c..7538e4e 100644
--- a/gcc/calls.c
+++ b/gcc/calls.c
@@ -702,12 +702,6 @@ precompute_register_parameters (int num_actuals, struct arg_data *args,
pop_temp_slots ();
}
- /* If the value is a non-legitimate constant, force it into a
- pseudo now. TLS symbols sometimes need a call to resolve. */
- if (CONSTANT_P (args[i].value)
- && !targetm.legitimate_constant_p (args[i].mode, args[i].value))
- args[i].value = force_reg (args[i].mode, args[i].value);
-
/* If we are to promote the function arg to a wider mode,
do it now. */
@@ -717,6 +711,12 @@ precompute_register_parameters (int num_actuals, struct arg_data *args,
TYPE_MODE (TREE_TYPE (args[i].tree_value)),
args[i].value, args[i].unsignedp);
+ /* If the value is a non-legitimate constant, force it into a
+ pseudo now. TLS symbols sometimes need a call to resolve. */
+ if (CONSTANT_P (args[i].value)
+ && !targetm.legitimate_constant_p (args[i].mode, args[i].value))
+ args[i].value = force_reg (args[i].mode, args[i].value);
+
/* If we're going to have to load the value by parts, pull the
parts into pseudos. The part extraction process can involve
non-trivial computation. */