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]

Re: a bug in printf checking?


 > From: Kazu Hirata <kazu@hxi.com>
 > 
 > Hi,
 > 
 > I am trying out the latest CVS snapshot.  The attached code causes
 > h8300-hms-gcc to crash.

I can't seem to configure with the above triplet, but I managed to
reproduce the symptoms you describe with a cross compiler targetting
h8300-hitachi-hms.


 >   It seems that this starts happening right
 > around the following patch.  (I rolled back right before the patch,
 > and gcc was OK.)
 > 
 > http://gcc.gnu.org/ml/gcc-cvs/2000-10/msg00075.html

Yes, that patch is definitely the trigger.


 > Interestingly, -O0 does not cause the problem.  I haven't looked into
 > details yet.

That's because the patch code in question for builtin printf is not
active at -O0.


 > printf.c: In function `test':
 > printf.c:10: Tree check: expected class 'd', have 'c' (string_cst)
 > printf.c:10: Internal compiler error in output_constant_def, at varasm.c:3123
 >   printf ("Hello, world!\n");

I think I know what's wrong, I'm not setting the TREE_TYPE correctly
after calling build_string.  Passing the new STRING_CST tree to
combine_strings() should do it right.  I'll submit a patch after some
testing.

		--Kaveh
--
Kaveh R. Ghazi			Engagement Manager / Project Services
ghazi@caip.rutgers.edu		Qwest Internet Solutions

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