This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug middle-end/15988] New: [3.5 regression] ICE in fold_convert with pointer-to-member-function


This is a recent regression that prevents me from doing any serious 
testing at present: 
------------------- 
struct X { void foo (); }; 
 
template <typename> 
inline void spawn (void (X::*fun_ptr)()) {} 
 
void bar () { 
  void (X::*const comp)() = &X::foo; 
  spawn<int> (comp); 
} 
--------------------- 
 
deal.II/lac> /home/bangerth/bin/gcc-3.5-pre/bin/c++ -O2 -c a.cc 
a.cc: In function `void bar()': 
a.cc:8: internal compiler error: in fold_convert, at fold-const.c:2003 
Please submit a full bug report, 
with preprocessed source if appropriate. 
See <URL:http://gcc.gnu.org/bugs.html> for instructions. 
 
The ICE goes away if I make the pointer one to a function, rather 
than to a member function. This suggests that at one point in fold_convert 
this case may simply have been forgotten. 
 
I award additional brownie points, if someone can explain the 
following oddities to me: 
- why does the ICE go away if 'spawn' isn't declared inline? 
- why does it go away if it isn't declared a template? (The 
  template parameter is unused, so shouldn't affect code generation 
  at all...) 
- why does the ICE go away if the 'comp' variable isn't declared 
  'const'? The variable is only set once, so the compiler could 
  figure this information out itself, and shouldn't try to generate 
  different code at all. 
 
W.

-- 
           Summary: [3.5 regression] ICE in fold_convert with pointer-to-
                    member-function
           Product: gcc
           Version: 3.5.0
            Status: UNCONFIRMED
          Keywords: ice-on-invalid-code
          Severity: normal
          Priority: P2
         Component: middle-end
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: bangerth at dealii dot org
                CC: gcc-bugs at gcc dot gnu dot org


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]