For the Ada testcase: procedure P is type my_array is array (1..6) of Integer; A : my_array; function Q return my_array is begin return A; end; begin A := Q; end P; I get with gcc -m64 on sparc-sun-solaris2.8: +===========================GNAT BUG DETECTED==============================+ | 3.4.1 (sparc-sun-solaris2.8) in hard_function_value, at explow.c:1565 | | Error detected at p.adb:6:3 | | Please submit a bug report; see http://gcc.gnu.org/bugs.html. | | Include the entire contents of this bug box in the report. | | Include the exact gcc or gnatmake command that you entered. | | Also include sources listed below in gnatchop format | | (concatenated together with no headers between files). | +==========================================================================+ The problem comes from the removing of OImode after GCC 3.2.x.
Testing a fix.
Subject: Bug 16430 CVSROOT: /cvs/gcc Module name: gcc Changes by: ebotcazou@gcc.gnu.org 2004-07-08 14:33:21 Modified files: gcc : ChangeLog gcc/config/sparc: sparc.c Log message: PR target/16430 * config/sparc/sparc.c (function_value): In 64-bit mode, return the aggregates larger than 16 bytes like unions. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=2.4377&r2=2.4378 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/sparc/sparc.c.diff?cvsroot=gcc&r1=1.313&r2=1.314
Subject: Bug 16430 CVSROOT: /cvs/gcc Module name: gcc Branch: gcc-3_4-branch Changes by: ebotcazou@gcc.gnu.org 2004-07-08 14:36:52 Modified files: gcc : ChangeLog gcc/config/sparc: sparc.c Log message: PR target/16430 * config/sparc/sparc.c (function_value): In 64-bit mode, return the aggregates larger than 16 bytes like unions. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=2.2326.2.541&r2=2.2326.2.542 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/sparc/sparc.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.271.4.16&r2=1.271.4.17
See http://gcc.gnu.org/ml/gcc-patches/2004-07/msg00782.html