This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: GCC 2.95.2 for AIX handles 'long long' incorrectly
- To: Geoff Keating <geoffk at cygnus dot com>
- Subject: Re: GCC 2.95.2 for AIX handles 'long long' incorrectly
- From: Franz Sirl <Franz dot Sirl-kernel at lauterbach dot com>
- Date: Fri, 10 Mar 2000 13:10:18 +0100
- Cc: Wayne Scott <wscott at ichips dot intel dot com>,gcc-bugs at gcc dot gnu dot org
- References: <Wayne Scott's message of "Wed, 08 Mar 2000 15:32:16 -0800"><20000308153216F.wscott@ichips.intel.com>
At 02:38 09.03.00, Geoff Keating wrote:
>Wayne Scott <wscott@ichips.intel.com> writes:
>
> > Attached is a simple testcase of a function that returns a 'long long'
> >
> > GCC version 2.95.2 produced incorrect results when the optimizer is
> > enabled.
> >
> > # this is a IBM 397 with 1G of memory
> > $ uname -a
> > AIX pdxcs566 1 4 000111179400
>
>This appears to be fixed in the newppc-branch and so will be fixed in
>the next release. I'm not sure what patch fixed it or whether it's
>fixed in the mainline CVS.
The patch that fixed it is Richard Hendersons stupid.c-die-die-die patch. I
tried parts of the patch on the gcc-2_95-branch and this is the one that
fixes the testcase:
Index: stmt.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/stmt.c,v
retrieving revision 1.71.4.4
diff -u -p -r1.71.4.4 stmt.c
--- stmt.c 2000/01/07 22:41:20 1.71.4.4
+++ stmt.c 2000/03/10 11:56:01
@@ -2521,7 +2521,8 @@ expand_value_return (val)
#endif
emit_move_insn (return_reg, val);
}
- if (GET_CODE (return_reg) == REG
+ if (obey_regdecls
+ && GET_CODE (return_reg) == REG
&& REGNO (return_reg) < FIRST_PSEUDO_REGISTER)
emit_insn (gen_rtx_USE (VOIDmode, return_reg));
/* Handle calls that return values in multiple non-contiguous locations.
Somehow the USEs confuse other parts of the compiler, but unfortunately the
patch breaks the bootstrap of the gcc-2_95-branch :-(, so I'm probably
something missing here.
The question now is how do we want to proceed here? Should stupid.c die in
the gcc-2_95-branch too? Or should I try to find another solution, possibly
based on the above patch and other parts of the stupid.c patch? Any
ideas/hints?
Franz.