public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Fix PR rtl-optimization/24257
@ 2006-01-10 12:33 Richard Guenther
  2006-01-14  5:10 ` Roger Sayle
  2007-06-13 18:02 ` Rask Ingemann Lambertsen
  0 siblings, 2 replies; 6+ messages in thread
From: Richard Guenther @ 2006-01-10 12:33 UTC (permalink / raw)
  To: gcc-patches; +Cc: Steven Bosscher


This patch from Steven fixes PR24257.

Bootstrapped and tested on i686-pc-linux-gnu.

Ok for mainline and 4.1?

Thanks,
Richard.


2006-01-10  Steven Bosscher  <steven.bosscher@gmail.com>
	Richard Guenther  <rguenther@suse.de>

	PR rtl-optimization/24257
	* gcse.c (find_moveable_store): Only consider a store movable
	when the SET_SRC of the insn can be assigned to a register.

	* gcc.dg/torture/pr24257.c: New testcase.

Index: gcse.c
===================================================================
--- gcse.c	(revision 109509)
+++ gcse.c	(working copy)
@@ -5647,6 +5647,14 @@ find_moveable_store (rtx insn, int *regs
   if (find_reg_note (insn, REG_EH_REGION, NULL_RTX))
     return;
 
+  /* Make sure that the SET_SRC of this store insns can be assigned to
+     a register, or we will fail later on in replace_store_insn, which
+     assumes that we can do this.  But sometimes the target machine has
+     oddities like MEM read-modify-write instruction.  See for example
+     PR24257.  */
+  if (!can_assign_to_reg_p (SET_SRC (set)))
+    return;
+
   ptr = ldst_entry (dest);
   if (!ptr->pattern_regs)
     ptr->pattern_regs = extract_mentioned_regs (dest);


/* { dg-do compile } */
/* { dg-options "-O -fgcse -fgcse-sm" } */

typedef struct A {
    int buf, left;
} A;

static void flush(A *s, int n)
{
    s->buf <<= n;

    while (s->left < 32) {
        s->buf <<= 8;
        s->left += 8;
    }

    s->buf=0;
}

void oof(A *s, int n)
{
    s->buf = n;
    s->left = n;

    flush(s, n);
}

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

* Re: [PATCH] Fix PR rtl-optimization/24257
  2006-01-10 12:33 [PATCH] Fix PR rtl-optimization/24257 Richard Guenther
@ 2006-01-14  5:10 ` Roger Sayle
  2006-01-14 13:48   ` Richard Guenther
  2007-06-13 18:02 ` Rask Ingemann Lambertsen
  1 sibling, 1 reply; 6+ messages in thread
From: Roger Sayle @ 2006-01-14  5:10 UTC (permalink / raw)
  To: Richard Guenther; +Cc: Steven Bosscher, gcc-patches



On Tue, 10 Jan 2006, Richard Guenther wrote:
> 2006-01-10  Steven Bosscher  <steven.bosscher@gmail.com>
> 	      Richard Guenther  <rguenther@suse.de>
>
> 	PR rtl-optimization/24257
> 	* gcse.c (find_moveable_store): Only consider a store movable
> 	when the SET_SRC of the insn can be assigned to a register.
>
> 	* gcc.dg/torture/pr24257.c: New testcase.

This is OK for mainline and the gcc-4_1-branch.  I'd prefer it if
you left it a day or two on mainline, then bootstrap and regression
test against the 4.1 branch, but the change itself looks very safe.

Thanks to both you and Steven,

Roger
--

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

* Re: [PATCH] Fix PR rtl-optimization/24257
  2006-01-14  5:10 ` Roger Sayle
@ 2006-01-14 13:48   ` Richard Guenther
  0 siblings, 0 replies; 6+ messages in thread
From: Richard Guenther @ 2006-01-14 13:48 UTC (permalink / raw)
  To: Roger Sayle; +Cc: Steven Bosscher, gcc-patches

On Fri, 13 Jan 2006, Roger Sayle wrote:

> 
> 
> On Tue, 10 Jan 2006, Richard Guenther wrote:
> > 2006-01-10  Steven Bosscher  <steven.bosscher@gmail.com>
> > 	      Richard Guenther  <rguenther@suse.de>
> >
> > 	PR rtl-optimization/24257
> > 	* gcse.c (find_moveable_store): Only consider a store movable
> > 	when the SET_SRC of the insn can be assigned to a register.
> >
> > 	* gcc.dg/torture/pr24257.c: New testcase.
> 
> This is OK for mainline and the gcc-4_1-branch.  I'd prefer it if
> you left it a day or two on mainline, then bootstrap and regression
> test against the 4.1 branch, but the change itself looks very safe.

I have applied the patch to mainline now and will take care of the 4.1
branch next week.

Richard.

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

* Re: [PATCH] Fix PR rtl-optimization/24257
  2006-01-10 12:33 [PATCH] Fix PR rtl-optimization/24257 Richard Guenther
  2006-01-14  5:10 ` Roger Sayle
@ 2007-06-13 18:02 ` Rask Ingemann Lambertsen
  2007-06-13 23:13   ` Richard Guenther
  1 sibling, 1 reply; 6+ messages in thread
From: Rask Ingemann Lambertsen @ 2007-06-13 18:02 UTC (permalink / raw)
  To: Richard Guenther; +Cc: gcc-patches, Steven Bosscher

On Tue, Jan 10, 2006 at 01:33:04PM +0100, Richard Guenther wrote:

> 	* gcc.dg/torture/pr24257.c: New testcase.
> 
> /* { dg-do compile } */
> /* { dg-options "-O -fgcse -fgcse-sm" } */

   That -O overrides the usual -O0, -O1, -O2 and so on. I see this in my
logs (never mind that the test fails, it's probably PR middle-end/32321):

Executing on host: /home/rask/cvsbuild/gcc/gcc/xgcc -B/home/rask/cvsbuild/gcc/gcc/ /home/rask/cvssrc/gcc/gcc/testsuite/gcc.dg/torture/pr24257.c   -O0  -O -fgcse -fgcse-sm -fno-show-column -S  -msim=linuxvm86 -DSTACK_SIZE=4096 -o pr24257.s    (timeout = 300)
FAIL: gcc.dg/torture/pr24257.c  -O0  (internal compiler error)
FAIL: gcc.dg/torture/pr24257.c  -O0  (test for excess errors)
Executing on host: /home/rask/cvsbuild/gcc/gcc/xgcc -B/home/rask/cvsbuild/gcc/gcc/ /home/rask/cvssrc/gcc/gcc/testsuite/gcc.dg/torture/pr24257.c   -O1  -O -fgcse -fgcse-sm -fno-show-column -S  -msim=linuxvm86 -DSTACK_SIZE=4096 -o pr24257.s    (timeout = 300)
FAIL: gcc.dg/torture/pr24257.c  -O1  (internal compiler error)
FAIL: gcc.dg/torture/pr24257.c  -O1  (test for excess errors)
Executing on host: /home/rask/cvsbuild/gcc/gcc/xgcc -B/home/rask/cvsbuild/gcc/gcc/ /home/rask/cvssrc/gcc/gcc/testsuite/gcc.dg/torture/pr24257.c   -O2  -O -fgcse -fgcse-sm -fno-show-column -S  -msim=linuxvm86 -DSTACK_SIZE=4096 -o pr24257.s    (timeout = 300)
FAIL: gcc.dg/torture/pr24257.c  -O2  (internal compiler error)
FAIL: gcc.dg/torture/pr24257.c  -O2  (test for excess errors)
Executing on host: /home/rask/cvsbuild/gcc/gcc/xgcc -B/home/rask/cvsbuild/gcc/gcc/ /home/rask/cvssrc/gcc/gcc/testsuite/gcc.dg/torture/pr24257.c   -O3 -fomit-frame-pointer  -O -fgcse -fgcse-sm -fno-show-column -S  -msim=linuxvm86 -DSTACK_SIZE=4096 -o pr24257.s    (timeout = 300)
FAIL: gcc.dg/torture/pr24257.c  -O3 -fomit-frame-pointer  (internal compiler error)
FAIL: gcc.dg/torture/pr24257.c  -O3 -fomit-frame-pointer  (test for excess errors)
Executing on host: /home/rask/cvsbuild/gcc/gcc/xgcc -B/home/rask/cvsbuild/gcc/gcc/ /home/rask/cvssrc/gcc/gcc/testsuite/gcc.dg/torture/pr24257.c   -O3 -fomit-frame-pointer -funroll-loops  -O -fgcse -fgcse-sm -fno-show-column -S  -msim=linuxvm86 -DSTACK_SIZE=4096 -o pr24257.s    (timeout = 300)
FAIL: gcc.dg/torture/pr24257.c  -O3 -fomit-frame-pointer -funroll-loops  (internal compiler error)
FAIL: gcc.dg/torture/pr24257.c  -O3 -fomit-frame-pointer -funroll-loops  (test for excess errors)
Executing on host: /home/rask/cvsbuild/gcc/gcc/xgcc -B/home/rask/cvsbuild/gcc/gcc/ /home/rask/cvssrc/gcc/gcc/testsuite/gcc.dg/torture/pr24257.c   -O3 -fomit-frame-pointer -funroll-all-loops -finline-functions  -O -fgcse -fgcse-sm -fno-show-column -S  -msim=linuxvm86 -DSTACK_SIZE=4096 -o pr24257.s    (timeout = 300)
FAIL: gcc.dg/torture/pr24257.c  -O3 -fomit-frame-pointer -funroll-all-loops -finline-functions  (internal compiler error)
FAIL: gcc.dg/torture/pr24257.c  -O3 -fomit-frame-pointer -funroll-all-loops -finline-functions  (test for excess errors)
Executing on host: /home/rask/cvsbuild/gcc/gcc/xgcc -B/home/rask/cvsbuild/gcc/gcc/ /home/rask/cvssrc/gcc/gcc/testsuite/gcc.dg/torture/pr24257.c   -O3 -g  -O -fgcse -fgcse-sm -fno-show-column -S  -msim=linuxvm86 -DSTACK_SIZE=4096 -o pr24257.s    (timeout = 300)
FAIL: gcc.dg/torture/pr24257.c  -O3 -g  (internal compiler error)
FAIL: gcc.dg/torture/pr24257.c  -O3 -g  (test for excess errors)
Executing on host: /home/rask/cvsbuild/gcc/gcc/xgcc -B/home/rask/cvsbuild/gcc/gcc/ /home/rask/cvssrc/gcc/gcc/testsuite/gcc.dg/torture/pr24257.c   -Os  -O -fgcse -fgcse-sm -fno-show-column -S  -msim=linuxvm86 -DSTACK_SIZE=4096 -o pr24257.s    (timeout = 300)
FAIL: gcc.dg/torture/pr24257.c  -Os  (internal compiler error)
FAIL: gcc.dg/torture/pr24257.c  -Os  (test for excess errors)

-- 
Rask Ingemann Lambertsen

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

* Re: [PATCH] Fix PR rtl-optimization/24257
  2007-06-13 18:02 ` Rask Ingemann Lambertsen
@ 2007-06-13 23:13   ` Richard Guenther
  2007-12-16 20:48     ` Rask Ingemann Lambertsen
  0 siblings, 1 reply; 6+ messages in thread
From: Richard Guenther @ 2007-06-13 23:13 UTC (permalink / raw)
  To: Rask Ingemann Lambertsen; +Cc: gcc-patches, Steven Bosscher

On Wed, 13 Jun 2007, Rask Ingemann Lambertsen wrote:

> On Tue, Jan 10, 2006 at 01:33:04PM +0100, Richard Guenther wrote:
> 
> > 	* gcc.dg/torture/pr24257.c: New testcase.
> > 
> > /* { dg-do compile } */
> > /* { dg-options "-O -fgcse -fgcse-sm" } */
> 
>    That -O overrides the usual -O0, -O1, -O2 and so on. I see this in my
> logs (never mind that the test fails, it's probably PR middle-end/32321):

Feel free to remove the -O.

Richard.

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

* Re: [PATCH] Fix PR rtl-optimization/24257
  2007-06-13 23:13   ` Richard Guenther
@ 2007-12-16 20:48     ` Rask Ingemann Lambertsen
  0 siblings, 0 replies; 6+ messages in thread
From: Rask Ingemann Lambertsen @ 2007-12-16 20:48 UTC (permalink / raw)
  To: gcc-patches

On Wed, Jun 13, 2007 at 11:59:57PM +0200, Richard Guenther wrote:
> On Wed, 13 Jun 2007, Rask Ingemann Lambertsen wrote:
> 
> > On Tue, Jan 10, 2006 at 01:33:04PM +0100, Richard Guenther wrote:
> > 
> > > 	* gcc.dg/torture/pr24257.c: New testcase.
> > > 
> > > /* { dg-do compile } */
> > > /* { dg-options "-O -fgcse -fgcse-sm" } */
> > 
> >    That -O overrides the usual -O0, -O1, -O2 and so on. I see this in my
> > logs (never mind that the test fails, it's probably PR middle-end/32321):
> 
> Feel free to remove the -O.

   Committed as revision 130992.

Index: gcc/testsuite/ChangeLog
===================================================================
--- gcc/testsuite/ChangeLog	(revision 130991)
+++ gcc/testsuite/ChangeLog	(working copy)
@@ -1,3 +1,7 @@
+2007-12-16  Rask Ingemann Lambertsen  <rask@sygehus.dk>
+
+	* gcc.dg/torture/pr24257.c: Remove -O from options.
+
 2007-12-16  Tobias Burnus  <burnus@net-b.de>
 
 	PR fortran/34246
Index: gcc/testsuite/gcc.dg/torture/pr24257.c
===================================================================
--- gcc/testsuite/gcc.dg/torture/pr24257.c	(revision 130991)
+++ gcc/testsuite/gcc.dg/torture/pr24257.c	(working copy)
@@ -1,5 +1,5 @@
 /* { dg-do compile } */
-/* { dg-options "-O -fgcse -fgcse-sm" } */
+/* { dg-options "-fgcse -fgcse-sm" } */
 
 typedef struct A {
     int buf, left;
 

-- 
Rask Ingemann Lambertsen
Danish law requires addresses in e-mail to be logged and stored for a year

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

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

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-01-10 12:33 [PATCH] Fix PR rtl-optimization/24257 Richard Guenther
2006-01-14  5:10 ` Roger Sayle
2006-01-14 13:48   ` Richard Guenther
2007-06-13 18:02 ` Rask Ingemann Lambertsen
2007-06-13 23:13   ` Richard Guenther
2007-12-16 20:48     ` Rask Ingemann Lambertsen

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