public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "macro at linux-mips dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug ada/21937] New: Member record alignment triggering an ICE
Date: Mon, 06 Jun 2005 20:42:00 -0000	[thread overview]
Message-ID: <20050606204209.21937.macro@linux-mips.org> (raw)

This problem happens for platforms that set STRICT_ALIGNMENT.  For them it is
possible for a given record type to be expressed using an integer mode if used
as a member record, and the BLK mode if used standalone.  As a result an
assignment where lhs is BLKmode and rhs is *Imode may be generated and this
triggers an ICE.

 I've been able to trigger it for 4.0.0 using alpha-linux-gnu,
mipsel-linux-gnu and mips64el-linux cross-compilers run on i386-linux-gnu
as well as a native mipsel-linux-gnu one.  The compiler was configured as
follows:

$ CC=i386-linux-gcc \
CXX=i386-linux-g++ \
F77=i386-linux-gfortran \
CFLAGS='-pipe -O2 -fomit-frame-pointer -mtune=i486' \
CXXFLAGS='-pipe -O2 -fomit-frame-pointer -mtune=i486' \
FCFLAGS='-pipe -O2 -fomit-frame-pointer -mtune=i486' \
CC_FOR_BUILD=i386-linux-gcc \
CFLAGS_FOR_BUILD='-pipe -O2 -fomit-frame-pointer -mtune=i486' \
CFLAGS_FOR_TARGET='-mcpu=ev4 -pipe -O2 -fomit-frame-pointer' \
CXXFLAGS_FOR_TARGET='-mcpu=ev4 -pipe -O2 -fomit-frame-pointer' \
FCFLAGS_FOR_TARGET='-mcpu=ev4 -pipe -O2 -fomit-frame-pointer' \
INSTALL_PROGRAM='${INSTALL} -s' \
../configure --prefix=/usr '--mandir=${datadir}/man' \
'--with-local-prefix=${prefix}/alpha-linux/local' \
--disable-multilib \
--enable-shared \
--enable-static \
--with-system-zlib \
--enable-threads \
--cache-file=config.cache \
--build=i386-linux --host=i386-linux --target=alpha-linux

then built as follows:

$ make 'BOOT_CFLAGS=-pipe -O2 -fomit-frame-pointer -mtune=i486' \
'GCJFLAGS=-mcpu=ev4 -pipe -O2 -fomit-frame-pointer' \
CXX_FOR_BUILD=i386-linux-g++ \
'CXXFLAGS_FOR_BUILD=-pipe -O2 -fomit-frame-pointer -mtune=i486' all

(this is for alpha-linux-gnu -- the others were built similarly; I can supply
details if needed).

 I'm sending a set of sources that trigger the problem for me.  They are
actually a part of the Ada binding of ncurses 5.4.  To reproduce, build as
follows:

$ alpha-linux-gcc -c -gnatpn -pipe -O2 -fomit-frame-pointer \
terminal_interface-curses.adb

 I've been able to track the problem down to the alignment of member records
being increased implicitly in an attempt to fit them into an integer mode.
I believe it is incorrect as it changes the alignment of the containing
record as well and therefore it changes the ABI.  That would be true e.g. for
the MIPS ABI as far as C is concerned, but I don't know if Ada follows the
same rules, so my opinion is not definite.  Anyway I've prepared a patch 
proposal that fixes the problem for me.

 Please consider.

-- 
           Summary: Member record alignment triggering an ICE
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: ada
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: macro at linux-mips dot org
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i386-linux-gnu
  GCC host triplet: i386-linux-gnu
GCC target triplet: alpha-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21937


             reply	other threads:[~2005-06-06 20:42 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-06 20:42 macro at linux-mips dot org [this message]
2005-06-06 20:43 ` [Bug ada/21937] " macro at linux-mips dot org
2005-06-06 20:45 ` macro at linux-mips dot org
2005-06-06 21:07 ` pluto at agmk dot net
2005-06-06 21:20 ` pinskia at gcc dot gnu dot org
2005-06-07 10:29 ` macro at linux-mips dot org
2005-06-07 11:30 ` ebotcazou at gcc dot gnu dot org
2005-06-07 11:31 ` ebotcazou at gcc dot gnu dot org
2005-06-07 12:15 ` macro at linux-mips dot org
2005-06-07 12:16 ` ebotcazou at gcc dot gnu dot org
2005-06-07 12:26 ` ebotcazou at gcc dot gnu dot org
2005-06-07 18:16 ` [Bug ada/21937] [4.0 Regression] Member record alignment triggers " macro at linux-mips dot org
2005-06-07 18:56 ` ebotcazou at gcc dot gnu dot org
2005-09-06  8:26 ` [Bug ada/21937] [4.0/4.1 " ebotcazou 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=20050606204209.21937.macro@linux-mips.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).