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/16567] Nested function and variable-sized structure ICE


------- Additional Comments From bangerth at dealii dot org  2004-07-15 15:17 -------
BTW, the code is definitely invalid (even leaving aside the matter of 
variable-sized structures). You declare 
  int bar (int (*)(), int, void *); 
and call it with 
  int nested (struct s x) { return x.a + sizeof(x); } 
  bar (nested, argc, &t); 
Note that &nested does not satisfy the signature that bar() expects 
as first argument. It seems, however, as if we never even get to 
the point where gcc would like to check for this, it ICEs before that. 
 
Here's something that should be closer to validity: 
--------------- 
void bar (void *); 
 
int main(int argc, char **argv) { 
  struct s { char b[argc]; }; 
  int nested (struct s x) { return 0; } 
  struct s t; 
  bar ((void*)&nested); 
  return 0; 
} 
---------------- 
 
g/x> /home/bangerth/bin/gcc-3.5*/bin/gcc -c x.c 
x.c: In function `nested': 
x.c:5: internal compiler error: in make_decl_rtl, at varasm.c:758 
Please submit a full bug report, 
with preprocessed source if appropriate. 
See <URL:http://gcc.gnu.org/bugs.html> for instructions. 
 
g/x> /home/bangerth/bin/gcc-2.95.3/bin/gcc -c x.c 
x.c: In function `nested': 
x.c:5: Internal compiler error in `fix_lexical_addr', at function.c:5622 
Please submit a full bug report. 
See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions. 
 
W. 

-- 


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


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