Bug List: (This bug is not in your last search results)   Show last search results      Search page      Enter new bug
Bug#: 39386
Product:  
Component:  
Status: NEW
Resolution:
Assigned To: Not yet assigned to anyone <unassigned@gcc.gnu.org>
Host:
Reported against  
Priority:  
Severity:  
Target Milestone:  
 
 
Target:
Reporter: Xuejun Yang <jxyang@cs.utah.edu>
Add CC:
CC:
Remove selected CCs
Build:
URL:
Summary:
Keywords:
Known to work:
Known to fail:

Attachment Description Type Created Size Actions
bug1.c mis-calculated program text/plain 2009-03-05 21:22 411 bytes Edit
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 39386 depends on: Show dependency tree
Show dependency graph
Bug 39386 blocks:

Additional Comments:





Mark bug as waiting for feedback
Mark bug as suspended




View Bug Activity   |   Format For Printing   |   Clone This Bug


Description:   Last confirmed: 2009-08-10 13:40 Opened: 2009-03-05 21:17
This is seen on the version of avr-gcc 4.3.3 that gets built by the script that
comes with FemtoOS 0.88.

The program performs simple arithmatic and logical operations on a global
variable, and store the result in register R30:R31.

If the program is compiled with "avr-gcc -mmcu=atmega128 -O0", the final result
is 00. On the other hand, if the program is compiled with "avr-gcc
-mmcu=atmega128 -O1", the final result is 0xFF. Compiling at O2 gives me 0xFF
too.

Obviously, avr-gcc compiled the program wrong at one of the these optimization
levels.

This bug is observed in avr studio 4.15.

------- Comment #1 From Xuejun Yang 2009-03-05 21:22 -------
Created an attachment (id=17400) [edit]
mis-calculated program

------- Comment #2 From Eric Weddington 2009-03-18 17:47 -------
Confirmed with gcc 4.3.2.

------- Comment #3 From Eric Weddington 2009-03-21 16:52 -------
Please try using gcc 4.4 (HEAD). Anatoly Sokolov (AVR port maintainer) has
indicated to me that he does not see this bug when using HEAD/4.4.

------- Comment #4 From Eric Weddington 2009-04-07 15:18 -------
*** Bug 39635 has been marked as a duplicate of this bug. ***

------- Comment #5 From Eric Weddington 2009-04-07 15:23 -------
Adding additional version numbers in the known-to-fail field from comment in
duplicate bug #39635. Still waiting to hear if bug is present in 4.4.

------- Comment #6 From Anitha Boyapati 2009-08-10 13:27 -------
Confirmed with gcc 4.4.0. Using switch -O0 with avr-gcc 4.4.0 (-mmcu=atmega128)
gave the result 0 while -O1 gave 0xFF

Bug List: (This bug is not in your last search results)   Show last search results      Search page      Enter new bug