From: "Doug Kwan (關振德)" <dougkwan@google.com>
To: gcc-patches@gcc.gnu.org, "Diego Novillo" <dnovillo@google.com>,
zadeck@naturalbridge.com
Subject: [LTO][PATCH] Fix long double precision problem
Date: Wed, 05 Dec 2007 07:05:00 -0000 [thread overview]
Message-ID: <498552560712042305h6aa6f4d8jfdc8e9031b522604@mail.gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 176 bytes --]
Hi,
Could someone review this patch. This fixes a problem where long
double type has BLK mode instead of the correct XF mode. It fixes
about 20 dejagnu failures.
-Doug
[-- Attachment #2: patches.txt --]
[-- Type: text/plain, Size: 1505 bytes --]
2007-12-04 Doug Kwan <dougkwan@google.com>
* lto.c (lto_real_type_precision): New.
(lto_read_base_type_DIE): Use type size to compute precision of
a scalar real base type instead of using type size as precision.
Index: gcc/lto/lto.c
===================================================================
--- gcc/lto/lto.c (revision 130614)
+++ gcc/lto/lto.c (working copy)
@@ -2899,6 +2899,20 @@ lto_read_subrange_type_DIE (lto_info_fd
return type;
}
+static int
+lto_real_type_precision (int size)
+{
+ if (size == TREE_INT_CST_LOW (TYPE_SIZE (float_type_node)))
+ return TYPE_PRECISION (float_type_node);
+ if (size == TREE_INT_CST_LOW (TYPE_SIZE (double_type_node)))
+ return TYPE_PRECISION (double_type_node);
+ if (size == TREE_INT_CST_LOW (TYPE_SIZE (long_double_type_node)))
+ return TYPE_PRECISION (long_double_type_node);
+
+ gcc_unreachable ();
+ return 0;
+}
+
static tree
lto_read_base_type_DIE (lto_info_fd *fd,
lto_die_ptr die ATTRIBUTE_UNUSED,
@@ -3003,14 +3017,14 @@ lto_read_base_type_DIE (lto_info_fd *fd,
case DW_ATE_float:
type = make_node (REAL_TYPE);
- TYPE_PRECISION (type) = bits;
+ TYPE_PRECISION (type) = lto_real_type_precision (bits);
layout_type (type);
break;
case DW_ATE_complex_float:
{
tree base = make_node (REAL_TYPE);
- TYPE_PRECISION (base) = bits / 2;
+ TYPE_PRECISION (base) = lto_real_type_precision (bits / 2);
layout_type (base);
type = build_complex_type (base);
}
next reply other threads:[~2007-12-05 7:05 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-12-05 7:05 Doug Kwan (關振德) [this message]
2007-12-05 10:52 ` Andrew Pinski
2007-12-05 12:55 ` Kenneth Zadeck
2007-12-05 14:56 ` Diego Novillo
2007-12-05 16:28 ` Doug Kwan (關振德)
2007-12-05 19:02 ` Andrew Pinski
2007-12-05 16:34 ` Mark Mitchell
2007-12-05 18:42 ` Doug Kwan (關振德)
2007-12-05 19:01 ` Doug Kwan (關振德)
2007-12-05 23:52 ` Mark Mitchell
2007-12-11 23:15 ` Doug Kwan (關振德)
2007-12-12 9:22 ` Mark Mitchell
2007-12-12 20:23 ` Doug Kwan (關振德)
2007-12-12 20:45 ` Mark Mitchell
2007-12-13 2:27 ` Doug Kwan (關振德)
2007-12-13 11:02 ` Andreas Schwab
2007-12-13 19:13 ` Doug Kwan (關振德)
2007-12-14 9:50 ` Andreas Schwab
2007-12-14 22:18 ` Doug Kwan (關振德)
2007-12-13 20:11 ` Jim Blandy
2007-12-13 20:40 ` Doug Kwan (關振德)
2007-12-13 22:43 ` Jim Blandy
[not found] ` <4765FBC0.8020400@codesourcery.com>
2007-12-17 21:53 ` Doug Kwan (關振德)
2007-12-18 4:29 ` Mark Mitchell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=498552560712042305h6aa6f4d8jfdc8e9031b522604@mail.gmail.com \
--to=dougkwan@google.com \
--cc=dnovillo@google.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=zadeck@naturalbridge.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).