Bug 11226 - [3.3/3.4 regression] [ia64] ICE passing struct arg with two floats
Summary: [3.3/3.4 regression] [ia64] ICE passing struct arg with two floats
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 3.3
: P2 critical
Target Milestone: 3.3.3
Assignee: Not yet assigned to anyone
URL:
Keywords: ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2003-06-17 22:39 UTC by janis187
Modified: 2004-01-17 04:22 UTC (History)
2 users (show)

See Also:
Host: ia64-unknown-linux-gnu
Target: ia64-unknown-linux-gnu
Build: ia64-unknown-linux-gnu
Known to work:
Known to fail:
Last reconfirmed: 2003-07-09 19:17:56


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description janis187 2003-06-17 22:39:47 UTC
GCC for ia64-linux gets an ICE compiling this test case, which is
extracted from gcc.dg/compat/struct-by-value-5_x.c:

-----------
typedef struct { float a; float b; } Sf2;

Sf2 g1, g2, g3, g4, g5, g6;

extern void testSf2 (Sf2, Sf2, Sf2, Sf2, Sf2, Sf2,
                     Sf2, Sf2, Sf2, Sf2, Sf2, Sf2);

void test2_Sf2 (Sf2 s1, Sf2 s2, Sf2 s3, Sf2 s4, Sf2 s5, Sf2 s6)
{
  testSf2 (s1, g1, s2, g2, s3, g3, s4, g4, s5, g5, s6, g6);
}
-----------

Output from gcc version 3.4 20030617 (experimental):

bug1.c: In function `test2_Sf2':
bug1.c:10: internal compiler error: in emit_block_move, at expr.c:1793
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.

The test case passes with 3.0.4 and 3.2 and fails with 3.3 and mainline.
It started failing with the following patch, which probably exposes some
latent target bug since the same test passes on several other platforms:

--- gcc/gcc/ChangeLog ---

2002-08-20  Richard Henderson  <rth@redhat.com>

        * expr.c (TARGET_MEM_FUNCTIONS): Transform to boolean.
        (emit_block_move): Split out subroutines.
        (emit_block_move_via_movstr): New.
        (emit_block_move_via_libcall): New.  Emit bcopy via normal call also.
        (emit_block_move_libcall_fn): New.  Construct function prototype for
        bcopy as well.
        (clear_storage): Split out subroutines.
        (clear_storage_via_clrstr): New.
        (clear_storage_via_libcall): New. Emit bzero as a normal call also.
        (clear_storage_libcall_fn): New.  Construct function prototype for
        bzero as well.
        (emit_push_insn): Use emit_block_move.
        (expand_assignment): Booleanize TARGET_MEM_FUNCTIONS.
        (store_constructor): Likewise.
Comment 1 Dara Hazeghi 2003-06-20 06:55:32 UTC
Confirmed with gcc 3.3 branch and mainline 20030616 for ia64-hpux as well. Bug occurs in both 
32bit and 64bit mode. Works fine with gcc 3.2.3, so this is a regression.
Comment 2 Mark Mitchell 2003-10-16 19:06:12 UTC
Postponed until GCC 3.3.3.
Comment 3 Andrew Pinski 2003-12-26 19:11:56 UTC
This no longer ICEs on the mainline but still does on the tree-ssa, so maybe something 
changed between the last time the tree-ssa was merged in or this is still a latent bug in 
3.4.
Comment 4 Steve Ellcey 2004-01-14 00:23:19 UTC
I believe this bug should be closed out.  I reproduced it on IA64 HP-UX with GCC
3.3.2 and then applied Jim Wilson's patch from 
http://gcc.gnu.org/ml/gcc-patches/2003-12/msg00145.html which is already on the
mainline and the 3.3 branch and it fixed the problem.  I didn't test the
tree-ssa branch but I think it has been merged onto that branch as well.  I
verified that it does not happen on ToT but I did not test Top-of-3.3 branch
(just official 3.3 with Jim's patch).
Comment 5 Andrew Pinski 2004-01-14 00:43:39 UTC
Fixed for 3.3.3.