public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/25428]  New: arm-elf-gcc generating wrong code with -O flag at functions with __attribute__ ((interrupt ("IRQ")))
@ 2005-12-15 14:57 th dot r dot klein at web dot de
  2005-12-15 15:00 ` [Bug c/25428] " th dot r dot klein at web dot de
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: th dot r dot klein at web dot de @ 2005-12-15 14:57 UTC (permalink / raw)
  To: gcc-bugs

If a little bit more complex interrupt function is required the compiler
genrates wrong code (olny with -O flag set).

Compiler generats:
        sub     lr, lr, #4
        stmfd   sp!, {r.., lr}
        .
        .
        .
        ldmfd   sp!, {r.., lr}
        subs    pc, lr, #4

Here the LR is decremented one time too mutch.
Ether first or the second "sub" is wrong.
It should be:
        sub     lr, lr, #4
        stmfd   sp!, {r.., lr}
        .
        .
        .
        ldmfd   sp!, {r.., lr}^

(the last '^' is important)

P.S. Since I can't add any attachments now. I'll try this after 'commit'.


-- 
           Summary: arm-elf-gcc generating wrong code with -O flag at
                    functions with __attribute__ ((interrupt ("IRQ")))
           Product: gcc
           Version: 4.0.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: th dot r dot klein at web dot de
  GCC host triplet: i386-freebds-elf
GCC target triplet: arm-unknown-elf


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25428


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug c/25428] arm-elf-gcc generating wrong code with -O flag at functions with __attribute__ ((interrupt ("IRQ")))
  2005-12-15 14:57 [Bug c/25428] New: arm-elf-gcc generating wrong code with -O flag at functions with __attribute__ ((interrupt ("IRQ"))) th dot r dot klein at web dot de
@ 2005-12-15 15:00 ` th dot r dot klein at web dot de
  2005-12-15 15:03 ` th dot r dot klein at web dot de
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: th dot r dot klein at web dot de @ 2005-12-15 15:00 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from th dot r dot klein at web dot de  2005-12-15 14:59 -------
Created an attachment (id=10497)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=10497&action=view)
except.i


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25428


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug c/25428] arm-elf-gcc generating wrong code with -O flag at functions with __attribute__ ((interrupt ("IRQ")))
  2005-12-15 14:57 [Bug c/25428] New: arm-elf-gcc generating wrong code with -O flag at functions with __attribute__ ((interrupt ("IRQ"))) th dot r dot klein at web dot de
  2005-12-15 15:00 ` [Bug c/25428] " th dot r dot klein at web dot de
@ 2005-12-15 15:03 ` th dot r dot klein at web dot de
  2005-12-15 15:04 ` th dot r dot klein at web dot de
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: th dot r dot klein at web dot de @ 2005-12-15 15:03 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from th dot r dot klein at web dot de  2005-12-15 15:03 -------
Created an attachment (id=10498)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=10498&action=view)
working result: arm-elf-gcc -save-temps -mthumb-interwork -march=armv4t -Wall
-c except.c


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25428


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug c/25428] arm-elf-gcc generating wrong code with -O flag at functions with __attribute__ ((interrupt ("IRQ")))
  2005-12-15 14:57 [Bug c/25428] New: arm-elf-gcc generating wrong code with -O flag at functions with __attribute__ ((interrupt ("IRQ"))) th dot r dot klein at web dot de
  2005-12-15 15:00 ` [Bug c/25428] " th dot r dot klein at web dot de
  2005-12-15 15:03 ` th dot r dot klein at web dot de
@ 2005-12-15 15:04 ` th dot r dot klein at web dot de
  2005-12-15 15:07 ` th dot r dot klein at web dot de
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: th dot r dot klein at web dot de @ 2005-12-15 15:04 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from th dot r dot klein at web dot de  2005-12-15 15:04 -------
Created an attachment (id=10499)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=10499&action=view)
not working result: arm-elf-gcc -save-temps -mthumb-interwork -O -march=armv4t
-Wall -c except.c


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25428


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug c/25428] arm-elf-gcc generating wrong code with -O flag at functions with __attribute__ ((interrupt ("IRQ")))
  2005-12-15 14:57 [Bug c/25428] New: arm-elf-gcc generating wrong code with -O flag at functions with __attribute__ ((interrupt ("IRQ"))) th dot r dot klein at web dot de
                   ` (2 preceding siblings ...)
  2005-12-15 15:04 ` th dot r dot klein at web dot de
@ 2005-12-15 15:07 ` th dot r dot klein at web dot de
  2005-12-15 15:08 ` th dot r dot klein at web dot de
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: th dot r dot klein at web dot de @ 2005-12-15 15:07 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from th dot r dot klein at web dot de  2005-12-15 15:07 -------
Created an attachment (id=10500)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=10500&action=view)
still working result: arm-elf-gcc -save-temps -mthumb-interwork -march=armv4t
-Wall -c except.c


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25428


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug c/25428] arm-elf-gcc generating wrong code with -O flag at functions with __attribute__ ((interrupt ("IRQ")))
  2005-12-15 14:57 [Bug c/25428] New: arm-elf-gcc generating wrong code with -O flag at functions with __attribute__ ((interrupt ("IRQ"))) th dot r dot klein at web dot de
                   ` (3 preceding siblings ...)
  2005-12-15 15:07 ` th dot r dot klein at web dot de
@ 2005-12-15 15:08 ` th dot r dot klein at web dot de
  2005-12-15 15:10 ` th dot r dot klein at web dot de
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: th dot r dot klein at web dot de @ 2005-12-15 15:08 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from th dot r dot klein at web dot de  2005-12-15 15:08 -------
Created an attachment (id=10501)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=10501&action=view)
now working result: arm-elf-gcc -save-temps -mthumb-interwork -O -march=armv4t
-Wall -c except.c


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25428


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug c/25428] arm-elf-gcc generating wrong code with -O flag at functions with __attribute__ ((interrupt ("IRQ")))
  2005-12-15 14:57 [Bug c/25428] New: arm-elf-gcc generating wrong code with -O flag at functions with __attribute__ ((interrupt ("IRQ"))) th dot r dot klein at web dot de
                   ` (4 preceding siblings ...)
  2005-12-15 15:08 ` th dot r dot klein at web dot de
@ 2005-12-15 15:10 ` th dot r dot klein at web dot de
  2005-12-16 11:31 ` [Bug target/25428] " th dot r dot klein at web dot de
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: th dot r dot klein at web dot de @ 2005-12-15 15:10 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from th dot r dot klein at web dot de  2005-12-15 15:10 -------
Created an attachment (id=10502)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=10502&action=view)
possible patch (used diff -Bbwu)


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25428


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug target/25428] arm-elf-gcc generating wrong code with -O flag at functions with __attribute__ ((interrupt ("IRQ")))
  2005-12-15 14:57 [Bug c/25428] New: arm-elf-gcc generating wrong code with -O flag at functions with __attribute__ ((interrupt ("IRQ"))) th dot r dot klein at web dot de
                   ` (5 preceding siblings ...)
  2005-12-15 15:10 ` th dot r dot klein at web dot de
@ 2005-12-16 11:31 ` th dot r dot klein at web dot de
  2005-12-16 11:34 ` th dot r dot klein at web dot de
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: th dot r dot klein at web dot de @ 2005-12-16 11:31 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from th dot r dot klein at web dot de  2005-12-16 11:31 -------
To me it looks like, that this patch also fixes Bug #16634
But I might be wrong, here.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25428


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug target/25428] arm-elf-gcc generating wrong code with -O flag at functions with __attribute__ ((interrupt ("IRQ")))
  2005-12-15 14:57 [Bug c/25428] New: arm-elf-gcc generating wrong code with -O flag at functions with __attribute__ ((interrupt ("IRQ"))) th dot r dot klein at web dot de
                   ` (6 preceding siblings ...)
  2005-12-16 11:31 ` [Bug target/25428] " th dot r dot klein at web dot de
@ 2005-12-16 11:34 ` th dot r dot klein at web dot de
  2005-12-16 11:35 ` th dot r dot klein at web dot de
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: th dot r dot klein at web dot de @ 2005-12-16 11:34 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from th dot r dot klein at web dot de  2005-12-16 11:34 -------
Created an attachment (id=10513)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=10513&action=view)
working: arm-elf-gcc -save-temps -mthumb-interwork -mapcs-frame -O
-march=armv4t -Wall -c except.c


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25428


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug target/25428] arm-elf-gcc generating wrong code with -O flag at functions with __attribute__ ((interrupt ("IRQ")))
  2005-12-15 14:57 [Bug c/25428] New: arm-elf-gcc generating wrong code with -O flag at functions with __attribute__ ((interrupt ("IRQ"))) th dot r dot klein at web dot de
                   ` (7 preceding siblings ...)
  2005-12-16 11:34 ` th dot r dot klein at web dot de
@ 2005-12-16 11:35 ` th dot r dot klein at web dot de
  2006-03-05 13:38 ` th dot r dot klein at web dot de
  2006-08-08 23:05 ` pbrook at gcc dot gnu dot org
  10 siblings, 0 replies; 12+ messages in thread
From: th dot r dot klein at web dot de @ 2005-12-16 11:35 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from th dot r dot klein at web dot de  2005-12-16 11:35 -------
Created an attachment (id=10514)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=10514&action=view)
working: arm-elf-gcc -save-temps -mthumb-interwork -mno-apcs-frame -O
-march=armv4t -Wall -c except.c


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25428


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug target/25428] arm-elf-gcc generating wrong code with -O flag at functions with __attribute__ ((interrupt ("IRQ")))
  2005-12-15 14:57 [Bug c/25428] New: arm-elf-gcc generating wrong code with -O flag at functions with __attribute__ ((interrupt ("IRQ"))) th dot r dot klein at web dot de
                   ` (8 preceding siblings ...)
  2005-12-16 11:35 ` th dot r dot klein at web dot de
@ 2006-03-05 13:38 ` th dot r dot klein at web dot de
  2006-08-08 23:05 ` pbrook at gcc dot gnu dot org
  10 siblings, 0 replies; 12+ messages in thread
From: th dot r dot klein at web dot de @ 2006-03-05 13:38 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #10 from th dot r dot klein at web dot de  2006-03-05 13:38 -------
Ping to remember

Fails on Version 3.2.3; 3.4.5; 4.0.2; 4.1.0; 4.2.0 (snapshot).
Earlier versions with additonal other buggs. So useless to test.

Bugfix still exists and working but ignorded at GCC side;

Why ?????????????


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25428


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug target/25428] arm-elf-gcc generating wrong code with -O flag at functions with __attribute__ ((interrupt ("IRQ")))
  2005-12-15 14:57 [Bug c/25428] New: arm-elf-gcc generating wrong code with -O flag at functions with __attribute__ ((interrupt ("IRQ"))) th dot r dot klein at web dot de
                   ` (9 preceding siblings ...)
  2006-03-05 13:38 ` th dot r dot klein at web dot de
@ 2006-08-08 23:05 ` pbrook at gcc dot gnu dot org
  10 siblings, 0 replies; 12+ messages in thread
From: pbrook at gcc dot gnu dot org @ 2006-08-08 23:05 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #11 from pbrook at gcc dot gnu dot org  2006-08-08 23:05 -------
Assembly in initial comment is bogus. Should be ldmfd {..., pc}^. ldmrd {...
lr}^ does somethething completely different.

*** This bug has been marked as a duplicate of 16634 ***


-- 

pbrook at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |DUPLICATE


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25428


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2006-08-08 23:05 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-12-15 14:57 [Bug c/25428] New: arm-elf-gcc generating wrong code with -O flag at functions with __attribute__ ((interrupt ("IRQ"))) th dot r dot klein at web dot de
2005-12-15 15:00 ` [Bug c/25428] " th dot r dot klein at web dot de
2005-12-15 15:03 ` th dot r dot klein at web dot de
2005-12-15 15:04 ` th dot r dot klein at web dot de
2005-12-15 15:07 ` th dot r dot klein at web dot de
2005-12-15 15:08 ` th dot r dot klein at web dot de
2005-12-15 15:10 ` th dot r dot klein at web dot de
2005-12-16 11:31 ` [Bug target/25428] " th dot r dot klein at web dot de
2005-12-16 11:34 ` th dot r dot klein at web dot de
2005-12-16 11:35 ` th dot r dot klein at web dot de
2006-03-05 13:38 ` th dot r dot klein at web dot de
2006-08-08 23:05 ` pbrook at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).