Bug 16430 - [3.4/4.0 regression] ICE when returning non-C aggregates larger than 16 bytes
Summary: [3.4/4.0 regression] ICE when returning non-C aggregates larger than 16 bytes
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 3.4.0
: P2 normal
Target Milestone: 3.4.2
Assignee: Eric Botcazou
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-07-08 07:05 UTC by Eric Botcazou
Modified: 2004-09-13 14:15 UTC (History)
1 user (show)

See Also:
Host: sparc64-*-*
Target: sparc64-*-*
Build: sparc64-*-*
Known to work:
Known to fail:
Last reconfirmed: 2004-07-08 07:06:29


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Botcazou 2004-07-08 07:05:26 UTC
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.
Comment 1 Eric Botcazou 2004-07-08 07:06:29 UTC
Testing a fix.
Comment 2 GCC Commits 2004-07-08 14:33:28 UTC
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

Comment 3 GCC Commits 2004-07-08 14:36:55 UTC
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

Comment 4 Eric Botcazou 2004-07-08 14:38:55 UTC
See http://gcc.gnu.org/ml/gcc-patches/2004-07/msg00782.html