signed enum bug

Aaron Coleman acoleman@lowrance.com
Fri Feb 25 21:35:00 GMT 2005


[My first time at reporting, so please bear with me if I do something wrong...]
 
The compiler outputs a bg branch instruction when it should use a bgu. The cause seems to be related to having a negative value in the enumeration. If I just comment out the DummyValue1 line, the code is correct. It does this at any optimization level of 1 or higher, and I haven't figured out if there is a specific optimization I can turn off as a work around.
 
      add   %o0, -2, %o0
      cmp   %o0, 1
      .stabn 68,0,13,.LLM3-_Z13DummyFunction10tTestEnum2
.LLM3:
      .stabn 68,0,15,.LLM4-_Z13DummyFunction10tTestEnum2
.LLM4:
      bg    .LL2
      mov   0, %o0
      .stabn 68,0,16,.LLM5-_Z13DummyFunction10tTestEnum2
.LLM5:
      mov   2, %o0
.LL2:
.LLBE3:
.LLBE2:
      retl
      nop
 
 
 
Thanks,
Aaron Coleman
Software Engineering Manager
Lowrance Electronics, Inc.
12000 E Skelly Dr.
Tulsa, OK 74128
918-437-6881 x8551
 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.ii
Type: application/octet-stream
Size: 343 bytes
Desc: test.ii
URL: <http://gcc.gnu.org/pipermail/gcc-bugs/attachments/20050225/0993addc/attachment.obj>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: output.txt
URL: <http://gcc.gnu.org/pipermail/gcc-bugs/attachments/20050225/0993addc/attachment.txt>


More information about the Gcc-bugs mailing list