aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJames E Wilson <wilson@specifixinc.com>2004-07-09 23:10:26 +0000
committerJim Wilson <wilson@gcc.gnu.org>2004-07-09 16:10:26 -0700
commit5806d4fd849871d77fdc9b5f6a1ef05d42039a52 (patch)
tree58bc880c604da698d9f6037a06dff53c0fdb7dd1 /gcc
parent2319a1d1f7308338e91ace8b30719347b91580e4 (diff)
downloadgcc-5806d4fd849871d77fdc9b5f6a1ef05d42039a52.zip
gcc-5806d4fd849871d77fdc9b5f6a1ef05d42039a52.tar.gz
gcc-5806d4fd849871d77fdc9b5f6a1ef05d42039a52.tar.bz2
Fix for IA-64 union/long double ICE.
PR target/16364 * config/ia64/ia64.c (ia64_function_arg): For a single element HFA, do return a parallel if hfa_mode == XFmode and mode == TImode. * gcc.c-torture/compile/20040709-1.c: New. From-SVN: r84416
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/config/ia64/ia64.c8
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/20040709-1.c10
4 files changed, 27 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 0bb7353..3c59958 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2004-07-09 James E Wilson <wilson@specifixinc.com>
+
+ PR target/16364
+ * config/ia64/ia64.c (ia64_function_arg): For a single element HFA,
+ do return a parallel if hfa_mode == XFmode and mode == TImode.
+
2004-07-09 Jan Beulich <jbeulich@novell.com>
* builtin-types.def (BT_UINT): Rename from BT_UNSIGNED.
diff --git a/gcc/config/ia64/ia64.c b/gcc/config/ia64/ia64.c
index 117f965..fdebfba 100644
--- a/gcc/config/ia64/ia64.c
+++ b/gcc/config/ia64/ia64.c
@@ -3746,8 +3746,12 @@ ia64_function_arg (CUMULATIVE_ARGS *cum, enum machine_mode mode, tree type,
}
/* If we ended up using just one location, just return that one loc, but
- change the mode back to the argument mode. */
- if (i == 1)
+ change the mode back to the argument mode. However, we can't do this
+ when hfa_mode is XFmode and mode is TImode. In that case, we would
+ return a TImode reference to an FP reg, but FP regs can't hold TImode.
+ We need the PARALLEL to make this work. This can happen for a union
+ containing a single __float80 member. */
+ if (i == 1 && ! (hfa_mode == XFmode && mode == TImode))
return gen_rtx_REG (mode, REGNO (XEXP (loc[0], 0)));
else
return gen_rtx_PARALLEL (mode, gen_rtvec_v (i, loc));
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 89d0e6d..d82a14f 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2004-07-09 James E Wilson <wilson@specifixinc.com>
+
+ PR target/16364
+ * gcc.c-torture/compile/20040709-1.c: New.
+
2004-07-09 Tobias Schlueter <tobias.schlueter@physik.uni-muenchen.de>
PR fortran/14077
diff --git a/gcc/testsuite/gcc.c-torture/compile/20040709-1.c b/gcc/testsuite/gcc.c-torture/compile/20040709-1.c
new file mode 100644
index 0000000..c8c9cc3
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/20040709-1.c
@@ -0,0 +1,10 @@
+/* PR target/16364 */
+union foo {
+ long double ld;
+} bar;
+
+double
+sub (union foo baz)
+{
+ return baz.ld / 2;
+}