This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug ada/21937] New: Member record alignment triggering an ICE


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]