FX Coudert - [rs6000,patch] Fix ppc-specific problem with functions returning logical (original) (raw)

This is the mail archive of the gcc-patches@gcc.gnu.orgmailing 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]

:ADDPATCH rs6000:The following patch, by Andrew Pinski, fixes PR target/30406, a ppc- specific issue triggered by Fortran code for a function returning a logical(8) value. The patch was built and successfully regtested by Dominique Dhumières.OK for mainline, 4.2 and 4.1?

Thanks, FX

Index: gcc/config/rs6000/rs6000.c

--- gcc/config/rs6000/rs6000.c (revision 121773) +++ gcc/config/rs6000/rs6000.c (working copy) @@ -20437,7 +20437,7 @@ } if ((INTEGRAL_TYPE_P (valtype) - && TYPE_PRECISION (valtype) < BITS_PER_WORD) + && GET_MODE_BITSIZE (TYPE_MODE (valtype)) < BITS_PER_WORD) || POINTER_TYPE_P (valtype)) mode = TARGET_32BIT ? SImode : DImode; else Index: gcc/testsuite/gfortran.dg/logical_2.f90

--- gcc/testsuite/gfortran.dg/logical_2.f90 (revision 0) +++ gcc/testsuite/gfortran.dg/logical_2.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()

2007-02-10 Andrew Pinski <andrew_pinski@playstation.sony.com> PR target/30406
* config/rs6000/rs6000.c (rs6000_function_value): Look at bit size instead
of precision.
2007-02-10 Francois-Xavier Coudert coudert@clipper.ens.fr

PR target/30406
* gfortran.dg/logical_2.f90: New test.

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