Bug 19185 - [4.4/4.5/4.6/4.7 Regression] ICE in cp_expr_size with PCC_STATIC_STRUCT_RETURN
Summary: [4.4/4.5/4.6/4.7 Regression] ICE in cp_expr_size with PCC_STATIC_STRUCT_RETURN
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 3.3.6
: P5 normal
Target Milestone: 4.4.7
Assignee: Not yet assigned to anyone
URL:
Keywords: build, ice-on-valid-code
: 19222 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-12-29 02:36 UTC by John David Anglin
Modified: 2011-12-20 18:53 UTC (History)
2 users (show)

See Also:
Host:
Target: vax-dec-ultrix4.3
Build:
Known to work:
Known to fail: 4.0.4
Last reconfirmed: 2005-01-29 17:35:01


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John David Anglin 2004-12-29 02:36:04 UTC
/xxx/gnu/gcc-3.4/objdir/gcc/xgcc -shared-libgcc -B/xxx/gnu/gcc-3.4/objdir/gcc/ -
nostdinc++ -L/xxx/gnu/gcc-3.4/objdir/vax-dec-ultrix4.3/libstdc++-v3/src -L/xxx/g
nu/gcc-3.4/objdir/vax-dec-ultrix4.3/libstdc++-v3/src/.libs -B/usr/local/vax-dec-
ultrix4.3/bin/ -B/usr/local/vax-dec-ultrix4.3/lib/ -isystem /usr/local/vax-dec-u
ltrix4.3/include -nostdinc++ -I/xxx/gnu/gcc-3.4/objdir/vax-dec-ultrix4.3/libstdc
++-v3/include/vax-dec-ultrix4.3 -I/xxx/gnu/gcc-3.4/objdir/vax-dec-ultrix4.3/libs
tdc++-v3/include -I../../../../gcc/libstdc++-v3/libsupc++ -I../../../../gcc/libs
tdc++-v3/libmath -g -O2 -fno-implicit-templates -Wall -Wno-format -W -Wwrite-str
ings -fdiagnostics-show-location=once -c ../../../../gcc/libstdc++-v3/src/comple
x_io.cc -o complex_io.o
/xxx/gnu/gcc-3.4/objdir/vax-dec-ultrix4.3/libstdc++-v3/include/complex: In
   function `std::basic_ostream<_CharT, _Traits>&
   std::operator<<(std::basic_ostream<_CharT, _Traits>&, const
   std::complex<_Tp>&) [with _Tp = float, _CharT = char, _Traits =
   std::char_traits<char>]':
../../../../gcc/libstdc++-v3/src/complex_io.cc:41:   instantiated from here
/xxx/gnu/gcc-3.4/objdir/vax-dec-ultrix4.3/libstdc++-v3/include/complex:391: inte
rnal compiler error: in
   cp_expr_size, at cp/cp-lang.c:308
Please submit a full bug report,
with preprocessed source if appropriate.

Breakpoint 1, cp_expr_size (exp=0x1374140) at ../../gcc/gcc/cp/cp-lang.c:308
308             abort ();
(gdb) p debug_tree (exp)
 <call_expr 01374140
    type <record_type 00580400 locale addressable needs-constructing type_1 
type_2 type_4 type_5 BLK
        size <integer_cst 00269ba0 constant 32>
        unit size <integer_cst 00269be0 constant 4>
        align 32 symtab 878 alias set 20
        fields <var_decl 00a14710 none type <integer_type 0086c070 unsigned int>
            readonly unsigned public static tree_1 in_system_header external 
nonlocal decl_3 decl_6 SI file /xxx/gnu/gcc-3.4/objdir/vax-dec-ultrix4.3/libstdc+
+-v3/include/bits/locale_classes.h line 84
            size <integer_cst 00268d60 constant 32> unit size <integer_cst 
00269be0 4>
            align 32 context <record_type 00580400 locale> initial <integer_cst 
009fad60 0>
            chain <var_decl 00a14780 ctype>> context <namespace_decl 00269ce0 
std>
       needs-constructor needs-destructor ~X() X() X(constX&) this=(X&) op() 
n_parents 0 use_template=0 interface-unknown
        member-functions <tree_vec 00a55800
            elt 0 <overload 00a19d50>
            elt 1 <function_decl 00a2c1c0 locale>
            elt 2 <function_decl 00a34f80 operator==>
            elt 3 <function_decl 00a362a0 operator!=>
            elt 4 <function_decl 00a2d9c0 operator=>
            elt 5 <overload 00a19cf0>
            elt 6 <overload 00a19e30>
            elt 7 <overload 00a19e20>
            elt 8 <function_decl 00a50400 __comp_dtor>
            elt 9 <function_decl 00a505c0 __base_dtor>
            elt 10 <function_decl 00a34c70 name>
            elt 11 <overload 00a19ce0>
            elt 12 <function_decl 00a3ef10 global>
            elt 13 <function_decl 00a3fc70 classic>
            elt 14 <function_decl 00a46800 _S_initialize>
            elt 15 <function_decl 00a46950 _S_normalize_category>
            elt 16 <function_decl 00a47000 _M_coalesce>>
        pointer_to_this <pointer_type 005804e0> reference_to_this <reference_type 
016ef0e0> chain <type_decl 00580550 locale>>
    side-effects
    arg 0 <addr_expr 0134b168
        type <pointer_type 0134ace0 type <method_type 00e1aa30>
            unsigned SI size <integer_cst 00269ba0 32> unit size <integer_cst 
00269be0 4>
            align 32 symtab 0 alias set -1>
        constant
        arg 0 <function_decl 00e224e0 imbue type <method_type 00e1aa30>
            addressable used public in_system_header external QI file /xxx/gnu/
gcc-3.4/objdir/vax-dec-ultrix4.3/libstdc++-v3/include/bits/basic_ios.tcc line 140 
context <record_type 004f3000 basic_ios<char,std::char_traits<char> >> arguments 
<parm_decl 00e22550 this> initial <block 00cb9694>
            template-info 00712348
            (mem:QI (symbol_ref:SI 
("_ZNSt9basic_iosIcSt11char_traitsIcEE5imbueERKSt6locale")) [0 S1 A8]) chain <
function_decl 00e22710 narrow>>>
    arg 1 <tree_list 0134b0f0
        value <nop_expr 0134b0dc type <pointer_type 004f30e0>

            arg 0 <plus_expr 0134a920 type <pointer_type 004f30e0>

                arg 0 <nop_expr 0134b0c8 type <pointer_type 004f30e0>

                    arg 0 <addr_expr 0134b050 type <pointer_type 004f4b80>
                        arg 0 <var_decl 012926a0 __s>>>
                arg 1 <integer_cst 00cec2c0 constant 104>>>
        chain <tree_list 0134b140
            value <nop_expr 0134b12c type <reference_type 00580780>
                side-effects
                arg 0 <nop_expr 0134b118 type <pointer_type 00a2f5c0>
                    side-effects
                    arg 0 <addr_expr 0134b104 type <pointer_type 005804e0>
                        side-effects
                        arg 0 <target_expr 0134a8c0 type <record_type 00580400 
locale>
                            side-effects addressable arg 0 <var_decl 0134ac70> 
arg 2 <call_expr 0134a8a0> arg 3 <compound_expr 013741e0>>>>>>>>
$1 = void
(gdb) bt
#0  cp_expr_size (exp=0x1374140) at ../../gcc/gcc/cp/cp-lang.c:308
#1  0xf29e3 in expr_size (exp=0x1374140) at ../../gcc/gcc/explow.c:293
#2  0xf895a in store_expr (exp=0x1374140, target=0x16edc9c, want_value=0)
    at ../../gcc/gcc/expr.c:4577
#3  0xf836e in expand_assignment (to=0x134ad50, from=0x1374140, want_value=0,
    suggest_reg=1) at ../../gcc/gcc/expr.c:4310
#4  0xfcd04 in expand_expr (exp=0x1374160, target=0x23da10, tmode=VOIDmode,
    modifier=EXPAND_NORMAL) at ../../gcc/gcc/expr.c:9055
#5  0xca8ae in expand_expr_stmt_value (exp=0x1374160, want_value=0,
    maybe_last=1) at ../../gcc/gcc/stmt.c:2184
#6  0x97397 in genrtl_expr_stmt_value (expr=0x1374160, want_value=0,
    maybe_last=1) at ../../gcc/gcc/c-semantics.c:354
#7  0x97b59 in expand_stmt (t=0x1373f5c) at ../../gcc/gcc/c-semantics.c:788
#8  0x979b4 in genrtl_compound_stmt (t=0x1373f48)
    at ../../gcc/gcc/c-semantics.c:701
#9  0x97b6b in expand_stmt (t=0x1373f48) at ../../gcc/gcc/c-semantics.c:815
#10 0x8e82b in c_expand_expr (exp=0x1373f70, target=0x23da10, tmode=VOIDmode,
    modifier=0) at ../../gcc/gcc/c-common.c:4292
#11 0x1f9f5 in cxx_expand_expr (exp=0x1373f70, target=0x23da10,
    tmode=VOIDmode, modifier=0) at ../../gcc/gcc/cp/expr.c:124
#12 0xffb2c in expand_expr (exp=0x1373f70, target=0x23da10, tmode=VOIDmode,
    modifier=EXPAND_NORMAL) at ../../gcc/gcc/expr.c:9467
#13 0xf884e in store_expr (exp=0x1374180, target=0x16edc9c, want_value=0)
---Type <return> to continue, or q <return> to quit---
    at ../../gcc/gcc/expr.c:4368
#14 0xfcd4e in expand_expr (exp=0x134a9e0, target=0x23da10, tmode=VOIDmode,
    modifier=EXPAND_NORMAL) at ../../gcc/gcc/expr.c:9043
#15 0xca8ae in expand_expr_stmt_value (exp=0x134a9e0, want_value=0,
    maybe_last=0) at ../../gcc/gcc/stmt.c:2184
#16 0x97397 in genrtl_expr_stmt_value (expr=0x134a9e0, want_value=0,
    maybe_last=0) at ../../gcc/gcc/c-semantics.c:354
#17 0x97b59 in expand_stmt (t=0x13456bc) at ../../gcc/gcc/c-semantics.c:788
#18 0x979b4 in genrtl_compound_stmt (t=0x115848c)
    at ../../gcc/gcc/c-semantics.c:701
#19 0x97b6b in expand_stmt (t=0x1158464) at ../../gcc/gcc/c-semantics.c:815
#20 0x979b4 in genrtl_compound_stmt (t=0x1158450)
    at ../../gcc/gcc/c-semantics.c:701
#21 0x97b6b in expand_stmt (t=0x1158450) at ../../gcc/gcc/c-semantics.c:815
#22 0x7d042 in expand_body (fn=0x123e950) at ../../gcc/gcc/cp/semantics.c:2401
#23 0x2bcbe in instantiate_decl (d=0x123e950, defer_ok=0)
    at ../../gcc/gcc/cp/pt.c:10578
#24 0x2bf87 in instantiate_pending_templates () at ../../gcc/gcc/cp/pt.c:10655
#25 0x3b13c in finish_file () at ../../gcc/gcc/cp/decl2.c:2807
#26 0x7c3ed in finish_translation_unit () at ../../gcc/gcc/cp/semantics.c:1600
#27 0x5a28a in yyparse () at parse.y:489
#28 0x97d65 in c_common_parse_file (set_yydebug=0) at ../../gcc/gcc/c-lex.c:159
#29 0xb5921 in compile_file () at ../../gcc/gcc/toplev.c:2130
---Type <return> to continue, or q <return> to quit---
#30 0xba2e5 in do_compile () at ../../gcc/gcc/toplev.c:5414
#31 0xba35c in toplev_main (argc=37, argv=0x7fffc060)
    at ../../gcc/gcc/toplev.c:5444
#32 0x9ef8e in main (argc=37, argv=0x7fffc060, 2147467512)
    at ../../gcc/gcc/main.c:35
(gdb) p debug_tree (0x134ad50)
 <var_decl 0134ad50
    type <record_type 00580400 locale addressable needs-constructing type_1 
type_2 type_4 type_5 BLK
        size <integer_cst 00269ba0 constant 32>
        unit size <integer_cst 00269be0 constant 4>
        align 32 symtab 878 alias set 20
        fields <var_decl 00a14710 none type <integer_type 0086c070 unsigned int>
            readonly unsigned public static tree_1 in_system_header external 
nonlocal decl_3 decl_6 SI file /xxx/gnu/gcc-3.4/objdir/vax-dec-ultrix4.3/libstdc+
+-v3/include/bits/locale_classes.h line 84
            size <integer_cst 00268d60 constant 32> unit size <integer_cst 
00269be0 4>
            align 32 context <record_type 00580400 locale> initial <integer_cst 
009fad60 0>
            chain <var_decl 00a14780 ctype>> context <namespace_decl 00269ce0 
std>
       needs-constructor needs-destructor ~X() X() X(constX&) this=(X&) op() 
n_parents 0 use_template=0 interface-unknown
        member-functions <tree_vec 00a55800
            elt 0 <overload 00a19d50>
            elt 1 <function_decl 00a2c1c0 locale>
            elt 2 <function_decl 00a34f80 operator==>
            elt 3 <function_decl 00a362a0 operator!=>
            elt 4 <function_decl 00a2d9c0 operator=>
            elt 5 <overload 00a19cf0>
            elt 6 <overload 00a19e30>
            elt 7 <overload 00a19e20>
            elt 8 <function_decl 00a50400 __comp_dtor>
            elt 9 <function_decl 00a505c0 __base_dtor>
            elt 10 <function_decl 00a34c70 name>
            elt 11 <overload 00a19ce0>
            elt 12 <function_decl 00a3ef10 global>
            elt 13 <function_decl 00a3fc70 classic>
            elt 14 <function_decl 00a46800 _S_initialize>
            elt 15 <function_decl 00a46950 _S_normalize_category>
            elt 16 <function_decl 00a47000 _M_coalesce>>
        pointer_to_this <pointer_type 005804e0> reference_to_this <reference_type 
016ef0e0> chain <type_decl 00580550 locale>>
    addressable used BLK file /xxx/gnu/gcc-3.4/objdir/vax-dec-ultrix4.3/libstdc++
-v3/include/complex line 391 size <integer_cst 00269ba0 32> unit size <
integer_cst 00269be0 4>
    align 32 context <function_decl 0123e950 operator<<>
    (mem/s:BLK (plus:SI (reg/f:SI 17 virtual-stack-vars)
        (const_int -248 [0xffffff08])) [20 A32])>


% ./xgcc -B./ -v
Reading specs from ./specs
Configured with: ../gcc/configure --prefix=/usr/local --with-gnu-as --with-gnu-ld 
--disable-nls : (reconfigured) ../gcc/configure --prefix=/usr/local --with-gnu-as 
--with-gnu-ld --disable-nls
Thread model: single
gcc version 3.3.6 20041218 (prerelease)
Comment 1 John David Anglin 2004-12-30 04:35:21 UTC
FWIW, I'm able to duplicate with an x86 cross to vax-ultrix.  It looks as if
the problem lies here:

         /* If store_expr stores a DECL whose DECL_RTL(exp) == TARGET,
            but TARGET is not valid memory reference, TEMP will differ
            from TARGET although it is really the same location.  */
      && (TREE_CODE_CLASS (TREE_CODE (exp)) != 'd'
          || target != DECL_RTL_IF_SET (exp))
      /* If there's nothing to copy, don't bother.  Don't call expr_size
         unless necessary, because some front-ends (C++) expr_size-hook
         aborts on objects that are not supposed to be bit-copied or
         bit-initialized.  */
      && expr_size (exp) != const0_rtx)
Comment 2 John David Anglin 2004-12-31 00:06:55 UTC
I believe that this error occurs because vax.h defines PCC_STATIC_STRUCT_RETURN.
Removing this define allows the complilation of this file to complete.
Comment 3 Andrew Pinski 2005-01-29 17:35:01 UTC
Confirmed, there is another dup of this bug.  I have seen somewhere PCC_STATIC_STRUCT_RETURN 
causes problems with c++ before.
Comment 4 Andrew Pinski 2005-01-29 17:36:21 UTC
*** Bug 19222 has been marked as a duplicate of this bug. ***
Comment 6 Andrew Pinski 2005-09-10 05:47:24 UTC
Moving to 4.2 based on VAX is not a primary or secondary target.
Comment 7 Jorn Wolfgang Rennecke 2006-02-13 19:01:09 UTC
(In reply to comment #2)
> I believe that this error occurs because vax.h defines
> PCC_STATIC_STRUCT_RETURN.
> Removing this define allows the complilation of this file to complete.

FWIW that means that some m68k targets might be affected too.
But according to grep, vax.h and m68k.h are the only files defining this.

Comment 8 dave 2006-02-13 19:23:15 UTC
Subject: Re:  [3.4/4.0/4.1/4.2 Regression] ICE: cp_expr_size, at cp/cp-lang.c:308

> (In reply to comment #2)
> > I believe that this error occurs because vax.h defines
> > PCC_STATIC_STRUCT_RETURN.
> > Removing this define allows the complilation of this file to complete.
> 
> FWIW that means that some m68k targets might be affected too.
> But according to grep, vax.h and m68k.h are the only files defining this.

Sometime ago I tested removing this define on vax-ultrix and had a
successful build.  While it's the default, I think it was a bad idea
and should be removed.  There's still -fpcc-struct-return that can be
used when needed.

Dave
Comment 9 Mark Mitchell 2006-05-25 02:35:40 UTC
Will not be fixed in 4.1.1; adjust target milestone to 4.1.2.
Comment 10 Joseph S. Myers 2008-07-04 16:47:46 UTC
Closing 4.1 branch.
Comment 11 Joseph S. Myers 2009-03-31 16:43:51 UTC
Closing 4.2 branch.
Comment 12 Richard Biener 2009-08-04 12:26:12 UTC
GCC 4.3.4 is being released, adjusting target milestone.
Comment 13 Richard Biener 2010-05-22 18:10:12 UTC
GCC 4.3.5 is being released, adjusting target milestone.
Comment 14 Richard Biener 2011-06-27 12:13:08 UTC
4.3 branch is being closed, moving to 4.4.7 target.
Comment 15 Jason Merrill 2011-12-20 18:11:32 UTC
The expr size langhook was removed in GCC 4.5; I expect that this ICE went away then, too.
Comment 16 John David Anglin 2011-12-20 18:53:24 UTC
The target machine is no longer available.  So, based on Jason's
comment, I am closing this PR.