public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* ABI breakage in 3.2.1, 3.3 and mainline
@ 2003-01-30 18:05 Gerald Pfeifer
  2003-01-31  0:13 ` Jan Hubicka
  0 siblings, 1 reply; 5+ messages in thread
From: Gerald Pfeifer @ 2003-01-30 18:05 UTC (permalink / raw)
  To: gcc, Jan Hubicka; +Cc: Gabriel Dos Reis, Alexander Kabaev, David O'Brien

Jan,

unless I am completely mistaken, the following patch is responsible for an
ABI change I am seeing on FreeBSD (and apparently also Cygwin, Interix,
OpenBSD, NetBSD) on i386 platforms for GCC 3.2.1 as well as the 3.3 branch
and mainline:

  Thu Oct 31 18:08:00 CET 2002  Jan Hubicka  <jh@suse.cz>

        * i386.c (override_options): Set defaults for flag_omit_frame_pointer,
        flag_asynchronous_unwind_tables, flag_pcc_struct_return.
        * i386.c (optimization_options): Set flag_omit_frame_pointer,
        flag_asynchronous_unwind_tables, flag_pcc_struct_return to 2.
        Do not clear -momit-leaf-frame-pointer when profiling.
        (ix86_frame_pointer_required): Frame pointer is always required when
        profiling.

  http://gcc.gnu.org/ml/gcc-patches/2002-10/msg01887.html


What I believe is wrong with this patch is that it _completely_ ignores
DEFAULT_PCC_STRUCT_RETURN when setting flag_pcc_struct_return:

  gcc/config/i386% grep DEFAULT_PCC_STRUCT_RETURN *.h | wc -l
      19
  gcc/config/i386% grep DEFAULT_PCC_STRUCT_RETURN i386.c | wc -l
      0


This is most critical, and I believe this is a showstopper for GCC 3.2.2
(where I believe we ought to restore the ABI of GCC 3.2).

I created PR/9506 which also has a small testcase.

Gerald
-- 
Gerald "Jerry"   pfeifer@dbai.tuwien.ac.at   http://www.pfeifer.com/gerald/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: ABI breakage in 3.2.1, 3.3 and mainline
  2003-01-30 18:05 ABI breakage in 3.2.1, 3.3 and mainline Gerald Pfeifer
@ 2003-01-31  0:13 ` Jan Hubicka
  2003-02-01  0:14   ` Gerald Pfeifer
  0 siblings, 1 reply; 5+ messages in thread
From: Jan Hubicka @ 2003-01-31  0:13 UTC (permalink / raw)
  To: Gerald Pfeifer
  Cc: gcc, Jan Hubicka, Gabriel Dos Reis, Alexander Kabaev, David O'Brien

> Jan,
> 
> unless I am completely mistaken, the following patch is responsible for an
> ABI change I am seeing on FreeBSD (and apparently also Cygwin, Interix,
> OpenBSD, NetBSD) on i386 platforms for GCC 3.2.1 as well as the 3.3 branch
> and mainline:
> 
>   Thu Oct 31 18:08:00 CET 2002  Jan Hubicka  <jh@suse.cz>
> 
>         * i386.c (override_options): Set defaults for flag_omit_frame_pointer,
>         flag_asynchronous_unwind_tables, flag_pcc_struct_return.
>         * i386.c (optimization_options): Set flag_omit_frame_pointer,
>         flag_asynchronous_unwind_tables, flag_pcc_struct_return to 2.
>         Do not clear -momit-leaf-frame-pointer when profiling.
>         (ix86_frame_pointer_required): Frame pointer is always required when
>         profiling.
> 
>   http://gcc.gnu.org/ml/gcc-patches/2002-10/msg01887.html
> 
> 
> What I believe is wrong with this patch is that it _completely_ ignores
> DEFAULT_PCC_STRUCT_RETURN when setting flag_pcc_struct_return:
> 
>   gcc/config/i386% grep DEFAULT_PCC_STRUCT_RETURN *.h | wc -l
>       19
>   gcc/config/i386% grep DEFAULT_PCC_STRUCT_RETURN i386.c | wc -l
>       0
> 
> 
> This is most critical, and I believe this is a showstopper for GCC 3.2.2
> (where I believe we ought to restore the ABI of GCC 3.2).
> 
> I created PR/9506 which also has a small testcase.

Oops,
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.
Index: i386.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/i386/i386.c,v
retrieving revision 1.511
diff -c -3 -p -r1.511 i386.c
*** i386.c	17 Jan 2003 13:44:44 -0000	1.511
--- i386.c	30 Jan 2003 23:33:55 -0000
*************** override_options ()
*** 1103,1109 ****
        if (flag_asynchronous_unwind_tables == 2)
  	flag_asynchronous_unwind_tables = 0;
        if (flag_pcc_struct_return == 2)
! 	flag_pcc_struct_return = 1;
      }
  
  #ifdef SUBTARGET_OVERRIDE_OPTIONS
--- 1107,1113 ----
        if (flag_asynchronous_unwind_tables == 2)
  	flag_asynchronous_unwind_tables = 0;
        if (flag_pcc_struct_return == 2)
! 	flag_pcc_struct_return = DEFAULT_PCC_STRUCT_RETURN;
      }
  
  #ifdef SUBTARGET_OVERRIDE_OPTIONS

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: ABI breakage in 3.2.1, 3.3 and mainline
  2003-01-31  0:13 ` Jan Hubicka
@ 2003-02-01  0:14   ` Gerald Pfeifer
  2003-02-01  2:49     ` Loren James Rittle
  0 siblings, 1 reply; 5+ messages in thread
From: Gerald Pfeifer @ 2003-02-01  0:14 UTC (permalink / raw)
  To: Jan Hubicka; +Cc: gcc, Gabriel Dos Reis, Alexander Kabaev, David O'Brien

On Fri, 31 Jan 2003, Jan Hubicka wrote:
>> I created PR/9506 which also has a small testcase.
> 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.

Thanks!  I noticed that you committed the testcase to 3.2, 3.3, and
mainline, and the fix to 3.2 and mainline, but apparently not 3.3 yet.

Was this intentional?


Also, it seems even with your patch we ignore DEFAULT_PCC_STRUCT_RETURN
for 64bit targets -- is this right resp. correct?


Finally, I believe we need to provide a list of targets where the ABI was
broken with GCC 3.2.1 (and now restored with GCC 3.2.2).  Would you
mind providing such a list which I will then add to the release notes?

Gerald
-- 
Gerald "Jerry"   pfeifer@dbai.tuwien.ac.at   http://www.pfeifer.com/gerald/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: ABI breakage in 3.2.1, 3.3 and mainline
  2003-02-01  0:14   ` Gerald Pfeifer
@ 2003-02-01  2:49     ` Loren James Rittle
  2003-02-09 23:37       ` PATCH for " Gerald Pfeifer
  0 siblings, 1 reply; 5+ messages in thread
From: Loren James Rittle @ 2003-02-01  2:49 UTC (permalink / raw)
  To: gcc; +Cc: pfeifer

>>> I created PR/9506 which also has a small testcase.
>> I assumed that DEFAULT_PCC_STRUCT_RETURN is handled by toplev.c [...]
>> 	* i386.c (override_options): Use DEFAULT_PCC_STRUCT_RETURN.

> Thanks!  I noticed that you committed the testcase to 3.2, 3.3, and
> mainline, and the fix to 3.2 and mainline, but apparently not 3.3 yet.

> Was this intentional?

You have Eagle eyes.  I am to blame for this.  I committed it, at the
request of Gabriel.  The test against mainline and the 3.2 branch has
completed, thus I installed it there ASAP (in the hopes of hitting the
next 3.2.2 prerelease).  The test against 3.3 hasn't completed yet,
thus I haven't installed it there yet.  I know it looks like a trivial
patch; but I don't chance anything without the bootstrap/check
anymore.

> Also, it seems even with your patch we ignore DEFAULT_PCC_STRUCT_RETURN
> for 64bit targets -- is this right resp. correct?

I can't answer this part; other than to say that, at the point of
Jan's change, there were no 64 bit ABIs for IA32.

> Finally, I believe we need to provide a list of targets where the ABI was
> broken with GCC 3.2.1 (and now restored with GCC 3.2.2).  Would you
> mind providing such a list which I will then add to the release notes?

To get an exact list will be difficult.  Here is my best effort
of broken ports based on config directory snippets:

cygwin/i386
freebsd/i386 (although, please explicitly mention that the FreeBSD 5.0
	      release, which used gcc 3.2.1, was OK)
interix/i386
linux-aout/i386
mach/i386
netbsd-aout/i386
openbsd/i386
darwin/i386

The list of known OK i386 ports:
beos-elf/i386
linux/i386
netbsd-elf/i386

^ permalink raw reply	[flat|nested] 5+ messages in thread

* PATCH for Re: ABI breakage in 3.2.1, 3.3 and mainline
  2003-02-01  2:49     ` Loren James Rittle
@ 2003-02-09 23:37       ` Gerald Pfeifer
  0 siblings, 0 replies; 5+ messages in thread
From: Gerald Pfeifer @ 2003-02-09 23:37 UTC (permalink / raw)
  To: gcc-patches; +Cc: Loren James Rittle, gcc

On Fri, 31 Jan 2003, Loren James Rittle wrote:
>> Thanks!  I noticed that you committed the testcase to 3.2, 3.3, and
>> mainline, and the fix to 3.2 and mainline, but apparently not 3.3 yet.
>>
>> Was this intentional?
> You have Eagle eyes.  I am to blame for this.  I committed it, at the
> request of Gabriel.  The test against mainline and the 3.2 branch has
> completed, thus I installed it there ASAP (in the hopes of hitting the
> next 3.2.2 prerelease).  The test against 3.3 hasn't completed yet,

Not so much eagle eyes as a strong desire to ensure this is properly
fixed on all active branches. ;-)

(And I'd certainly not call proper testing as you have done as something
to be blamed for; rather to the contrary!)

> To get an exact list will be difficult.  Here is my best effort
> of broken ports based on config directory snippets:
>
> cygwin/i386
> freebsd/i386 (although, please explicitly mention that the FreeBSD 5.0
> 	      release, which used gcc 3.2.1, was OK)
> interix/i386
> linux-aout/i386
> mach/i386
> netbsd-aout/i386
> openbsd/i386
> darwin/i386

Thanks! I just installed the following update for the 3.2 changes
page; a bit late, but, well, don't ask. :-(

Gerald

Index: changes.html
===================================================================
RCS file: /cvs/gcc/wwwdocs/htdocs/gcc-3.2/changes.html,v
retrieving revision 1.45
diff -u -3 -p -r1.45 changes.html
--- changes.html	7 Feb 2003 15:35:14 -0000	1.45
+++ changes.html	9 Feb 2003 23:24:21 -0000
@@ -102,6 +102,13 @@ new features that were not present in GC

 <h3>Bug Fixes</h3>

+<p>On the following i386-based systems GCC 3.2.1 broke the C ABI wrt.
+functions returning structures: Cygwin, FreeBSD (GCC 3.2.1 as shipped
+with FreeBSD 5.0 does not have this problem), Interix, a.out-based Linux
+and NetBSD, OpenBSD, and Darwin.  GCC 3.2.2 reverts this ABI change, and
+thus restores ABI-compatibility with previous releases (except GCC 3.2.1)
+on these platforms.</p>
+
 <p>This section lists the problem reports (PRs) from GCC's bug tracking
 system (GNATS) that are known to be fixed in the 3.2.2 release. This
 list might not be complete (that is, it is possible that some PRs

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2003-02-09 23:37 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-01-30 18:05 ABI breakage in 3.2.1, 3.3 and mainline Gerald Pfeifer
2003-01-31  0:13 ` Jan Hubicka
2003-02-01  0:14   ` Gerald Pfeifer
2003-02-01  2:49     ` Loren James Rittle
2003-02-09 23:37       ` PATCH for " Gerald Pfeifer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).