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: GCC 2.95.2 for AIX handles 'long long' incorrectly


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.


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