[RFC] ordered comparison of pointer with integer zero warning in Wextra

2006-12-17 Thread Manuel López-Ibáñez
Dear all, Currently Wextra warns about a pointer compared against integer zero with <, <=, >, or >=. This warning is not available in C++ (the documentation does not say this) and it is implemented in gcc/c-typeck.c (build_binary_op) in this manner: else if (code0 == POINTER_TYPE && null_po

Char shifts promoted to int. Why?

2006-12-17 Thread Rask Ingemann Lambertsen
Hi. I seem unable to get a QImode shift instruction from this code: unsigned char x; void qishifttest2 (unsigned int c) { x <<= c; } Already at the first tree dump, there's a promotion to int: ;; Function qishifttest2 (qishifttest2) ;; enabled by -tree-original { x = (unsig

Re: Char shifts promoted to int. Why?

2006-12-17 Thread Chris Lattner
On Dec 17, 2006, at 12:40 PM, Rask Ingemann Lambertsen wrote: Hi. I seem unable to get a QImode shift instruction from this code: unsigned char x; void qishifttest2 (unsigned int c) { x <<= c; } should have been generated. Also, notice the redundant zero extension. Why are we

Re: Char shifts promoted to int. Why?

2006-12-17 Thread Paul Schlie
Chris Lattner wrote: > On Dec 17, 2006, at 12:40 PM, Rask Engelmann Lamberts wrote: >> I seem unable to get a QImode shift instruction from this code: >> >> unsigned char x; >> >> void qishifttest2 (unsigned int c) >> { >>x <<= c; >> } >> >> should have been generated. Also, notice the redunda

Re: Char shifts promoted to int. Why?

2006-12-17 Thread Paul Brook
On Monday 18 December 2006 01:15, Paul Schlie wrote: > Chris Lattner wrote: > > On Dec 17, 2006, at 12:40 PM, Rask Engelmann Lamberts wrote: > >> I seem unable to get a QImode shift instruction from this code: > >> > >> unsigned char x; > >> > >> void qishifttest2 (unsigned int c) > >> { > >>x

Defining cmd line symbolic literals

2006-12-17 Thread Mohamed Shafi
Hello all, I am building a GCC Compiler. I have some ifdef checks in the compiler source code. In case i define a symbolic literal in command line while compiling a sample program, I want that set of statements to be invoked after ifdef checks. e.g. GCC Source: #ifdef SHAFI_DEBUG printf("\n Shaf