public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH, ARM] arm_return_in_msb needs to handle TImode.
@ 2012-10-22 14:19 Matti, Manjunath
  2012-10-22 14:49 ` Richard Earnshaw
  0 siblings, 1 reply; 2+ messages in thread
From: Matti, Manjunath @ 2012-10-22 14:19 UTC (permalink / raw)
  To: gcc-patches; +Cc: pinskia

[-- Attachment #1: Type: text/plain, Size: 1979 bytes --]

Hi,

I observed the following failure on arm big-endian: 

FAIL: tmpdir-g++.dg-struct-layout-1/t024 cp_compat_x_tst.o compile,  (internal compiler error)

The compiler is configured as:

armeb-montavista-linux-gnueabi-gcc -v

Using built-in specs.
COLLECT_GCC=./armeb-tools/bin/armeb-montavista-linux-gnueabi-gcc
COLLECT_LTO_WRAPPER=/home/manjunath/NCDtools/mips/toolchain/armeb-tools/bin/../libexec/gcc/armeb-montavista-linux-gnueabi/4.7.0/lto-wrapper
Target: armeb-montavista-linux-gnueabi
Configured with: /home/manjunath/NCDtools/mips/toolchain/scripts/../src/configure --disable-fixed-point --without-ppl --without-python --disable-werror --enable-checking --with-sysroot --with-local-prefix=/home/manjunath/NCDtools/mips/toolchain/scripts/../armeb-tools/armeb-montavista-linux-gnueabi/sys-root --disable-sim --enable-symvers=gnu --enable-__cxa_atexit --with-arch=armv7-a --with-fpu=vfpv3-d16 --with-float=hard --with-tune=cortex-a9 --target=armeb-montavista-linux-gnueabi --enable-languages=c,c++ --prefix=/home/manjunath/NCDtools/mips/toolchain/scripts/../armeb-tools
Thread model: posix
gcc version 4.7.0 () 


Debugging shows that ITmode is not handled by arm_return_in_msb

debug snip ...
{{{
void test2001() void test2002() void test2003() void test2004() void test2005()
Breakpoint 1, shift_return_value (mode=TImode, left_p=0 '\000', value=0x7ffff033b380)
    at /home/manjunath/NCDtools/mips/toolchain/scripts/../src/gcc/calls.c:2127
2127      gcc_assert (REG_P (value) && HARD_REGISTER_P (value));

(gdb) p mode
$1 = TImode

(gdb) p left_p
$2 = 0 '\000'

(gdb) p debug_rtx(value)
(parallel:TI [
        (expr_list:REG_DEP_TRUE (reg:DI 63 s0)
            (const_int 0 [0]))
        (expr_list:REG_DEP_TRUE (reg:DI 65 s2)
            (const_int 8 [0x8]))
    ])
$3 = void
}}}

I have attached the patch which fixes the above problem, kindly review the patch
and accept it for mainline.


Regards,
Manjunath S Matti.

[-- Attachment #2: TImode_fix.patch --]
[-- Type: application/octet-stream, Size: 348 bytes --]

--- a/gcc/config/arm/arm.c
+++ b/gcc/config/arm/arm.c
@@ -9732,6 +9732,7 @@ arm_return_in_msb (const_tree valtype)
 {
   return (TARGET_AAPCS_BASED
           && BYTES_BIG_ENDIAN
+          && TYPE_MODE (valtype) != TImode
 	  && (AGGREGATE_TYPE_P (valtype)
 	      || TREE_CODE (valtype) == COMPLEX_TYPE
 	      || FIXED_POINT_TYPE_P (valtype)));

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH, ARM] arm_return_in_msb needs to handle TImode.
  2012-10-22 14:19 [PATCH, ARM] arm_return_in_msb needs to handle TImode Matti, Manjunath
@ 2012-10-22 14:49 ` Richard Earnshaw
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Earnshaw @ 2012-10-22 14:49 UTC (permalink / raw)
  To: Matti, Manjunath; +Cc: gcc-patches, pinskia

On 22/10/12 15:14, Matti, Manjunath wrote:
> Hi,
>
> I observed the following failure on arm big-endian:
>
> FAIL: tmpdir-g++.dg-struct-layout-1/t024 cp_compat_x_tst.o compile,  (internal compiler error)
>
> The compiler is configured as:
>
> armeb-montavista-linux-gnueabi-gcc -v
>
> Using built-in specs.
> COLLECT_GCC=./armeb-tools/bin/armeb-montavista-linux-gnueabi-gcc
> COLLECT_LTO_WRAPPER=/home/manjunath/NCDtools/mips/toolchain/armeb-tools/bin/../libexec/gcc/armeb-montavista-linux-gnueabi/4.7.0/lto-wrapper
> Target: armeb-montavista-linux-gnueabi
> Configured with: /home/manjunath/NCDtools/mips/toolchain/scripts/../src/configure --disable-fixed-point --without-ppl --without-python --disable-werror --enable-checking --with-sysroot --with-local-prefix=/home/manjunath/NCDtools/mips/toolchain/scripts/../armeb-tools/armeb-montavista-linux-gnueabi/sys-root --disable-sim --enable-symvers=gnu --enable-__cxa_atexit --with-arch=armv7-a --with-fpu=vfpv3-d16 --with-float=hard --with-tune=cortex-a9 --target=armeb-montavista-linux-gnueabi --enable-languages=c,c++ --prefix=/home/manjunath/NCDtools/mips/toolchain/scripts/../armeb-tools
> Thread model: posix
> gcc version 4.7.0 ()
>
>
> Debugging shows that ITmode is not handled by arm_return_in_msb
>
> debug snip ...
> {{{
> void test2001() void test2002() void test2003() void test2004() void test2005()
> Breakpoint 1, shift_return_value (mode=TImode, left_p=0 '\000', value=0x7ffff033b380)
>      at /home/manjunath/NCDtools/mips/toolchain/scripts/../src/gcc/calls.c:2127
> 2127      gcc_assert (REG_P (value) && HARD_REGISTER_P (value));
>
> (gdb) p mode
> $1 = TImode
>
> (gdb) p left_p
> $2 = 0 '\000'
>
> (gdb) p debug_rtx(value)
> (parallel:TI [
>          (expr_list:REG_DEP_TRUE (reg:DI 63 s0)
>              (const_int 0 [0]))
>          (expr_list:REG_DEP_TRUE (reg:DI 65 s2)
>              (const_int 8 [0x8]))
>      ])
> $3 = void
> }}}
>
> I have attached the patch which fixes the above problem, kindly review the patch
> and accept it for mainline.
>
>
> Regards,
> Manjunath S Matti.=
>
>
> TImode_fix.patch
>
>
> N\x18¬n‡r¥ªíÂ)emçhÂyhiם¢w^™©Ý
>


That doesn't look right.  The test is far too specific.  Even if this is 
the right place for the fix (and I'm yet to be convinced that it is), 
you should be testing that the size of mode is less than some limit, not 
that it's not a specific mode.

R.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-10-22 14:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-22 14:19 [PATCH, ARM] arm_return_in_msb needs to handle TImode Matti, Manjunath
2012-10-22 14:49 ` Richard Earnshaw

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).