diff mbox

[ia64] fix libgfortran build

Message ID 4CE9586E.8080007@redhat.com
State New
Headers show

Commit Message

Richard Henderson Nov. 21, 2010, 5:35 p.m. UTC
With the addition of the libquad bits, we exposed a bug in the __float128
support in the ia64 backend.  We use the wrong mode for some builtins.

Tested on ia64-linux.  Committed.


r~
* config/ia64/ia64.c (ia64_expand_builtin): Use the correct mode
    for infq/huge_valq.
diff mbox

Patch

diff --git a/gcc/config/ia64/ia64.c b/gcc/config/ia64/ia64.c
index a657d4e..06258cb 100644
--- a/gcc/config/ia64/ia64.c
+++ b/gcc/config/ia64/ia64.c
@@ -10236,16 +10236,17 @@  ia64_expand_builtin (tree exp, rtx target, rtx subtarget ATTRIBUTE_UNUSED,
     case IA64_BUILTIN_INFQ:
     case IA64_BUILTIN_HUGE_VALQ:
       {
+        enum machine_mode target_mode = TYPE_MODE (TREE_TYPE (exp));
 	REAL_VALUE_TYPE inf;
 	rtx tmp;
 
 	real_inf (&inf);
-	tmp = CONST_DOUBLE_FROM_REAL_VALUE (inf, mode);
+	tmp = CONST_DOUBLE_FROM_REAL_VALUE (inf, target_mode);
 
-	tmp = validize_mem (force_const_mem (mode, tmp));
+	tmp = validize_mem (force_const_mem (target_mode, tmp));
 
 	if (target == 0)
-	  target = gen_reg_rtx (mode);
+	  target = gen_reg_rtx (target_mode);
 
 	emit_move_insn (target, tmp);
 	return target;