* IA-64 patch for union/long double ICE
@ 2004-07-10 0:01 Jim Wilson
0 siblings, 0 replies; only message in thread
From: Jim Wilson @ 2004-07-10 0:01 UTC (permalink / raw)
To: gcc-patches
[-- Attachment #1: Type: text/plain, Size: 396 bytes --]
This fixes the problem I reported in PR 16364. When we have a XFmode
HFA argument inside a TImode object, we have to return a PARALLEL
instead of a TImode REG. Otherwise we end up trying to allocate a
TImode value to an FP reg, but FP regs can only hold XFmode objects.
This was tested with an ia64-linux bootstrap and make check.
--
Jim Wilson, GNU Tools Support, http://www.SpecifixInc.com
[-- Attachment #2: patch.16364 --]
[-- Type: text/plain, Size: 2232 bytes --]
gcc/ChangeLog
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.
gcc/testsuite/ChangeLog
2004-07-09 James E Wilson <wilson@specifixinc.com>
PR target/16364
* gcc.c-torture/compile/20040709-1.c: New.
Index: config/ia64/ia64.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/ia64/ia64.c,v
retrieving revision 1.299
diff -p -r1.299 ia64.c
*** config/ia64/ia64.c 8 Jul 2004 22:13:40 -0000 1.299
--- config/ia64/ia64.c 9 Jul 2004 23:05:09 -0000
*************** ia64_function_arg (CUMULATIVE_ARGS *cum,
*** 3746,3753 ****
}
/* 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)
return gen_rtx_REG (mode, REGNO (XEXP (loc[0], 0)));
else
return gen_rtx_PARALLEL (mode, gen_rtvec_v (i, loc));
--- 3746,3757 ----
}
/* If we ended up using just one location, just return that one loc, but
! 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));
Index: testsuite/gcc.c-torture/compile/20040709-1.c
===================================================================
RCS file: testsuite/gcc.c-torture/compile/20040709-1.c
diff -N testsuite/gcc.c-torture/compile/20040709-1.c
*** /dev/null 1 Jan 1970 00:00:00 -0000
--- testsuite/gcc.c-torture/compile/20040709-1.c 9 Jul 2004 23:05:09 -0000
***************
*** 0 ****
--- 1,10 ----
+ /* PR target/16364 */
+ union foo {
+ long double ld;
+ } bar;
+
+ double
+ sub (union foo baz)
+ {
+ return baz.ld / 2;
+ }
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2004-07-09 23:13 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-07-10 0:01 IA-64 patch for union/long double ICE Jim Wilson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).