ABI breakage in 3.2.1, 3.3 and mainline

Loren James Rittle rittle@latour.rsch.comm.mot.com
Fri Jan 31 02:43:00 GMT 2003


> I assumed that DEFAULT_PCC_STRUCT_RETURN is handled by toplev.c via
> ifdef, but it just sets default I overwrite.  The attached patch should
> restore original behaviour.  I am just going to test it.
>
> Fri Jan 31 00:34:31 CET 2003  Jan Hubicka  <jh@suse.cz>
>	* i386.c (override_options): Use DEFAULT_PCC_STRUCT_RETURN.

Jan, I can confirm that your patch fixes the issue as seen on both
mainline and 3.2.X branch on i386-unknown-freebsd4.7; I don't have a
3.3 branch to test handy (I will switch all automatic FreeBSD testers
tracking 3.2 to 3.3 ASAP).  These tests were simple rebuilds not full
bootstrap/regression check cycles.  For the record, an equivalent
change is in the FreeBSD 5.0 system compiler sources as of 2002/12/22.
Thank you for the quick address of Gerald's concern.

There was no visible testsuite failure for this problem.  Thus, I
wonder if a form of Gerald's test case shouldn't go in as well;
instead of printing, check for proper results.  As div() is ISO C89,
it seems fairly safe and could be XFAIL'd for any platforms that don't
have it.  Please commit this test case with your i386.c patch or I
will do so afterwards, if you prefer.

	PR c/9506
	* gcc.dg/struct-ret-libc.c: New test.

Index: gcc/testsuite/gcc.dg/struct-ret-libc.c
*** /dev/null	Thu Jan 30 20:18:00 2003
--- gcc/testsuite/gcc.dg/struct-ret-libc.c	Thu Jan 30 20:22:08 2003
***************
*** 0 ****
--- 1,15 ----
+ /* Test evolved from source from Gerald Pfeifer<pfeifer@dbai.tuwien.ac.at>
+ 
+    Copyright (C) 2003 Free Software Foundation  */
+ 
+ /* { dg-do run } */
+ 
+ #include <stdlib.h>
+ 
+ int main ()
+ {
+   div_t d = div (20, 5);
+   if ((d.quot != 4) || (d.rem))
+     abort ();
+   exit (0);
+ }



More information about the Gcc-patches mailing list