This is the mail archive of the gcc-patches@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]
Other format: [Raw text]

Re: [rs6000,patch] Fix ppc-specific problem with functions returning logical(8) value


In general, the patch is okay on mainline and 4.2. Please do not include
the patch in 4.1.2.

Here's what I just commited to mainline (rev. 122523). 4.2 will follow after a short time.



Index: ChangeLog
===================================================================
--- ChangeLog (revision 122522)
+++ ChangeLog (working copy)
@@ -1,3 +1,9 @@
+2007-03-04 Andrew Pinski <andrew_pinski@playstation.sony.com>
+
+ PR target/30406
+ * config/rs6000/rs6000.c (rs6000_function_value): Look at bit size
+ instead of precision.
+
Index: config/rs6000/rs6000.c
===================================================================
--- config/rs6000/rs6000.c (revision 122522)
+++ config/rs6000/rs6000.c (working copy)
@@ -20562,12 +20562,10 @@
GEN_INT (12))));
}


- if ((INTEGRAL_TYPE_P (valtype)
- && TYPE_PRECISION (valtype) < BITS_PER_WORD)
+ mode = TYPE_MODE (valtype);
+ if ((INTEGRAL_TYPE_P (valtype) && GET_MODE_BITSIZE (mode) < BITS_PER_WORD)
|| POINTER_TYPE_P (valtype))
mode = TARGET_32BIT ? SImode : DImode;
- else
- mode = TYPE_MODE (valtype);


   if (DECIMAL_FLOAT_MODE_P (mode))
     {
2007-03-04  Roman Zippel <zippel@linux-m68k.org>
             Nathan Sidwell  <nathan@codesourcery.com>
Index: testsuite/ChangeLog
===================================================================
--- testsuite/ChangeLog (revision 122522)
+++ testsuite/ChangeLog (working copy)
@@ -1,3 +1,8 @@
+2007-03-04 Francois-Xavier Coudert <coudert@clipper.ens.fr>
+
+       PR target/30406
+       * gfortran.dg/logical_3.f90: New test.
+
2007-03-04  Thomas Koenig  <Thomas.Koenig@online.de>
        PR libfortran/30981
Index: testsuite/gfortran.dg/logical_3.f90
===================================================================
--- testsuite/gfortran.dg/logical_3.f90 (revision 0)
+++ testsuite/gfortran.dg/logical_3.f90 (revision 0)
@@ -0,0 +1,10 @@
+! { dg-do compile }
+! This checks the fix for PR30406.
+!
+! Contributed by Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
+!===============================================================
+
+function f()
+  logical(8) :: f
+  f = .false._8
+end function f


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