GCC encounters an internal compiler error instead of reporting an error when it encounters an attempt to fit a 192-bit structure into a 32-bit register. E:\DJGPP\bugs>gcc -v -save-temps -c test2.c Reading specs from e:/djgpp/lib/gcc-lib/djgpp/3.21/specs Configured with: /devel/gnu/gcc/3.2/gnu/gcc-3.21/configure i586-pc-msdosdjgpp --prefix=/dev/env/DJDIR --disable-nls Thread model: single gcc version 3.2.1 e:/djgpp/lib/gcc-lib/djgpp/3.21/cpp0.exe -lang-c -v -D__GNUC__=3 -D__GNUC_MINOR__=2 -D__GNUC_PATCHLEVEL__=1 -D__GXX_ABI_VERSION=102 -D__MSDOS__ -D__GO32__ -D__DJGPP__=2 -D__unix__ -D__MSDOS__ -D__GO32__ -D__DJGPP__=2 -D__unix__ -Asystem=msdos -Asystem=unix -D__NO_INLINE__ -D__STDC_HOSTED__=1 -Acpu=i386 -Amachine=i386 -Di386 -D__i386 -D__i386__ -D__tune_i586__ -D__tune_pentium__ -DMSDOS -DGO32 -DDJGPP=2 -Dunix -remap -imacros e:/djgpp/lib/gcc-lib/djgpp/3.21/djgpp.ver test2.c test2.i GNU CPP version 3.2.1 (cpplib) (80386, BSD syntax) ignoring nonexistent directory "e:/djgpp/djgpp/include" #include "..." search starts here: #include <...> search starts here: e:/djgpp/lib/gcc-lib/djgpp/3.21/include e:/djgpp/include End of search list. e:/djgpp/lib/gcc-lib/djgpp/3.21/cc1.exe -fpreprocessed test2.i -quiet -dumpbase test2.c -version -o test2.s GNU CPP version 3.2.1 (cpplib) (80386, BSD syntax) GNU C version 3.2.1 (djgpp) compiled by GNU C version 3.2.1. test2.c: In function `switch_to_stack': test2.c:10: Internal compiler error in emit_move_insn, at expr.c:2771 Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions. Release: gcc version 3.2.1 Environment: OS: Windows 98 [Version 4.10.2222] CPU: AuthenticAMD AMD-K6(tm) 3D processor RAM: 160.0MB RAM Distribution: MS-DOS DJGPP v2 How-To-Repeat: Invoked with: gcc -v -save-temps -c test2.c Preprocessed source (test2.i): # 1 "test2.c" # 1 "<built-in>" # 1 "<command line>" # 1 "e:/djgpp/lib/gcc-lib/djgpp/3.21/djgpp.ver" 1 # 1 "e:/djgpp/include/sys/version.h" 1 3 # 2 "e:/djgpp/lib/gcc-lib/djgpp/3.21/djgpp.ver" 2 # 2 "<command line>" 2 # 1 "test2.c" typedef struct { long x[6]; } myjmp_buf; typedef struct { myjmp_buf regs; } my_stack; void switch_to_stack (my_stack *stack){ asm ( "\n" : "+a" (stack->regs) ); }
State-Changed-From-To: open->analyzed State-Changed-Why: Confirmed. Also happens on Linux and with all versions of gcc since at least 2.95
moving to inline-asm because that is where it belongs.
This does not ICE but gives "inconsistent operand constraints in an `asm'" in 2.91.66 so this is a regression with respect to that, it happens in 2.95.3 also so it was introduced in between.
This happens on all i?86-*-*.
Since this is an ice-on-invalid-code regression moving target to 3.3.2.
This happens with any struct that has more than one element: void f(){ struct { char x, y; } s; asm ("" : : "r" (s)); } The documentation is not quite clear about what's legal here, I think it would be best to document that one-element structs are OK for "r" (because people are likely using that at the moment), and reject all other structs with a useful error message.
*** Bug 9233 has been marked as a duplicate of this bug. ***
*** Bug 11896 has been marked as a duplicate of this bug. ***
*** Bug 12530 has been marked as a duplicate of this bug. ***
Postponed until GCC 3.3.3.
It fails in GCC 2.95.x and all 3.x releases and I think it is not worth while to tweak the middle-end on a release branch for such a pathological case.
A regression from 2.91 is not really worth being mentioned as this is an ice-on-invalid- code.
*** Bug 15131 has been marked as a duplicate of this bug. ***
*** Bug 15136 has been marked as a duplicate of this bug. ***
Created attachment 6262 [details] Example: Referring a struct from inline assembler w/ workaround This simplified code produces "Internal Compiler Error" on gcc 3.3.1/cygwin (and other versions). The bug is present also when renaming and compiling the file as C++. A possible workaround seems to be adding '&' in the macro invocation, which also seems more correct, since this is about passing a pointer in a register.
*** Bug 20818 has been marked as a duplicate of this bug. ***
Subject: Bug 8788 CVSROOT: /cvs/gcc Module name: gcc Changes by: sayle@gcc.gnu.org 2005-05-09 05:15:51 Modified files: gcc : ChangeLog stmt.c gcc/testsuite : ChangeLog Added files: gcc/testsuite/gcc.dg: pr8788-1.c Log message: PR inline-asm/8788 * stmt.c (expand_asm_operands): Avoid calling force_reg on BLKmode operands. * gcc.dg/pr8788-1.c: New testcase. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.8666&r2=2.8667 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/stmt.c.diff?cvsroot=gcc&r1=1.421&r2=1.422 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.5447&r2=1.5448 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.dg/pr8788-1.c.diff?cvsroot=gcc&r1=NONE&r2=1.1
*** Bug 21811 has been marked as a duplicate of this bug. ***
Fixed on the mainline for 4.1.0.
*** Bug 26077 has been marked as a duplicate of this bug. ***
*** Bug 28529 has been marked as a duplicate of this bug. ***