public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/17404] New: gimplify ICE while trying to gimplify a stmt_expr
@ 2004-09-10 17:53 steven at gcc dot gnu dot org
  2004-09-10 17:54 ` [Bug c++/17404] " steven at gcc dot gnu dot org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: steven at gcc dot gnu dot org @ 2004-09-10 17:53 UTC (permalink / raw)
  To: gcc-bugs

$ ./cc1plus -quiet t.ii 
selection-chemistry.cpp: In function `SPItem*<unnamed>::next_item(SPDesktop*, 
GSList*, SPObject*, bool) [with D = <unnamed>::Forward]': 
selection-chemistry.cpp:1261:   instantiated from 
`SPItem*<unnamed>::next_item_from_list(SPDesktop*, const GSList*, SPObject*, 
bool) [with D = <unnamed>::Forward]' 
selection-chemistry.cpp:1202:   instantiated from here 
selection-chemistry.cpp:1282: internal compiler error: in gimplify_expr, at 
gimplify.c:3932 
 
We are trying to gimplify the following tree: 
 
#1  0x000000000056871c in gimplify_expr (expr_p=0x2a95916ab8, 
pre_p=0x7fbfffd888, post_p=0x7fbfffd510, 
    gimple_test_f=0x555500 <is_gimple_val>, fallback=fb_rvalue) at ../../
mainline/gcc/gimplify.c:3932 
3932                abort (); 
(gdb) p debug_tree (*expr_p) 
 <stmt_expr 0x2a98143540 
    type <integer_type 0x2a955978c0 int public type_6 SI 
        size <integer_cst 0x2a955959c0 constant invariant 32> 
        unit size <integer_cst 0x2a95595420 constant invariant 4> 
        align 32 symtab 0 alias set -1 precision 32 min <integer_cst 
0x2a95595960 -2147483648> max <integer_cst 0x2a95595990 2147483647> 
        pointer_to_this <pointer_type 0x2a95aa3d20> reference_to_this 
<reference_type 0x2a973a5540>> 
    side-effects 
    arg 0 <bind_expr 0x2a9680f230 side-effects tree_1 
        body <statement_list 0x2a981bb4e0 type <void_type 0x2a95aa3460 void> 
            side-effects> 
        selection-chemistry.cpp:1282>> 
$1 = void

-- 
           Summary: gimplify ICE while trying to gimplify a stmt_expr
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: steven at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org


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


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

* [Bug c++/17404] gimplify ICE while trying to gimplify a stmt_expr
  2004-09-10 17:53 [Bug c++/17404] New: gimplify ICE while trying to gimplify a stmt_expr steven at gcc dot gnu dot org
@ 2004-09-10 17:54 ` steven at gcc dot gnu dot org
  2004-09-10 19:40 ` [Bug c++/17404] [4.0 Regression] " belyshev at lubercy dot com
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: steven at gcc dot gnu dot org @ 2004-09-10 17:54 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From steven at gcc dot gnu dot org  2004-09-10 17:54 -------
Created an attachment (id=7089)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=7089&action=view)
Test case for this bug


-- 


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


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

* [Bug c++/17404] [4.0 Regression] gimplify ICE while trying to gimplify a stmt_expr
  2004-09-10 17:53 [Bug c++/17404] New: gimplify ICE while trying to gimplify a stmt_expr steven at gcc dot gnu dot org
  2004-09-10 17:54 ` [Bug c++/17404] " steven at gcc dot gnu dot org
@ 2004-09-10 19:40 ` belyshev at lubercy dot com
  2004-09-10 20:05 ` bangerth at dealii dot org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: belyshev at lubercy dot com @ 2004-09-10 19:40 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From belyshev at lubercy dot com  2004-09-10 19:40 -------
// small testcase for this bug:

template <typename T>
void foo ()
{
	__builtin_expect  (({0;}), 1);
}

class A {
};

void bar ()
{
	foo<A> ();
}


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2004-09-10 19:40:08
               date|                            |
            Summary|gimplify ICE while trying to|[4.0 Regression] gimplify
                   |gimplify a stmt_expr        |ICE while trying to gimplify
                   |                            |a stmt_expr
   Target Milestone|---                         |4.0.0


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


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

* [Bug c++/17404] [4.0 Regression] gimplify ICE while trying to gimplify a stmt_expr
  2004-09-10 17:53 [Bug c++/17404] New: gimplify ICE while trying to gimplify a stmt_expr steven at gcc dot gnu dot org
  2004-09-10 17:54 ` [Bug c++/17404] " steven at gcc dot gnu dot org
  2004-09-10 19:40 ` [Bug c++/17404] [4.0 Regression] " belyshev at lubercy dot com
@ 2004-09-10 20:05 ` bangerth at dealii dot org
  2004-09-10 22:22 ` pinskia at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: bangerth at dealii dot org @ 2004-09-10 20:05 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From bangerth at dealii dot org  2004-09-10 20:05 -------
Serge did all the hard work, but he forgot to take the last step 
and claim the cheap points for the smallest testcase :-) Good work, though, 
Serge! 
----------------- 
template <int> void foo () { 
        __builtin_expect  (({0;}), 1); 
} 
 
template void foo<1> (); 
----------------- 
 
g/x> /home/bangerth/bin/gcc-3.5-pre/bin/c++ -c x.cc 
x.cc: In function `void foo() [with int <anonymous> = 1]': 
x.cc:5:   instantiated from here 
x.cc:2: internal compiler error: in gimplify_expr, at gimplify.c:3832 
Please submit a full bug report, 
with preprocessed source if appropriate. 
See <URL:http://gcc.gnu.org/bugs.html> for instructions. 
 
W. 

-- 


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


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

* [Bug c++/17404] [4.0 Regression] gimplify ICE while trying to gimplify a stmt_expr
  2004-09-10 17:53 [Bug c++/17404] New: gimplify ICE while trying to gimplify a stmt_expr steven at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2004-09-10 20:05 ` bangerth at dealii dot org
@ 2004-09-10 22:22 ` pinskia at gcc dot gnu dot org
  2004-09-11 22:18 ` steven at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-09-10 22:22 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-09-10 22:22 -------
: Search converges between 2004-06-14-trunk (#466) and 2004-06-16-trunk (#467).

-- 


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


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

* [Bug c++/17404] [4.0 Regression] gimplify ICE while trying to gimplify a stmt_expr
  2004-09-10 17:53 [Bug c++/17404] New: gimplify ICE while trying to gimplify a stmt_expr steven at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2004-09-10 22:22 ` pinskia at gcc dot gnu dot org
@ 2004-09-11 22:18 ` steven at gcc dot gnu dot org
  2004-09-12  0:12 ` rth at gcc dot gnu dot org
  2004-09-12  4:48 ` rth at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: steven at gcc dot gnu dot org @ 2004-09-11 22:18 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From steven at gcc dot gnu dot org  2004-09-11 22:18 -------
Hmm... :-/ 
 
I hate to put this on RTH's plate too, but it was his patch that 
caused it.  I'm surprised, there is no gimlification code at all 
for a STMT_EXPR, but rth's patch added the build (STMT_EXPR, ...) 
that is causing this problem now. 
 
Richard, is the correct fix to simply take the STMT_EXPR_STMT out 
(which may only be, iiuc, a BIND_EXPR, a TRY_FINALLY_EXPR, or a 
TRY_CATCH_EXPR?) and gimplify that?  The old code looked like it 
did a lot more. 
 
Puzzling... 
 

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |rth at gcc dot gnu dot org


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


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

* [Bug c++/17404] [4.0 Regression] gimplify ICE while trying to gimplify a stmt_expr
  2004-09-10 17:53 [Bug c++/17404] New: gimplify ICE while trying to gimplify a stmt_expr steven at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2004-09-11 22:18 ` steven at gcc dot gnu dot org
@ 2004-09-12  0:12 ` rth at gcc dot gnu dot org
  2004-09-12  4:48 ` rth at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: rth at gcc dot gnu dot org @ 2004-09-12  0:12 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From rth at gcc dot gnu dot org  2004-09-12 00:12 -------
What you're missing is that STMT_EXPR isn't supposed to survive template
instantiation.  The problem is a simple matter of code in the wrong place.

As an aside, I'm going to have to inflict bodily harm on whoever decided
that having four different functions for instantiating expressions instead
of one was a good idea.

Testing a patch.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|rth at gcc dot gnu dot org  |
         AssignedTo|unassigned at gcc dot gnu   |rth at gcc dot gnu dot org
                   |dot org                     |
             Status|NEW                         |ASSIGNED


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


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

* [Bug c++/17404] [4.0 Regression] gimplify ICE while trying to gimplify a stmt_expr
  2004-09-10 17:53 [Bug c++/17404] New: gimplify ICE while trying to gimplify a stmt_expr steven at gcc dot gnu dot org
                   ` (5 preceding siblings ...)
  2004-09-12  0:12 ` rth at gcc dot gnu dot org
@ 2004-09-12  4:48 ` rth at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: rth at gcc dot gnu dot org @ 2004-09-12  4:48 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From rth at gcc dot gnu dot org  2004-09-12 04:48 -------
http://gcc.gnu.org/ml/gcc-patches/2004-09/msg01138.html

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED


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


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

end of thread, other threads:[~2004-09-12  4:48 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-09-10 17:53 [Bug c++/17404] New: gimplify ICE while trying to gimplify a stmt_expr steven at gcc dot gnu dot org
2004-09-10 17:54 ` [Bug c++/17404] " steven at gcc dot gnu dot org
2004-09-10 19:40 ` [Bug c++/17404] [4.0 Regression] " belyshev at lubercy dot com
2004-09-10 20:05 ` bangerth at dealii dot org
2004-09-10 22:22 ` pinskia at gcc dot gnu dot org
2004-09-11 22:18 ` steven at gcc dot gnu dot org
2004-09-12  0:12 ` rth at gcc dot gnu dot org
2004-09-12  4:48 ` rth 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).