This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: g++ internal compiler error linux-i586 libstdc++-2.90.7
- To: hackenberg at nikocity dot de
- Subject: Re: g++ internal compiler error linux-i586 libstdc++-2.90.7
- From: "Martin v. Loewis" <martin at loewis dot home dot cs dot tu-berlin dot de>
- Date: Sun, 12 Mar 2000 23:03:49 +0100
- CC: phackenberg at aip dot de, gcc-bugs at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- References: <Pine.LNX.4.10.10003121453100.14244-201000@sirius.somewhere.de>
> Reading specs from /usr/lib/gcc-lib/i586-pc-linux-gnu/2.95.2/specs
> gcc version 2.95.2 19991024 (release)
Thanks for your bug report, here is a patch for the mainline
compiler. I have not tested it at all with 2.95, and I have not
regression-tested it with the mainline. It also is a work-around only,
until the middle-end supports complex structures as primitives.
Regards,
Martin
2000-03-12 Martin v. Löwis <loewis@informatik.hu-berlin.de>
* stor-layout.c (layout_type): Do not try to treat a structure
with a single complex field as a primitive value.
// Build don't link:
struct S{
__complex__ double x;
};
void foo(struct S*);
int main()
{
struct S s = {1.0+1i};
foo(&s);
}
Index: stor-layout.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/stor-layout.c,v
retrieving revision 1.53
diff -u -r1.53 stor-layout.c
--- stor-layout.c 2000/03/07 11:41:19 1.53
+++ stor-layout.c 2000/03/12 21:54:42
@@ -1145,7 +1145,11 @@
#endif /* STRUCT_FORCE_BLK */
}
- if (mode != VOIDmode)
+ /* XXX Support for structures containing a single float
+ member is currently broken: put_var_into_stack expects
+ that the TREE_TYPE of type indicates the complex value
+ base type, which it does not for this structure. */
+ if (mode != VOIDmode && GET_MODE_CLASS (mode) != MODE_COMPLEX_FLOAT)
/* We only have one real field; use its mode. */
TYPE_MODE (type) = mode;
else