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]

Re: g++ internal compiler error linux-i586 libstdc++-2.90.7


> 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

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