Bug 12575 - gcc fails to compile program
Summary: gcc fails to compile program
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 3.3.1
: P2 normal
Target Milestone: 3.4.0
Assignee: Not yet assigned to anyone
URL:
Keywords: ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2003-10-11 05:09 UTC by evan
Modified: 2004-01-10 06:51 UTC (History)
1 user (show)

See Also:
Host:
Target: x86_64-linux-gnu
Build:
Known to work:
Known to fail:
Last reconfirmed: 2003-10-11 16:15:39


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description evan 2003-10-11 05:09:35 UTC
gcc fails to compile a program, complaining of an unrecognizable insn.

Reading specs from
/usr/local/gcc-3.3.1/lib/gcc-lib/x86_64-unknown-linux-gnu/3.3.1/specs
Configured with: ../gcc-3.3.1/configure --prefix=/usr/local/gcc-3.3.1
--enable-threads --disable-nls --enable-languages=c,c++,f77
Thread model: posix
gcc version 3.3.1
 /usr/local/gcc-3.3.1/lib/gcc-lib/x86_64-unknown-linux-gnu/3.3.1/cc1 -E -quiet
-v -D__GNUC__=3 -D__GNUC_MINOR__=3 -D__GNUC_PATCHLEVEL__=1 bigadd.c bigadd.i
ignoring nonexistent directory
"/usr/local/gcc-3.3.1/x86_64-unknown-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/include
 /usr/local/gcc-3.3.1/include
 /usr/local/gcc-3.3.1/lib/gcc-lib/x86_64-unknown-linux-gnu/3.3.1/include
 /usr/include
End of search list.
 /usr/local/gcc-3.3.1/lib/gcc-lib/x86_64-unknown-linux-gnu/3.3.1/cc1
-fpreprocessed bigadd.i -quiet -dumpbase bigadd.c -auxbase bigadd -version -o
bigadd.s
GNU C version 3.3.1 (x86_64-unknown-linux-gnu)
        compiled by GNU C version 3.3.1.
GGC heuristics: --param ggc-min-expand=98 --param ggc-min-heapsize=127775
bigadd.c: In function `main':
bigadd.c:15: error: unrecognizable insn:
(insn/f 116 115 117 (nil) (parallel [
            (set (reg/f:DI 7 rsp)
                (plus:DI (reg/f:DI 7 rsp)
                    (const_int -2147483696 [0xffffffff7fffffd0])))
            (clobber (reg:CC 17 flags))
            (clobber (mem:BLK (scratch) [0 A8]))
        ]) -1 (nil)
    (nil))
bigadd.c:15: internal compiler error: in insn_default_length, at insn-attrtab.c:480

static float a[536870912],b[536870912];
main()
{
   long long i,n,m; float c[536870912];
   n=536870912;m=0;
   for(i=0;i<n;i+=10000){
       a[i]=i+1; b[i]=2.0*(i+1);
       c[i]=a[i]+b[i];
       m=i;
   }
   printf("a[0]=%g b[0]=%g c[0]=%g\n", a[0], b[0], c[0]);
   printf("n=%d a[%d]=%g b[%d]=%g c[%d]= %g\n", n, m, m, m, a[m], b[m], c[m]);
}
Comment 1 Andrew Pinski 2003-10-11 08:27:28 UTC
It happens on the mainline at least 20030819.
Comment 2 Andrew Pinski 2003-10-11 16:15:39 UTC
It still happens on the mainline (20031009).
Comment 3 Andrew Pinski 2004-01-10 06:51:29 UTC
Fixed by the following patches for 3.4:
2003-10-27  Jakub Jelinek  <jakub@redhat.com>
            Jan Hubicka  <jh@suse.cz>

        * reload1.c (struct elim_table): Change offset, initial_offset and
        previous_offset fields to HOST_WIDE_INT.
        (offsets_at): Change from int to HOST_WIDE_INT.
        (reload): Adjust offsets_at initialization.
        (eliminate_regs_in_insn): Change type of offset to HOST_WIDE_INT.
        (verify_initial_elim_offsets): Change type of t to HOST_WIDE_INT.
        * config/i386/i386.c (ix86_compute_frame_layout): Change offset type
        to HOST_WIDE_INT.  Don't save regs using mov for huge frame sizes
        if TARGET_64BIT.
        (pro_epilogue_adjust_stack): New function.
        (ix86_expand_prologue, ix86_expand_epilogue): Use it.
        * config/i386/i386.md (pro_epilogue_adjust_stack): Remove.
        (pro_epilogue_adjust_stack_1): Remove * in front of name.
        (pro_epilogue_adjust_stack_rex64): Handle -2147483648 properly.
        (pro_epilogue_adjust_stack_rex64_2): New insn.

        * config/i386/i386.c (ix86_expand_epilogue): Fix comment typo.

        * config/i386/i386.c (ix86_expand_call): Replace 40 with
        FIRST_REX_INT_REG + 3 /* R11 */.
2003-10-25  Jan Hubicka  <jh@suse.cz>

        * dwarf2out.c (dw_cfi_oprnd_struct): Offset is HOST_WIDE_INT.
        (cfa_loc): Likewise.
        (reg_save, stack_adjust_offset, queue_reg_save): Replace long by
        HOST_WIDE_INT.
        (args_size, old_args_size): change type to HOST_WIDE_INT.
        (dwarf2out_def_cfa, dwarf2out_args_size,
        dwarf2out_reg_save, new_loc_descr): offset is HOST_WIDE_INT.
        (dw_val_struct): integers, unsigneds and offsets are HOST_WIDE_INT.
        (add_AT_int, add_AT_unsigned, att_AT_offset, AT_int, AT_unsigned,
        AT_offset): Use HOST_WIDE_INT.
        (based_loc_descr): offset is HOST_WIDE_INT.
        (add_data_member): Likewise.
        (add_const_value_attribute): Simplify.