This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: ABI breakage in 3.2.1, 3.3 and mainline
- From: Jan Hubicka <jh at suse dot cz>
- To: Gerald Pfeifer <pfeifer at dbai dot tuwien dot ac dot at>
- Cc: gcc at gcc dot gnu dot org, Jan Hubicka <jh at suse dot cz>,Gabriel Dos Reis <gdr at integrable-solutions dot net>,Alexander Kabaev <ak03 at gte dot com>, David O'Brien <obrien at freebsd dot org>
- Date: Fri, 31 Jan 2003 00:34:56 +0100
- Subject: Re: ABI breakage in 3.2.1, 3.3 and mainline
- References: <Pine.BSF.4.51.0301301336560.62291@naos.dbai.tuwien.ac.at>
> 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