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 c++/17655] [3.3/3.4 regression] ICE with using a C99 initializer in an if-condition


------- Additional Comments From bangerth at dealii dot org  2004-09-24 20:35 -------
In reply to comment #7: 
No I hadn't. I have now, and I can indeed reproduce the failure. Here's 
a smaller testcase: 
------------------------ 
template<typename T> void foo() { 
  if (((union { char __d; }) { 0 }).__d) {} 
} 
 
template void  foo<char>(); 
------------------------ 
This fails with gcc 3.2.3, 3.3.4, and 3.4.2, but not mainline or 2.95.3: 
 
g/x> /home/bangerth/bin/gcc-3.4-pre/bin/c++ -c x.ii  
x.ii: In function `void foo() [with T = char]': 
x.ii:5:   instantiated from here 
x.ii:2: internal compiler error: Segmentation fault 
Please submit a full bug report, 
with preprocessed source if appropriate. 
See <URL:http://gcc.gnu.org/bugs.html> for instructions. 
 
It is thus a regression, although one that is fixed on mainline already. 
Note that the exact same thing happens if I replace "union" with "struct". 
On the other hand, the bug goes away if I move the declaration of the 
union/struct to outside the if-clause; this indicates that it has something 
to do with the C99 initializer syntax used here. 
 
W. 
 
W. 

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
      Known to fail|                            |3.2.3 3.3.3 3.4.0
      Known to work|                            |2.95 4.0.0
   Last reconfirmed|0000-00-00 00:00:00         |2004-09-24 20:35:58
               date|                            |
            Summary|g++ getting SEGFAULT        |[3.3/3.4 regression] ICE
                   |compilling the code with    |with using a C99 initializer
                   |HUGE_VAL comparasions       |in an if-condition


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


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