Re: AMD64. sign extension correct?

2005-02-27 Thread Falk Hueffner
Claus-Justus Heine <[EMAIL PROTECTED]> writes: > (signed long) = (signed int) x (unsigned int) > > Surprisingly the sign is not promoted in this case: > > a = -1 * 20, then a = 0x ffec > > IMHO, this is a bug. No, it isn't. In this context, -1 is converted to unsigned, yielding 0xff

Re: GCC-4.0 vs GCC-3.3.6 ia32 -Os: code size increase from 261 to 5339 bytes

2005-05-20 Thread Falk Hueffner
Etienne Lorrain <[EMAIL PROTECTED]> writes: > Shall I enter that on Bugzillia or is that a known problem? You should always enter it on bugzilla, if you cannot find this out for yourself. We have highly trained professionals who will swiftly close duplicate bug reports, and that way the report

Re: signed is undefined and has been since 1992 (in GCC)

2005-06-28 Thread Falk Hueffner
Michael Veksler <[EMAIL PROTECTED]> writes: > So maybe introduce a -fsigned-wraps flag, that the user can use > to make 'int' wrap even in loops. We have that already, it's called "-fwrapv". -- Falk

Re: signed is undefined and has been since 1992 (in GCC)

2005-06-28 Thread Falk Hueffner
"Joseph S. Myers" <[EMAIL PROTECTED]> writes: > Does -ftrapv ever take advantage of trapping instructions where the > hardware has them available? Yes, for example Alpha. > Does anyone make substantial use of -ftrapv in production There are rarely bug reports about it; for example pointer diffe

Re: Compatibility between cxx and g++

2005-07-05 Thread Falk Hueffner
"Julio Garvia Honrado" <[EMAIL PROTECTED]> writes: > I am trying to compile a C++ program (with cxx - Compaq compiler) > that uses a C++ shared library (compiled with g++), but several > 'unresolved' messages are reported. > > Is there any way to solve this incidence? No, the two compilers are in

Re: gcc-4.1-20050709: ICE in loop_givs_rescan, at loop.c:5517

2005-07-10 Thread Falk Hueffner
Dan Kegel <[EMAIL PROTECTED]> writes: > Likewise, compiling that version of gcc for alpha > dies while building the linux kernel, but for a different reason: > > {standard input}:496: Error: macro requires $at register while noat in effect > make[1]: *** [arch/alpha/kernel/core_cia.o] Error 1 Thi

Re: gcc-4.1-20050709: alpha: "macro requires $at register while noat in effect" while compiling Linux kernel

2005-07-10 Thread Falk Hueffner
Dan Kegel <[EMAIL PROTECTED]> writes: > Can somebody familiar with inline assembly guess whether the source > or the compiler are wrong here? > > --- snip --- > inline unsigned int > cia_bwx_ioread8(void *a) > { > return ({ unsigned char __kir; __asm__("ldbu %0,%1" : "=r"(__kir) : > "m"(*(volat

Re: attribute initialized

2005-07-12 Thread Falk Hueffner
"Dave Korn" <[EMAIL PROTECTED]> writes: >>From: Joe Buck >> >> there are no uninitialized variables, as the address of k is >> perfectly well defined. > > Indeed so, but I think Sylvester's point is that given that foo > takes a const pointer, the compiler could theoretically know that > foo ca

Re: Pointers in comparison expressions

2005-07-12 Thread Falk Hueffner
Erik Trulsson <[EMAIL PROTECTED]> writes: > On Tue, Jul 12, 2005 at 03:08:54PM -0700, Joe Buck wrote: >> On Tue, Jul 12, 2005 at 11:42:23PM +0200, Erik Trulsson wrote: >> > Pointer subtraction is only well defined if both pointers point to elements >> > in the same array (or one past the end of th

Re: Pointers in comparison expressions

2005-07-12 Thread Falk Hueffner
Joe Buck <[EMAIL PROTECTED]> writes: > On Wed, Jul 13, 2005 at 12:38:11AM +0200, Falk Hueffner wrote: >> Erik Trulsson <[EMAIL PROTECTED]> writes: >> > I believe most C compilers support it in practice, but few, if any, have >> > actually documented it

Re: volatile semantics

2005-07-17 Thread Falk Hueffner
Richard Henderson <[EMAIL PROTECTED]> writes: > I've got no interest in reading a thread with 250 messages wherein > language lawyers battle it out in a no-holds-barred grudge match. > Would someone like to summarize, preferably with a test case that > one side assumes to be miscompiled? Case 1:

Re: memcpy to an unaligned address

2005-08-02 Thread Falk Hueffner
Shaun Jackman <[EMAIL PROTECTED]> writes: > In a typical Ethernet/IP ARP header the source IP address is > unaligned. Instead of using... > out->srcIPAddr = in->dstIPAddr; > ... I used... > memcpy(&out->srcIPAddr, &in->dstIPAddr, sizeof(uint32_t)); > ... to account for the unaligned de

Question about pointer arithmetics in GIMPLE

2005-08-21 Thread Falk Hueffner
Hi, I'm trying to implement a tree pass that warns about bad array accesses as suggested for PR 8268 by Jeff Law. However, I have trouble with the following: char digit_vector[5]; const char *ggc_alloc_string(int length) { return digit_vector + ((length - 17) * 2); } this translates to: ggc

Re: Uninitialized use warning message

2005-08-27 Thread Falk Hueffner
Kean Johnston <[EMAIL PROTECTED]> writes: >> A common situation would be: >> if (condition) { >> flag = 1 >> msg = "Hello World"; >> } else >> flag = 0; [1] >> ... >> if (flag) >> printf ("I say, %s\n", m

Re: 20040309-1.c vs overflow being undefined

2005-11-27 Thread Falk Hueffner
Andrew Pinski <[EMAIL PROTECTED]> writes: > If we look at this testcase, we have a function like: > int foo(unsigned short x) > { > unsigned short y; > y = x > 32767 ? x - 32768 : 0; > return y; > } > > > x is promoted to a signed int by the front-end as the type > of 32768 is signed. So wh

Re: Problems with ?: operator

2005-12-15 Thread Falk Hueffner
Sulabh Nangalia <[EMAIL PROTECTED]> writes: > 5 < 10 ? a = 5 : a = 7; is giving error > 15 < 10 ? a = 5 : a = 7; is not giving any error > > why? Because of a bug in gcc. It's been fixed in 4.0, though. -- Falk

Re: insns for register-move between general and floating

2006-03-22 Thread Falk Hueffner
Greg McGary <[EMAIL PROTECTED]> writes: > I'm working on a port that has instructions to move bits between > 64-bit floating-point and 64-bit general-purpose regs. I say "bits" > because there's no conversion between float and int: the bit pattern > is unaltered. Therefore, it's possible to use

Re: [RFC] Ignore TREE_CONSTANT_OVERFLOW in integer_zerop

2006-04-02 Thread Falk Hueffner
Roger Sayle <[EMAIL PROTECTED]> writes: > [...] the patch below removes the TREE_CONSTANT_OVERFLOW checks from > integer_zerop, integer_onep, and friends in tree.c. Incidentally, this fixes PR 26729. -- Falk

Re: Idioms for byteswapping and unaligned memory access

2006-04-20 Thread Falk Hueffner
Olivier Galibert <[EMAIL PROTECTED]> writes: > I need to be able to do unaligned memory accesses to memory in > big-endian or little-endian mode. For portability, I'd like to do it > in pure C, but I'd like the compiler to generate optimal sequences for > the operations. It's probably not feasib

Re: building glibc-2.4 for alpha fails with "macro requires $at register while noat in effect"

2006-07-15 Thread Falk Hueffner
Mike Frysinger <[EMAIL PROTECTED]> writes: > i was trying to cross-compile glibc-2.4 with gcc-4.1.1 when it failed on me > while building ioperm.c ... poking around a bit, looks like the same issue > discussed here: > http://gcc.gnu.org/ml/gcc/2005-07/msg00371.html > however, this seems to have

Re: building glibc-2.4 for alpha fails with "macro requires $at register while noat in effect"

2006-07-15 Thread Falk Hueffner
Mike Frysinger <[EMAIL PROTECTED]> writes: > On Saturday 15 July 2006 05:12, Falk Hueffner wrote: >> The cheap fix is to have gcc not emit .arch ev4. I was planning on >> testing and submitting the following patch for this, but gcc didn't >> bootstrap for a few day