Messages in this thread |  | | Date | Wed, 6 Sep 2000 13:28:45 +1200 | From | Chris Wedgwood <> |
| |
On Tue, Sep 05, 2000 at 08:54:40PM -0400, Alexander Viro wrote:
If gcc will _ever_ fail to optimize away else in if (1) { ... } else { ... } - it's a bug in gcc. Sorry. Checking for the absence of code paths that would lead into block in question is trivial. I suspect that if you can demonstrate such example to gcc folks they will consider it as an obvious bug.
4al.o: file format elf32-i386
Disassembly of section .text:
00000000 <func>:
extern volatile int a;
int func() { 0: 55 push %ebp 1: 89 e5 mov %esp,%ebp if(1) a = 1; 3: c7 05 00 00 00 00 01 movl $0x1,0x0 a: 00 00 00 5: R_386_32 a d: eb 0b jmp 1a <func+0x1a> f: 90 nop else a = 5; 10: c7 05 00 00 00 00 05 movl $0x5,0x0 17: 00 00 00 12: R_386_32 a } 1a: c9 leave 1b: c3 ret - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org Please read the FAQ at http://www.tux.org/lkml/
|  |