public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* target/10775: m32r-elf-gcc -O3 (regrename) used lr in leaf-functions without saving
@ 2003-05-14  6:16 inaoka.kazuhiro
  0 siblings, 0 replies; 3+ messages in thread
From: inaoka.kazuhiro @ 2003-05-14  6:16 UTC (permalink / raw)
  To: gcc-gnats


>Number:         10775
>Category:       target
>Synopsis:       m32r-elf-gcc -O3 (regrename) used lr in leaf-functions without saving
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          wrong-code
>Submitter-Id:   net
>Arrival-Date:   Wed May 14 06:16:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     Kazuhiro Inaoka
>Release:        gcc 3.2.3
>Organization:
>Environment:
Linux 2.4.18-24.7.x i686, target m32r-elf
>Description:
In gcc/testsuite:
FAIL: gcc.c-torture/execute/20000726-1.c execution,  -O3 -fomit-frame-pointer 
FAIL: gcc.c-torture/execute/20000726-1.c execution,  -O3 -g

When regrename optimizing (-O3) in leaf-functions, lr(R14) was used without saving.  
>How-To-Repeat:

>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="20000726-1.c"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="20000726-1.c"

dm9pZCBhZGp1c3RfeHkgKHNob3J0ICosIHNob3J0ICopOwoKc3RydWN0IGFkanVzdF90ZW1wbGF0
ZQp7CiAgc2hvcnQga3hfeDsKICBzaG9ydCBreF95OwogIHNob3J0IGt4OwogIHNob3J0IGt6Owp9
OwoKc3RhdGljIHN0cnVjdCBhZGp1c3RfdGVtcGxhdGUgYWRqdXN0ID0gezAsIDAsIDEsIDF9OwoK
bWFpbiAoKQp7CiAgc2hvcnQgeCA9IDEsIHkgPSAxOwoKICBhZGp1c3RfeHkgKCZ4LCAmeSk7Cgog
IGlmICh4ICE9IDEpCiAgICBhYm9ydCAoKTsKCiAgZXhpdCAoMCk7Cn0KCnZvaWQKYWRqdXN0X3h5
ICh4LCB5KQogICAgIHNob3J0ICAqeDsKICAgICBzaG9ydCAgKnk7CnsKICAqeCA9IGFkanVzdC5r
eF94ICogKnggKyBhZGp1c3Qua3hfeSAqICp5ICsgYWRqdXN0Lmt4Owp9Cg==


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

* Re: target/10775: m32r-elf-gcc -O3 (regrename) used lr in leaf-functions without saving
@ 2003-05-15 10:56 Kazuhiro Inaoka
  0 siblings, 0 replies; 3+ messages in thread
From: Kazuhiro Inaoka @ 2003-05-15 10:56 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR target/10775; it has been noted by GNATS.

From: Kazuhiro Inaoka <inaoka.kazuhiro@renesas.com>
To: Dara Hazeghi <dhazeghi@yahoo.com>, gcc-gnats@gcc.gnu.org,
   nobody@gcc.gnu.org
Cc:  
Subject: Re: target/10775: m32r-elf-gcc -O3 (regrename) used lr in
 leaf-functions without saving
Date: Thu, 15 May 2003 19:49:39 +0900

 Hello,
 
 > gcc 3.3 is in the process of being released. Would it be possible for
 > you to check whether the error still occurs with that version? Thanks,
 It still occurs on gcc 3.3.
 
  .section .data
  .balign 2
  .type adjust, @object
  .size adjust, 8
 adjust:
  .hword 0
  .hword 0
  .hword 1
  .hword 1
  .section .text
  .balign 4
  .global main
  .type main, @function
 main:
  ; PROLOGUE, vars= 4, regs= 1, args= 0, extra= 0
  push lr
  ldi r0,#1
  addi sp,#-4
  sth r0,@(2,sp)
  add3 r1,sp,#2
  sth r0,@(sp)
  mv r0,sp
  bl adjust_xy
  ldh r0,@(sp)
  addi r0,#-1
  beqz r0,.L2
  bl abort
 .L2:
  ldi r0,#0 ; 0x0
  bl exit
  ; EPILOGUE
  addi sp,#4
  pop lr
  jmp lr
  .size main, .-main
  .balign 4
  .global adjust_xy
  .type adjust_xy, @function
 adjust_xy:
  ; PROLOGUE, vars= 0, regs= 0, args= 0, extra= 0
  ld24 r2,#adjust
  lduh r6,@(2,r2)
  lduh lr,@(4,r2)      <---- use lr
  lduh r7,@(r1)
  lduh r4,@(r2)
  lduh r5,@(r0)
  mullo r6,r7
  mvfacmi r3
  mullo r4,r5
  mvfacmi r1
  add r1,r3
  add r1,lr
  sth r1,@(r0)
  ; EPILOGUE
  jmp lr                  <---- broken lr
  .size adjust_xy, .-adjust_xy
  .ident "GCC: (GNU) 3.3"
 
 I sent following patch. to gcc-patches@gcc.gnu.org.
 But I can't find it in gcc-patches ML. ?
 
 Subject is [PATCH] PR target/10775
 Hi,
 This patch is a proposed fix to the gcc-3.2.3 testsuite
 failure of gcc.c-torture/execute/20000726-1.c (PR .10775)
 
 Kazuhiro Inaoka
 
 gcc/ChangeLog
     PR 10775
     * config/m32r/m32r.h (HARD_REGNO_RENAME_OK): New macro.
        config/m32r.c: New m32r_hard_regno_rename_ok
        config/m32r-protos.h : Add the prototype for
 m32r_hard_regno_rename_ok
 
 diff -u org_src/gcc-3.2.3/gcc/config/m32r/m32r-protos.h
 gcc-3.2.3/gcc/config/m32r/m32r-protos.h
 --- org_src/gcc-3.2.3/gcc/config/m32r/m32r-protos.h Mon Dec 10 05:13:14 2001
 +++ gcc-3.2.3/gcc/config/m32r/m32r-protos.h Wed May 14 14:07:35 2003
 @@ -60,6 +60,7 @@
  extern void   m32r_print_operand_address PARAMS ((FILE *, rtx));
  extern int    m32r_address_cost   PARAMS ((rtx));
  extern int    m32r_not_same_reg   PARAMS ((rtx, rtx));
 +extern int    m32r_hard_regno_rename_ok  PARAMS ((unsigned int, unsigned
 int));
 
  #ifdef HAVE_MACHINE_MODES
  extern int    call_address_operand  PARAMS ((rtx, Mmode));
 diff -u org_src/gcc-3.2.3/gcc/config/m32r/m32r.c
 gcc-3.2.3/gcc/config/m32r/m32r.c
 --- org_src/gcc-3.2.3/gcc/config/m32r/m32r.c Sat Mar 23 04:25:51 2002
 +++ gcc-3.2.3/gcc/config/m32r/m32r.c Wed May 14 14:26:57 2003
 @@ -2968,3 +2968,20 @@
 
    return 1;
  }
 +
 +int m32r_hard_regno_rename_ok(old_reg, new_reg)
 +     unsigned int old_reg ATTRIBUTE_UNUSED;
 +     unsigned int new_reg;
 +{
 +  if ((lookup_attribute ("interrupt",
 +                       DECL_ATTRIBUTES (current_function_decl))
 +                        != NULL_TREE)
 +                       && !regs_ever_live[new_reg])
 +        return 0;
 +
 +  if (current_function_is_leaf && (new_reg == RETURN_ADDR_REGNUM))
 +        return 0;
 +
 +  return 1;
 +}
 +
 diff -u org_src/gcc-3.2.3/gcc/config/m32r/m32r.h
 gcc-3.2.3/gcc/config/m32r/m32r.h
 --- org_src/gcc-3.2.3/gcc/config/m32r/m32r.h Wed Jan  9 07:51:33 2002
 +++ gcc-3.2.3/gcc/config/m32r/m32r.h Wed May 14 14:06:15 2003
 @@ -670,6 +670,9 @@
   && GET_MODE_CLASS (MODE2) == MODE_INT  \
   && GET_MODE_SIZE (MODE1) <= UNITS_PER_WORD \
   && GET_MODE_SIZE (MODE2) <= UNITS_PER_WORD)
 +
 +#define HARD_REGNO_RENAME_OK(OLD_REG, NEW_REG) \
 +  m32r_hard_regno_rename_ok(OLD_REG, NEW_REG)
 
  /* Register classes and constants.  */
 
 Kazuhiro Inaoka
 


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

* Re: target/10775: m32r-elf-gcc -O3 (regrename) used lr in leaf-functions without saving
@ 2003-05-14 18:16 Dara Hazeghi
  0 siblings, 0 replies; 3+ messages in thread
From: Dara Hazeghi @ 2003-05-14 18:16 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR target/10775; it has been noted by GNATS.

From: Dara Hazeghi <dhazeghi@yahoo.com>
To: gcc-gnats@gcc.gnu.org, nobody@gcc.gnu.org, inaoka.kazuhiro@renesas.com
Cc:  
Subject: Re: target/10775: m32r-elf-gcc -O3 (regrename) used lr in leaf-functions without saving
Date: Wed, 14 May 2003 11:11:00 -0700

 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit- 
 trail&database=gcc&pr=10775
 
 
 Hello,
 
 gcc 3.3 is in the process of being released. Would it be possible for  
 you to check whether the error still occurs with that version? Thanks,
 
 Dara
 


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

end of thread, other threads:[~2003-05-15 10:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-05-14  6:16 target/10775: m32r-elf-gcc -O3 (regrename) used lr in leaf-functions without saving inaoka.kazuhiro
2003-05-14 18:16 Dara Hazeghi
2003-05-15 10:56 Kazuhiro Inaoka

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).