public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Handel REG_LIBCALL note after split
@ 2007-08-09 13:40 Sa Liu
  2007-08-10 15:09 ` Ian Lance Taylor
  2007-08-15 12:16 ` Jakub Jelinek
  0 siblings, 2 replies; 3+ messages in thread
From: Sa Liu @ 2007-08-09 13:40 UTC (permalink / raw)
  To: gcc-patches

This patch relink the insns with REG_LIBCALL note and with REG_RETVAL note 
after split.
The discussion in GCC mailing list can be found here:
http://gcc.gnu.org/ml/gcc/2007-07/msg00925.html

The patch has been tested on spu with gcc test suits and got no 
regression.

Is it now OK for the mainline?

Thanks,
Sa

Index: gcc/emit-rtl.c
===================================================================
--- gcc.orig/emit-rtl.c
+++ gcc/emit-rtl.c
@@ -3129,7 +3129,7 @@ try_split (rtx pat, rtx trial, int last)
   rtx before = PREV_INSN (trial);
   rtx after = NEXT_INSN (trial);
   int has_barrier = 0;
-  rtx tem;
+  rtx tem, note_retval;
   rtx note, seq;
   int probability;
   rtx insn_last, insn;
@@ -3264,6 +3264,16 @@ try_split (rtx pat, rtx trial, int last)
            }
          break;
 #endif
+       case REG_LIBCALL:
+       /* Relink the insns with REG_LIBCALL note and with REG_RETVAL note 

+          after split.  */
+           REG_NOTES (insn_last) 
+               = gen_rtx_EXPR_LIST (REG_LIBCALL,
+                                    XEXP (note, 0),
+                                    REG_NOTES (insn_last)); 
+           note_retval = find_reg_note (XEXP (note, 0), REG_RETVAL, 
NULL);
+           XEXP (note_retval, 0) = insn_last;
+         break;
 
        default:
          break;




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

* Re: [PATCH] Handel REG_LIBCALL note after split
  2007-08-09 13:40 [PATCH] Handel REG_LIBCALL note after split Sa Liu
@ 2007-08-10 15:09 ` Ian Lance Taylor
  2007-08-15 12:16 ` Jakub Jelinek
  1 sibling, 0 replies; 3+ messages in thread
From: Ian Lance Taylor @ 2007-08-10 15:09 UTC (permalink / raw)
  To: Sa Liu; +Cc: gcc-patches

Sa Liu <SALIU@de.ibm.com> writes:

> This patch relink the insns with REG_LIBCALL note and with REG_RETVAL note 
> after split.
> The discussion in GCC mailing list can be found here:
> http://gcc.gnu.org/ml/gcc/2007-07/msg00925.html
> 
> The patch has been tested on spu with gcc test suits and got no 
> regression.
> 
> Is it now OK for the mainline?

This is patch is OK with a ChangeLog entry.

Thanks.

Ian

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

* Re: [PATCH] Handel REG_LIBCALL note after split
  2007-08-09 13:40 [PATCH] Handel REG_LIBCALL note after split Sa Liu
  2007-08-10 15:09 ` Ian Lance Taylor
@ 2007-08-15 12:16 ` Jakub Jelinek
  1 sibling, 0 replies; 3+ messages in thread
From: Jakub Jelinek @ 2007-08-15 12:16 UTC (permalink / raw)
  To: Sa Liu; +Cc: gcc-patches

On Thu, Aug 09, 2007 at 03:40:39PM +0200, Sa Liu wrote:
> This patch relink the insns with REG_LIBCALL note and with REG_RETVAL note 
> after split.
> The discussion in GCC mailing list can be found here:
> http://gcc.gnu.org/ml/gcc/2007-07/msg00925.html
> 
> The patch has been tested on spu with gcc test suits and got no 
> regression.

> --- gcc.orig/emit-rtl.c
> +++ gcc/emit-rtl.c
> @@ -3264,6 +3264,16 @@ try_split (rtx pat, rtx trial, int last)
>             }
>           break;
>  #endif
> +       case REG_LIBCALL:
> +       /* Relink the insns with REG_LIBCALL note and with REG_RETVAL note 
> 
> +          after split.  */
> +           REG_NOTES (insn_last) 
> +               = gen_rtx_EXPR_LIST (REG_LIBCALL,
> +                                    XEXP (note, 0),
> +                                    REG_NOTES (insn_last)); 
> +           note_retval = find_reg_note (XEXP (note, 0), REG_RETVAL, NULL);
> +           XEXP (note_retval, 0) = insn_last;
> +         break;
>  
>         default:
>           break;

REG_LIBCALL is together with REG_RETVAL, REG_CC_SETTER, REG_CC_USER and
REG_LABEL supposed to use INSN_LIST rather than EXPR_LIST.  In addition
to being printed wrongly in dumps this causes PR33074 regression.
Fixed thusly, committed as obvious:

2007-08-15  Jakub Jelinek  <jakub@redhat.com>

	PR middle-end/33074
	* emit-rtl.c (try_split): Use INSN_LIST instead of EXPR_LIST for
	REG_LIBCALL note.

	* gfortran.dg/pr33074.f90: New test.

--- gcc/emit-rtl.c.jj	2007-08-13 15:11:18.000000000 +0200
+++ gcc/emit-rtl.c	2007-08-15 13:44:36.000000000 +0200
@@ -3274,7 +3274,7 @@ try_split (rtx pat, rtx trial, int last)
 	  /* Relink the insns with REG_LIBCALL note and with REG_RETVAL note 
 	     after split.  */
 	  REG_NOTES (insn_last) 
-	    = gen_rtx_EXPR_LIST (REG_LIBCALL,
+	    = gen_rtx_INSN_LIST (REG_LIBCALL,
 				 XEXP (note, 0),
 				 REG_NOTES (insn_last)); 
 
--- gcc/testsuite/gfortran.dg/pr33074.f90.jj	2007-08-15 14:00:16.000000000 +0200
+++ gcc/testsuite/gfortran.dg/pr33074.f90	2007-08-15 13:58:57.000000000 +0200
@@ -0,0 +1,8 @@
+! PR middle-end/33074
+! { dg-do compile }
+! { dg-options "-O" }
+
+subroutine pr33074(a, w)
+  real a(1), w(1)
+  a(1) = 2.0**int(w(1))
+end


	Jakub

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

end of thread, other threads:[~2007-08-15 12:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-08-09 13:40 [PATCH] Handel REG_LIBCALL note after split Sa Liu
2007-08-10 15:09 ` Ian Lance Taylor
2007-08-15 12:16 ` Jakub Jelinek

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