public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "dave at hiauly1 dot hia dot nrc dot ca" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug middle-end/28176] FAIL: gfortran.dg/actual_array_constructor_1.f90 -O0 (ICE)
Date: Sun, 22 Oct 2006 16:18:00 -0000 [thread overview]
Message-ID: <20061022161814.30276.qmail@sourceware.org> (raw)
In-Reply-To: <bug-28176-276@http.gcc.gnu.org/bugzilla/>
------- Comment #9 from dave at hiauly1 dot hia dot nrc dot ca 2006-10-22 16:18 -------
Subject: Re: FAIL: gfortran.dg/actual_array_constructor_1.f90 -O0 (ICE)
> ------- Comment #8 from sje at cup dot hp dot com 2006-10-19 18:09 -------
> Well, I found that the TImode is getting introduced in layout_type. For an
> ARRAY_TYPE tree there is this line:
>
> TYPE_SIZE (type) = size_binop (MULT_EXPR, element_size,
> fold_convert (bitsizetype,
> length));
>
> If you look at bitsizetype, you will find that it is TImode and thus the
> resulting expression is TImode. bitsizetype is set in set_sizetype based on 2
> * BITS_PER_UNIT_LOG which is 64 for hppa64. Thus our problem.
It appears bitsizetype gets set to a precision that requires TImode here:
void
set_sizetype (tree type)
{
int oprecision = TYPE_PRECISION (type);
/* The *bitsizetype types use a precision that avoids overflows when
calculating signed sizes / offsets in bits. However, when
cross-compiling from a 32 bit to a 64 bit host, we are limited to 64 bit
precision. */
int precision = MIN (oprecision + BITS_PER_UNIT_LOG + 1,
2 * HOST_BITS_PER_WIDE_INT);
In the above, I don't think a precision larger than MAX_FIXED_MODE_SIZE
should be used. This is currently 64 on hppa64. However, oprecision
is 64 and BITS_PER_UNIT_LOG is 3, so the first argument of MIN is 68.
The second argument is 128. Thus, precision ends up as 68 and the
following re layout uses TImode.
I'm trying the patch below. I think other limits come into play
long before a calculation overflow would bit.
The other alternative is to add TImode support. This is much more
complicated and probably not suitable for stage3.
Dave
--
J. David Anglin dave.anglin@nrc-cnrc.gc.ca
National Research Council of Canada (613) 990-0752 (FAX: 952-6602)
Index: stor-layout.c
===================================================================
--- stor-layout.c (revision 117956)
+++ stor-layout.c (working copy)
@@ -1934,7 +1934,8 @@
calculating signed sizes / offsets in bits. However, when
cross-compiling from a 32 bit to a 64 bit host, we are limited to 64 bit
precision. */
- int precision = MIN (oprecision + BITS_PER_UNIT_LOG + 1,
+ int precision = MIN (MIN (oprecision + BITS_PER_UNIT_LOG + 1,
+ MAX_FIXED_MODE_SIZE),
2 * HOST_BITS_PER_WIDE_INT);
tree t;
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28176
next prev parent reply other threads:[~2006-10-22 16:18 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-06-27 1:47 [Bug fortran/28176] New: " danglin at gcc dot gnu dot org
2006-06-27 2:44 ` [Bug fortran/28176] " danglin at gcc dot gnu dot org
2006-06-28 14:32 ` pault at gcc dot gnu dot org
2006-07-06 16:49 ` danglin at gcc dot gnu dot org
2006-10-18 18:16 ` sje at cup dot hp dot com
2006-10-18 18:51 ` dave at hiauly1 dot hia dot nrc dot ca
2006-10-18 20:49 ` sje at cup dot hp dot com
2006-10-19 1:56 ` dave at hiauly1 dot hia dot nrc dot ca
2006-10-19 18:09 ` sje at cup dot hp dot com
2006-10-22 16:18 ` dave at hiauly1 dot hia dot nrc dot ca [this message]
2006-11-18 23:17 ` [Bug middle-end/28176] " danglin at gcc dot gnu dot org
2006-11-19 0:44 ` danglin at gcc dot gnu dot org
2006-11-19 0:50 ` danglin at gcc dot gnu dot org
2006-12-01 2:06 ` chaoyingfu at gcc dot gnu dot org
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=20061022161814.30276.qmail@sourceware.org \
--to=gcc-bugzilla@gcc.gnu.org \
--cc=gcc-bugs@gcc.gnu.org \
/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).