public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/43435]  New: Bad registers are restored before ISR is leaved
@ 2010-03-18 21:45 karol_kostolny at hotmail dot com
  2010-03-18 21:51 ` [Bug target/43435] " pinskia at gcc dot gnu dot org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: karol_kostolny at hotmail dot com @ 2010-03-18 21:45 UTC (permalink / raw)
  To: gcc-bugs

Output of 'sh-elf-gcc -v -save-temps -O0 -m2a-nofpu -S -o tstint.asm tstint.c':
Using built-in specs.
Target: sh-elf
Configured with: ./gcc-4.3.4/configure --target=sh-elf --program-prefix=sh-elf-
--prefix=/opt/cross/sh-elf --disable-shared --with-multilib --disable-nls
--disable-libssp --enable-languages=c
Thread model: single
gcc version 4.3.4 (GCC)
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-O0' '-m2a-nofpu' '-S' '-o'
'tstint.asm'
 /opt/cross/sh-elf/libexec/gcc/sh-elf/4.3.4/cc1 -E -quiet -v -imultilib m2
tstint.c -m2a-nofpu -O0 -fpch-preprocess -o tstint.i
ignoring nonexistent directory
"/opt/cross/sh-elf/lib/gcc/sh-elf/4.3.4/../../../../sh-elf/sys-include"
ignoring nonexistent directory
"/opt/cross/sh-elf/lib/gcc/sh-elf/4.3.4/../../../../sh-elf/include"
#include "..." search starts here:
#include <...> search starts here:
 /opt/cross/sh-elf/lib/gcc/sh-elf/4.3.4/include
 /opt/cross/sh-elf/lib/gcc/sh-elf/4.3.4/include-fixed
End of search list.
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-O0' '-m2a-nofpu' '-S' '-o'
'tstint.asm'
 /opt/cross/sh-elf/libexec/gcc/sh-elf/4.3.4/cc1 -fpreprocessed tstint.i -quiet
-dumpbase tstint.c -m2a-nofpu -auxbase-strip tstint.asm -O0 -version -o
tstint.asm
GNU C (GCC) version 4.3.4 (sh-elf)
        compiled by GNU C version 4.4.1, GMP version 4.3.1, MPFR version 


2.4.1-p2.
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 569db6a90945bcba0ab387b1b61a843e
COMPILER_PATH=/opt/cross/sh-elf/libexec/gcc/sh-elf/4.3.4/:/opt/cross/sh-elf/libexec/gcc/sh-elf/4.3.4/:/opt/cross/sh-elf/libexec/gcc/sh-elf/:/opt/cross/sh-elf/lib/gcc/sh-elf/4.3.4/:/opt/cross/sh-elf/lib/gcc/sh-elf/:/opt/cross/sh-elf/lib/gcc/sh-elf/4.3.4/../../../../sh-elf/bin/
LIBRARY_PATH=/opt/cross/sh-elf/lib/gcc/sh-elf/4.3.4/m2/:/opt/cross/sh-elf/lib/gcc/sh-elf/4.3.4/:/opt/cross/sh-elf/lib/gcc/sh-elf/4.3.4/../../../../sh-elf/lib/
COLLECT_GCC_OPTIONS='-v' '-save-temps' '-O0' '-m2a-nofpu' '-S' '-o'
'tstint.asm'


Content of tstint.i:
# 1 "tstint.c"
# 1 "<built-in>"
# 1 "<command-line>"
# 1 "tstint.c"

#pragma interrupt
void test_interrupt()
{
  (*((volatile unsigned int*) (0x01000000))) = 0x01000000;
  (*((volatile unsigned int*) (0x02000000))) = 0x02000000;
}

int main(int argc, const char **argv)
{
  return 0;
}


Code produced for test_interrupt() (tstint.asm produced) (regs r14, r1 and r2
saved, then r6, r5 and r14 restored before rte -> BAD!:
        .global _test_interrupt
        .type   _test_interrupt, @function
_test_interrupt:
        mov.l   r14,@-r15
        mov.l   r1,@-r15
        mov.l   r2,@-r15
        mov     r15,r14
        mov.l   .L4,r2
        mov.l   .L4,r1
        mov.l   r1,@r2
        mov.l   .L6,r2
        mov.l   .L6,r1
        mov.l   r1,@r2
        mov     r14,r15
        mov.l   @r15+,r6
        mov.l   @r15+,r5
        mov.l   @r15+,r14
        rte     
        nop


-- 
           Summary: Bad registers are restored before ISR is leaved
           Product: gcc
           Version: 4.3.4
            Status: UNCONFIRMED
          Severity: major
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: karol_kostolny at hotmail dot com
 GCC build triplet: x86_64-linux-gnu
  GCC host triplet: x86_64-linux-gnu
GCC target triplet: sh-unknown-elf


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


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

* [Bug target/43435] Bad registers are restored before ISR is leaved
  2010-03-18 21:45 [Bug c/43435] New: Bad registers are restored before ISR is leaved karol_kostolny at hotmail dot com
@ 2010-03-18 21:51 ` pinskia at gcc dot gnu dot org
  2010-03-18 23:19 ` mikpe at it dot uu dot se
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2010-03-18 21:51 UTC (permalink / raw)
  To: gcc-bugs



-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|major                       |normal
          Component|c                           |target


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


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

* [Bug target/43435] Bad registers are restored before ISR is leaved
  2010-03-18 21:45 [Bug c/43435] New: Bad registers are restored before ISR is leaved karol_kostolny at hotmail dot com
  2010-03-18 21:51 ` [Bug target/43435] " pinskia at gcc dot gnu dot org
@ 2010-03-18 23:19 ` mikpe at it dot uu dot se
  2010-03-22 22:02 ` [Bug target/43435] [4.3/4/4 Regression] SH: " kkojima at gcc dot gnu dot org
  2010-03-23 23:13 ` kkojima at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: mikpe at it dot uu dot se @ 2010-03-18 23:19 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from mikpe at it dot uu dot se  2010-03-18 23:19 -------
Maybe fixed by:
http://gcc.gnu.org/ml/gcc-patches/2010-01/msg00356.html


-- 


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


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

* [Bug target/43435] [4.3/4/4 Regression] SH: Bad registers are restored before ISR is leaved
  2010-03-18 21:45 [Bug c/43435] New: Bad registers are restored before ISR is leaved karol_kostolny at hotmail dot com
  2010-03-18 21:51 ` [Bug target/43435] " pinskia at gcc dot gnu dot org
  2010-03-18 23:19 ` mikpe at it dot uu dot se
@ 2010-03-22 22:02 ` kkojima at gcc dot gnu dot org
  2010-03-23 23:13 ` kkojima at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: kkojima at gcc dot gnu dot org @ 2010-03-22 22:02 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from kkojima at gcc dot gnu dot org  2010-03-22 22:02 -------
I've confirmed that this is 4.3/4.4 regression solved on trunk with
the patch mentioned in #1.  I'll backport the patch to 4.3/4.4 branches
when it passes the usual test on those branches.


-- 

kkojima at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
           Keywords|                            |ice-on-valid-code
      Known to fail|                            |4.3.4 4.4.3
      Known to work|                            |4.2.4 4.5.0
           Priority|P3                          |P4
   Last reconfirmed|0000-00-00 00:00:00         |2010-03-22 22:02:15
               date|                            |
            Summary|Bad registers are restored  |[4.3/4/4 Regression] SH: Bad
                   |before ISR is leaved        |registers are restored
                   |                            |before ISR is leaved


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


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

* [Bug target/43435] [4.3/4/4 Regression] SH: Bad registers are restored before ISR is leaved
  2010-03-18 21:45 [Bug c/43435] New: Bad registers are restored before ISR is leaved karol_kostolny at hotmail dot com
                   ` (2 preceding siblings ...)
  2010-03-22 22:02 ` [Bug target/43435] [4.3/4/4 Regression] SH: " kkojima at gcc dot gnu dot org
@ 2010-03-23 23:13 ` kkojima at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: kkojima at gcc dot gnu dot org @ 2010-03-23 23:13 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from kkojima at gcc dot gnu dot org  2010-03-23 23:13 -------
Fixed.


-- 

kkojima at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kkojima at gcc dot gnu dot
                   |                            |org
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


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


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

end of thread, other threads:[~2010-03-23 23:13 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-03-18 21:45 [Bug c/43435] New: Bad registers are restored before ISR is leaved karol_kostolny at hotmail dot com
2010-03-18 21:51 ` [Bug target/43435] " pinskia at gcc dot gnu dot org
2010-03-18 23:19 ` mikpe at it dot uu dot se
2010-03-22 22:02 ` [Bug target/43435] [4.3/4/4 Regression] SH: " kkojima at gcc dot gnu dot org
2010-03-23 23:13 ` kkojima 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).