------- Additional Comments From jakub at gcc dot gnu dot org  2005-03-04 00:29 
-------
I'm not sure if it is actually a bug in the compiler that compiles macro.c
or in libcpp.c.
The code in question is:
   cpp_token *token = _cpp_temp_token (pfile);
   token->type = (*paste_flag)->type;
   token->val.str = (*paste_flag)->val.str;
where val is a union of 2 pointers and struct cpp_string that has an uint,
4 bytes of padding and a pointer.
The difference between non-working and working libcpp is (as shown e.g. in
the assembly below) that the working one for the
token->val.str = (*paste_flag)->val.str;
assignment copies 16 bytes, i.e. len, 4 bytes of padding and text pointer,
while the non-working one copies only 4 bytes of val.str.len and 8 bytes
containing the val.str.text pointer, but not the padding.

Not sure why the uninitialized bits in the padding matter though, but apparently
they do.

-- 


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

Reply via email to