From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4034 invoked by alias); 6 Jun 2005 20:42:16 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 3955 invoked by uid 48); 6 Jun 2005 20:42:10 -0000 Date: Mon, 06 Jun 2005 20:42:00 -0000 From: "macro at linux-mips dot org" To: gcc-bugs@gcc.gnu.org Message-ID: <20050606204209.21937.macro@linux-mips.org> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug ada/21937] New: Member record alignment triggering an ICE X-Bugzilla-Reason: CC X-SW-Source: 2005-06/txt/msg01039.txt.bz2 List-Id: 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