public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: Kazuhiro Inaoka <inaoka.kazuhiro@renesas.com>
To: nobody@gcc.gnu.org
Cc: gcc-prs@gcc.gnu.org,
Subject: Re: target/10775: m32r-elf-gcc -O3 (regrename) used lr in leaf-functions without saving
Date: Thu, 15 May 2003 10:56:00 -0000	[thread overview]
Message-ID: <20030515105601.28322.qmail@sources.redhat.com> (raw)

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
 


             reply	other threads:[~2003-05-15 10:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-05-15 10:56 Kazuhiro Inaoka [this message]
  -- strict thread matches above, loose matches on Subject: below --
2003-05-14 18:16 Dara Hazeghi
2003-05-14  6:16 inaoka.kazuhiro

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20030515105601.28322.qmail@sources.redhat.com \
    --to=inaoka.kazuhiro@renesas.com \
    --cc=gcc-prs@gcc.gnu.org \
    --cc=nobody@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).