public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/31714]  New: [4.1 regression] default_conversion ICE while processing_template_decl
@ 2007-04-26 12:26 jakub at gcc dot gnu dot org
  2007-04-27  9:12 ` [Bug c++/31714] " pinskia at gcc dot gnu dot org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: jakub at gcc dot gnu dot org @ 2007-04-26 12:26 UTC (permalink / raw)
  To: gcc-bugs

template<short S>
void foo(void)
{
  const unsigned short m = S ? ((unsigned short) 0 | (unsigned short) 0) : 0;
  short t = 1 & m;
}

ICEs in:
#0  0x00000000005b136f in operand_equal_p (arg0=0x2aaaae123f60,
arg1=0x2aaaae123f90, flags=0) at ../../gcc/fold-const.c:2421
#1  0x00000000005b5792 in fold_binary (code=BIT_IOR_EXPR, type=0x2aaaae004420,
op0=0x2aaaae12d540, op1=0x2aaaae12d580)
    at ../../gcc/fold-const.c:8050
#2  0x00000000005bbde9 in fold_build2_stat (code=2919253024, type=0x0,
op0=0x74, op1=0x0) at ../../gcc/fold-const.c:10597
#3  0x00000000005445c6 in convert_to_integer (type=0x2aaaae004420, expr=<value
optimized out>) at ../../gcc/convert.c:641
#4  0x0000000000462e4a in ocp_convert (type=0x2aaaae004420, expr=<value
optimized out>, convtype=15, flags=35)
    at ../../gcc/cp/cvt.c:698
#5  0x00000000005445e9 in convert_to_integer (type=0x2aaaae004420,
expr=0x2aaaadff8730) at ../../gcc/convert.c:683
#6  0x0000000000462e4a in ocp_convert (type=0x2aaaae004420, expr=<value
optimized out>, convtype=15, flags=3)
    at ../../gcc/cp/cvt.c:698
#7  0x000000000045e349 in default_conversion (exp=0x2aaaae004420) at
../../gcc/cp/typeck.c:1435

as C++ specific trees (cast_expr in
 <bit_ior_expr 0x2aaaadff8780
    type <integer_type 0x2aaaae0044d0 int public type_6 SI
        size <integer_cst 0x2aaaadff2a20 constant invariant 32>
        unit size <integer_cst 0x2aaaadff2540 constant invariant 4>
        align 32 symtab 0 alias set -1 precision 32 min <integer_cst
0x2aaaadff2990 -2147483648> max <integer_cst 0x2aaaadff29c0 2147483647>
        pointer_to_this <pointer_type 0x2aaaae017790>>
    side-effects
    arg 0 <cast_expr 0x2aaaae12d540
        type <integer_type 0x2aaaae004420 short unsigned int public unsigned
type_6 HI
            size <integer_cst 0x2aaaadff2840 constant invariant 16>
            unit size <integer_cst 0x2aaaadff2870 constant invariant 2>
            align 16 symtab 0 alias set -1 precision 16 min <integer_cst
0x2aaaadff2960 0> max <integer_cst 0x2aaaadff2930 65535>>
        side-effects
        arg 0 <tree_list 0x2aaaae123f60
            value <integer_cst 0x2aaaae00f660 constant invariant 0>>>
    arg 1 <cast_expr 0x2aaaae12d580 type <integer_type 0x2aaaae004420 short
unsigned int>
        side-effects
        arg 0 <tree_list 0x2aaaae123f90 value <integer_cst 0x2aaaae00f660 0>>>>
are passed to convert_to_integer/fold.
This certainly didn't ICE in 3.2.3, and doesn't ICE in 4.2+ either
(I believe PR27506 made the difference here).


-- 
           Summary: [4.1 regression] default_conversion ICE while
                    processing_template_decl
           Product: gcc
           Version: 4.1.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jakub at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31714


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c++/31714] [4.1 regression] default_conversion ICE while processing_template_decl
  2007-04-26 12:26 [Bug c++/31714] New: [4.1 regression] default_conversion ICE while processing_template_decl jakub at gcc dot gnu dot org
@ 2007-04-27  9:12 ` pinskia at gcc dot gnu dot org
  2007-04-27  9:14 ` pinskia at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-04-27  9:12 UTC (permalink / raw)
  To: gcc-bugs



-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |pinskia at gcc dot gnu dot
                   |                            |org
   Target Milestone|---                         |4.1.3


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31714


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c++/31714] [4.1 regression] default_conversion ICE while processing_template_decl
  2007-04-26 12:26 [Bug c++/31714] New: [4.1 regression] default_conversion ICE while processing_template_decl jakub at gcc dot gnu dot org
  2007-04-27  9:12 ` [Bug c++/31714] " pinskia at gcc dot gnu dot org
@ 2007-04-27  9:14 ` pinskia at gcc dot gnu dot org
  2008-01-13 14:49 ` [Bug c++/31714] [4.1 Regression] " rguenth at gcc dot gnu dot org
  2008-07-04 16:06 ` jsm28 at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-04-27  9:14 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from pinskia at gcc dot gnu dot org  2007-04-27 10:13 -------
I actually think it is more related to PR 28341 than the other one.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ice-on-valid-code


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31714


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c++/31714] [4.1 Regression] default_conversion ICE while processing_template_decl
  2007-04-26 12:26 [Bug c++/31714] New: [4.1 regression] default_conversion ICE while processing_template_decl jakub at gcc dot gnu dot org
  2007-04-27  9:12 ` [Bug c++/31714] " pinskia at gcc dot gnu dot org
  2007-04-27  9:14 ` pinskia at gcc dot gnu dot org
@ 2008-01-13 14:49 ` rguenth at gcc dot gnu dot org
  2008-07-04 16:06 ` jsm28 at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2008-01-13 14:49 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from rguenth at gcc dot gnu dot org  2008-01-13 14:35 -------
Confirmed.

The bogus part is actually that we have two TREE_LISTs as arguments to
BIT_IOR_EXPR:

<<< Unknown tree: cast_expr
  0 >>>
 | <<< Unknown tree: cast_expr
  0 >>>

Where the CAST_EXPRs with the tree-list are built from

#1  0x08195455 in build_c_cast (type=0xb7b64228, expr=0xb7b539d8)
    at /home/richard/src/gcc-4_1-branch/gcc/cp/typeck.c:5283
5283                              tree_cons (NULL_TREE, value, NULL_TREE));
(gdb) l
5278        return error_mark_node;
5279    
5280      if (processing_template_decl)
5281        {
5282          tree t = build_min (CAST_EXPR, type,
5283                              tree_cons (NULL_TREE, value, NULL_TREE));
5284          /* We don't know if it will or will not have side effects.  */
5285          TREE_SIDE_EFFECTS (t) = 1;
5286          return convert_from_reference (t);
5287        }

Note this happens while executing the convert_to_integer part of

     return fold_if_not_in_template (convert_to_integer (type, e));

but processing_template_decl is true.

This may be a generic (and now latent) problem that the quasi middle-end
convert_to_integer does call fold itself.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
      Known to work|                            |4.2.3 4.3.0
   Last reconfirmed|0000-00-00 00:00:00         |2008-01-13 14:35:23
               date|                            |
            Summary|[4.1 regression]            |[4.1 Regression]
                   |default_conversion ICE while|default_conversion ICE while
                   |processing_template_decl    |processing_template_decl


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31714


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c++/31714] [4.1 Regression] default_conversion ICE while processing_template_decl
  2007-04-26 12:26 [Bug c++/31714] New: [4.1 regression] default_conversion ICE while processing_template_decl jakub at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2008-01-13 14:49 ` [Bug c++/31714] [4.1 Regression] " rguenth at gcc dot gnu dot org
@ 2008-07-04 16:06 ` jsm28 at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: jsm28 at gcc dot gnu dot org @ 2008-07-04 16:06 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from jsm28 at gcc dot gnu dot org  2008-07-04 16:05 -------
Closing 4.1 branch.


-- 

jsm28 at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
      Known to fail|                            |4.1.3
         Resolution|                            |FIXED
   Target Milestone|4.1.3                       |4.2.0


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31714


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2008-07-04 16:06 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-04-26 12:26 [Bug c++/31714] New: [4.1 regression] default_conversion ICE while processing_template_decl jakub at gcc dot gnu dot org
2007-04-27  9:12 ` [Bug c++/31714] " pinskia at gcc dot gnu dot org
2007-04-27  9:14 ` pinskia at gcc dot gnu dot org
2008-01-13 14:49 ` [Bug c++/31714] [4.1 Regression] " rguenth at gcc dot gnu dot org
2008-07-04 16:06 ` jsm28 at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).