public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug ada/21937] New: Member record alignment triggering an ICE
@ 2005-06-06 20:42 macro at linux-mips dot org
  2005-06-06 20:43 ` [Bug ada/21937] " macro at linux-mips dot org
                   ` (12 more replies)
  0 siblings, 13 replies; 14+ messages in thread
From: macro at linux-mips dot org @ 2005-06-06 20:42 UTC (permalink / raw)
  To: gcc-bugs

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


^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2005-09-06  8:26 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-06-06 20:42 [Bug ada/21937] New: Member record alignment triggering an ICE macro at linux-mips dot org
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

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).