public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/38708]  New: [4.4 Regression] gcc.c-torture/execute/memset-3.c  Fails with -march=pentium-m -O1
@ 2009-01-02 18:45 pinskia at gcc dot gnu dot org
  2009-01-02 18:49 ` [Bug target/38708] " pinskia at gcc dot gnu dot org
                   ` (15 more replies)
  0 siblings, 16 replies; 17+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2009-01-02 18:45 UTC (permalink / raw)
  To: gcc-bugs

I think this is the cause of PR 38686 but I could be wrong.
Anyways gcc.c-torture/execute/memset-3.c   fails with -march=pentium-m -O1


-- 
           Summary: [4.4 Regression] gcc.c-torture/execute/memset-3.c  Fails
                    with -march=pentium-m -O1
           Product: gcc
           Version: 4.4.0
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P3
         Component: target
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: pinskia at gcc dot gnu dot org
GCC target triplet: i686-pc-linux-gnu
OtherBugsDependingO 38686
             nThis:


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


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

* [Bug target/38708] [4.4 Regression] gcc.c-torture/execute/memset-3.c  Fails with -march=pentium-m -O1
  2009-01-02 18:45 [Bug target/38708] New: [4.4 Regression] gcc.c-torture/execute/memset-3.c Fails with -march=pentium-m -O1 pinskia at gcc dot gnu dot org
@ 2009-01-02 18:49 ` pinskia at gcc dot gnu dot org
  2009-01-02 18:51 ` pinskia at gcc dot gnu dot org
                   ` (14 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2009-01-02 18:49 UTC (permalink / raw)
  To: gcc-bugs



-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |critical
   Target Milestone|---                         |4.4.0


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


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

* [Bug target/38708] [4.4 Regression] gcc.c-torture/execute/memset-3.c  Fails with -march=pentium-m -O1
  2009-01-02 18:45 [Bug target/38708] New: [4.4 Regression] gcc.c-torture/execute/memset-3.c Fails with -march=pentium-m -O1 pinskia at gcc dot gnu dot org
  2009-01-02 18:49 ` [Bug target/38708] " pinskia at gcc dot gnu dot org
@ 2009-01-02 18:51 ` pinskia at gcc dot gnu dot org
  2009-01-02 19:03 ` [Bug target/38708] [4.4 Regression] Revision 137646 caused gcc.c-torture/execute/memset-[23].c fail with -mtune=pentium-m hjl dot tools at gmail dot com
                   ` (13 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2009-01-02 18:51 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from pinskia at gcc dot gnu dot org  2009-01-02 18:46 -------
Also fails on i386-darwin with -march=pentium-m.  Plus it works with 4.3.3 so
this is only a 4.4 regression.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 GCC target triplet|i686-pc-linux-gnu           |i?86-*-*
      Known to work|4.1.2                       |4.1.2 4.3.3


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


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

* [Bug target/38708] [4.4 Regression] Revision 137646 caused gcc.c-torture/execute/memset-[23].c fail with -mtune=pentium-m
  2009-01-02 18:45 [Bug target/38708] New: [4.4 Regression] gcc.c-torture/execute/memset-3.c Fails with -march=pentium-m -O1 pinskia at gcc dot gnu dot org
  2009-01-02 18:49 ` [Bug target/38708] " pinskia at gcc dot gnu dot org
  2009-01-02 18:51 ` pinskia at gcc dot gnu dot org
@ 2009-01-02 19:03 ` hjl dot tools at gmail dot com
  2009-01-02 22:03 ` hjl dot tools at gmail dot com
                   ` (12 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: hjl dot tools at gmail dot com @ 2009-01-02 19:03 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from hjl dot tools at gmail dot com  2009-01-02 19:01 -------
Adding -mtune=pentium-m will fail gcc.c-torture/execute/memset-2.c
with -O3 and gcc.c-torture/execute/memset-3.c with -O/-O2/-O3.


-- 

hjl dot tools at gmail dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |hjl dot tools at gmail dot
                   |                            |com, raksit at google dot
                   |                            |com
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2009-01-02 19:01:18
               date|                            |
            Summary|[4.4 Regression] gcc.c-     |[4.4 Regression] Revision
                   |torture/execute/memset-3.c  |137646 caused gcc.c-
                   |Fails with -march=pentium-m |torture/execute/memset-
                   |-O1                         |[23].c fail with -
                   |                            |mtune=pentium-m


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


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

* [Bug target/38708] [4.4 Regression] Revision 137646 caused gcc.c-torture/execute/memset-[23].c fail with -mtune=pentium-m
  2009-01-02 18:45 [Bug target/38708] New: [4.4 Regression] gcc.c-torture/execute/memset-3.c Fails with -march=pentium-m -O1 pinskia at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2009-01-02 19:03 ` [Bug target/38708] [4.4 Regression] Revision 137646 caused gcc.c-torture/execute/memset-[23].c fail with -mtune=pentium-m hjl dot tools at gmail dot com
@ 2009-01-02 22:03 ` hjl dot tools at gmail dot com
  2009-01-02 22:10 ` [Bug target/38708] [4.4 Regression] Revision 137646 caused gcc.c-torture/execute/memset-[23].c fail with -mtune=pentiumpro pinskia at gcc dot gnu dot org
                   ` (11 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: hjl dot tools at gmail dot com @ 2009-01-02 22:03 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from hjl dot tools at gmail dot com  2009-01-02 22:01 -------
i386.c has

/* Output code to set at most count & (max_size - 1) bytes starting by DEST. 
*/static void
expand_setmem_epilogue_via_loop (rtx destmem, rtx destptr, rtx value,
                                 rtx count, int max_size)
{
  count =
    expand_simple_binop (counter_mode (count), AND, count,
                         GEN_INT (max_size - 1), count, 1, OPTAB_DIRECT);
  expand_set_or_movmem_via_loop (destmem, NULL, destptr, NULL,
                                 gen_lowpart (QImode, value), count, QImode,
                                 1, max_size / 2); 
}

It seems to assume that max_size is power of 2. But there may not be
the case:

#0  expand_set_or_movmem_via_loop (destmem=0x7ffff30f17e0, srcmem=0x0, 
    destptr=0x7ffff30f1560, srcptr=0x0, value=0x7ffff30f1500, 
    count=0x7ffff30f1520, mode=QImode, unroll=1, expected_size=3)
    at /export/gnu/src/gcc-work/gcc/gcc/config/i386/i386.c:16484
#1  0x0000000000b6e7d1 in expand_setmem_epilogue_via_loop (
    destmem=0x7ffff30f17e0, destptr=0x7ffff30f1560, value=0x7ffff30f1500, 
    count=0x7ffff30f1520, max_size=7)
    at /export/gnu/src/gcc-work/gcc/gcc/config/i386/i386.c:16850
#2  0x0000000000b71af6 in ix86_expand_setmem (dst=0x7ffff30f17e0, 
    count_exp=0x7ffff30f1520, val_exp=0x7ffff30f1500, 
    align_exp=0x7ffff31f4470, expected_align_exp=0x7ffff31f4470, 
    expected_size_exp=0x7ffff31f4440)
    at /export/gnu/src/gcc-work/gcc/gcc/config/i386/i386.c:18031
#3  0x0000000000ce16cc in gen_setmemsi (operand0=0x7ffff30f1440, 
    operand1=0x7ffff30f1340, operand2=0x7ffff30f1500, operand3=0x7ffff31f4470, 
    operand4=0x7ffff31f4470, operand5=0x7ffff31f4440)
    at /export/gnu/src/gcc-work/gcc/gcc/config/i386/i386.md:19126
#4  0x000000000061478b in set_storage_via_setmem (object=0x7ffff30f1440, 
    size=0x7ffff30f1340, val=0x7ffff30f1500, align=16, expected_align=16, 
    expected_size=-1) at /export/gnu/src/gcc-work/gcc/gcc/expr.c:2807

The problem comes from

 if (label)
    {
      /* When the main loop is done, COUNT_EXP might hold original count,
         while we want to copy only COUNT_EXP & SIZE_NEEDED bytes.
         Epilogue code will actually copy COUNT_EXP & EPILOGUE_SIZE_NEEDED
         bytes. Compensate if needed.  */

      if (size_needed < desired_align - align)
        {     
          tmp = 
            expand_simple_binop (counter_mode (count_exp), AND, count_exp,
                                 GEN_INT (size_needed - 1), count_exp, 1,
                                 OPTAB_DIRECT);
          size_needed = desired_align - align + 1;
          if (tmp != count_exp)
            emit_move_insn (count_exp, tmp); 
        }     
      emit_label (label);
      LABEL_NUSES (label) = 1;
    }

size_needed won't be power of 2. If we add

--- ./i386.c.align      2008-12-23 09:34:11.000000000 -0800
+++ ./i386.c    2009-01-02 14:00:33.000000000 -0800
@@ -16751,6 +16751,7 @@ expand_movmem_epilogue (rtx destmem, rtx
     }
   if (max_size > 8)
     {
+      gcc_assert (max_size == (max_size & -max_size));
       count = expand_simple_binop (GET_MODE (count), AND, count, GEN_INT
(max_size - 1),
                                    count, 1, OPTAB_DIRECT);
       expand_set_or_movmem_via_loop (destmem, srcmem, destptr, srcptr, NULL,
@@ -16844,6 +16845,7 @@ static void
 expand_setmem_epilogue_via_loop (rtx destmem, rtx destptr, rtx value,
                                 rtx count, int max_size)
 {
+  gcc_assert (max_size == (max_size & -max_size));
   count =
     expand_simple_binop (counter_mode (count), AND, count,
                         GEN_INT (max_size - 1), count, 1, OPTAB_DIRECT);

we will get an error.


-- 

hjl dot tools at gmail dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jh at suse dot cz


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


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

* [Bug target/38708] [4.4 Regression] Revision 137646 caused gcc.c-torture/execute/memset-[23].c fail with -mtune=pentiumpro
  2009-01-02 18:45 [Bug target/38708] New: [4.4 Regression] gcc.c-torture/execute/memset-3.c Fails with -march=pentium-m -O1 pinskia at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2009-01-02 22:03 ` hjl dot tools at gmail dot com
@ 2009-01-02 22:10 ` pinskia at gcc dot gnu dot org
  2009-01-03  8:47 ` jakub at gcc dot gnu dot org
                   ` (10 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2009-01-02 22:10 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from pinskia at gcc dot gnu dot org  2009-01-02 22:08 -------
-march=pentiumpro  is enough to reproduce the failure. 


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[4.4 Regression] Revision   |[4.4 Regression] Revision
                   |137646 caused gcc.c-        |137646 caused gcc.c-
                   |torture/execute/memset-     |torture/execute/memset-
                   |[23].c fail with -          |[23].c fail with -
                   |mtune=pentium-m             |mtune=pentiumpro


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


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

* [Bug target/38708] [4.4 Regression] Revision 137646 caused gcc.c-torture/execute/memset-[23].c fail with -mtune=pentiumpro
  2009-01-02 18:45 [Bug target/38708] New: [4.4 Regression] gcc.c-torture/execute/memset-3.c Fails with -march=pentium-m -O1 pinskia at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2009-01-02 22:10 ` [Bug target/38708] [4.4 Regression] Revision 137646 caused gcc.c-torture/execute/memset-[23].c fail with -mtune=pentiumpro pinskia at gcc dot gnu dot org
@ 2009-01-03  8:47 ` jakub at gcc dot gnu dot org
  2009-01-03  9:10 ` jakub at gcc dot gnu dot org
                   ` (9 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: jakub at gcc dot gnu dot org @ 2009-01-03  8:47 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from jakub at gcc dot gnu dot org  2009-01-03 08:46 -------
There are several issues.  One is what H.J. mentioned, seen e.g. on:
char buf[8] __attribute__((aligned));
char A = 'A';
int len = 1;

void __attribute__((noinline))
check (void)
{
  if (__builtin_memcmp (buf, "\0\0A\0\0\0\0\0", 8))
    __builtin_abort ();
}

int
main ()
{
  __builtin_memset (buf + 2, A, len);
  check ();
  return 0;
}
with -O -mtune=pentium-m -m32.  This can be fixed by adding
max_size = smallest_pow2_greater_than (max_size - 1); at the start of
expand_setmem_epilogue_via_loop.  But another testcase with the same options
that still fails is:
char buf[8] __attribute__((aligned)) = "AAAAAAAA";
char A = 'A';
int len = 4;

void __attribute__((noinline))
check (void)
{
  if (__builtin_memcmp (buf, "AAAA\0\0\0\0", 8))
    __builtin_abort ();
}

int
main ()
{
  __builtin_memset (buf + 4, '\0', len);
  check ();
  return 0;
}


-- 


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


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

* [Bug target/38708] [4.4 Regression] Revision 137646 caused gcc.c-torture/execute/memset-[23].c fail with -mtune=pentiumpro
  2009-01-02 18:45 [Bug target/38708] New: [4.4 Regression] gcc.c-torture/execute/memset-3.c Fails with -march=pentium-m -O1 pinskia at gcc dot gnu dot org
                   ` (5 preceding siblings ...)
  2009-01-03  8:47 ` jakub at gcc dot gnu dot org
@ 2009-01-03  9:10 ` jakub at gcc dot gnu dot org
  2009-01-03 10:27 ` jakub at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: jakub at gcc dot gnu dot org @ 2009-01-03  9:10 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from jakub at gcc dot gnu dot org  2009-01-03 09:09 -------
--- i386.c.jj4        2008-12-27 10:12:25.000000000 +0100
+++ i386.c        2009-01-03 10:03:05.000000000 +0100
@@ -18012,13 +18012,12 @@ ix86_expand_setmem (rtx dst, rtx count_e
          Epilogue code will actually copy COUNT_EXP & EPILOGUE_SIZE_NEEDED
          bytes. Compensate if needed.  */

-      if (size_needed < desired_align - align)
+      if (size_needed < epilogue_size_needed)
         {
           tmp =
             expand_simple_binop (counter_mode (count_exp), AND, count_exp,
          GEN_INT (size_needed - 1), count_exp, 1,
          OPTAB_DIRECT);
-          size_needed = desired_align - align + 1;
           if (tmp != count_exp)
             emit_move_insn (count_exp, tmp);
         }
@@ -18029,10 +18028,10 @@ ix86_expand_setmem (rtx dst, rtx count_e
     {
       if (force_loopy_epilogue)
         expand_setmem_epilogue_via_loop (dst, destreg, val_exp, count_exp,
-         size_needed);
+         epilogue_size_needed);
       else
         expand_setmem_epilogue (dst, destreg, promoted_val, count_exp,
-        size_needed);
+        epilogue_size_needed);
     }
   if (jump_around_label)
     emit_label (jump_around_label);

instead seems to fix memset-3.c with -mtune=pentium-m -m32 at all optimizations
levels (and is what ix86_expand_movmem does).  But memset-2.c still fails, and
not just at -O3, but also at -O2.


-- 


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


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

* [Bug target/38708] [4.4 Regression] Revision 137646 caused gcc.c-torture/execute/memset-[23].c fail with -mtune=pentiumpro
  2009-01-02 18:45 [Bug target/38708] New: [4.4 Regression] gcc.c-torture/execute/memset-3.c Fails with -march=pentium-m -O1 pinskia at gcc dot gnu dot org
                   ` (6 preceding siblings ...)
  2009-01-03  9:10 ` jakub at gcc dot gnu dot org
@ 2009-01-03 10:27 ` jakub at gcc dot gnu dot org
  2009-01-03 10:28 ` jakub at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: jakub at gcc dot gnu dot org @ 2009-01-03 10:27 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from jakub at gcc dot gnu dot org  2009-01-03 10:26 -------
Created an attachment (id=17025)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=17025&action=view)
gcc44-pr38708.patch

For size_needed, we never want any epilogue.  This cures memset-2.c at -O2, but
-O3 still fails.


-- 


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


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

* [Bug target/38708] [4.4 Regression] Revision 137646 caused gcc.c-torture/execute/memset-[23].c fail with -mtune=pentiumpro
  2009-01-02 18:45 [Bug target/38708] New: [4.4 Regression] gcc.c-torture/execute/memset-3.c Fails with -march=pentium-m -O1 pinskia at gcc dot gnu dot org
                   ` (7 preceding siblings ...)
  2009-01-03 10:27 ` jakub at gcc dot gnu dot org
@ 2009-01-03 10:28 ` jakub at gcc dot gnu dot org
  2009-01-03 11:40 ` jakub at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: jakub at gcc dot gnu dot org @ 2009-01-03 10:28 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from jakub at gcc dot gnu dot org  2009-01-03 10:26 -------
I meant for size_needed == 1.


-- 


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


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

* [Bug target/38708] [4.4 Regression] Revision 137646 caused gcc.c-torture/execute/memset-[23].c fail with -mtune=pentiumpro
  2009-01-02 18:45 [Bug target/38708] New: [4.4 Regression] gcc.c-torture/execute/memset-3.c Fails with -march=pentium-m -O1 pinskia at gcc dot gnu dot org
                   ` (8 preceding siblings ...)
  2009-01-03 10:28 ` jakub at gcc dot gnu dot org
@ 2009-01-03 11:40 ` jakub at gcc dot gnu dot org
  2009-01-04 14:26 ` jakub at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: jakub at gcc dot gnu dot org @ 2009-01-03 11:40 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from jakub at gcc dot gnu dot org  2009-01-03 11:39 -------
I ran check-gcc RUNTESTFLAGS='execute.exp
--target_board=unix/{-m32,-m32/-mtune=pentium-m,-m64}/-mstringop-strategy={rep_byte,libcall,rep_4byte,rep_8byte,byte_loop,loop,unrolled_loop}'
before and after the patch.  In all cases, -m32 together with
-mstringop-strategy=rep_8byte
ICEs in many testcases, obviously we need to reject -m32
-mstringop-strategy=rep_8byte.
Other than that, we have:
 unix/-m64/-mstringop-strategy=loop
 FAIL: gcc.c-torture/execute/memset-2.c execution,  -O2 
 FAIL: gcc.c-torture/execute/memset-2.c execution,  -O3 -fomit-frame-pointer 
 FAIL: gcc.c-torture/execute/memset-2.c execution,  -O3 -fomit-frame-pointer
-funroll-loops 
 FAIL: gcc.c-torture/execute/memset-2.c execution,  -O3 -fomit-frame-pointer
-funroll-all-loops -finline-functions 
 FAIL: gcc.c-torture/execute/memset-2.c execution,  -O3 -g 
(before and after the patch) and:
 unix/-m32/-mtune=pentium-m/-mstringop-strategy=rep_byte
-FAIL: gcc.c-torture/execute/memcpy-2.c execution,  -O1 
-FAIL: gcc.c-torture/execute/memcpy-2.c execution,  -O2 
-FAIL: gcc.c-torture/execute/memcpy-2.c execution,  -O3 -fomit-frame-pointer 
-FAIL: gcc.c-torture/execute/memcpy-2.c execution,  -O3 -fomit-frame-pointer
-funroll-loops 
-FAIL: gcc.c-torture/execute/memcpy-2.c execution,  -O3 -fomit-frame-pointer
-funroll-all-loops -finline-functions 
-FAIL: gcc.c-torture/execute/memcpy-2.c execution,  -O3 -g 
 FAIL: gcc.c-torture/execute/memset-1.c execution,  -O1 
 FAIL: gcc.c-torture/execute/memset-1.c execution,  -O2 
 FAIL: gcc.c-torture/execute/memset-1.c execution,  -O3 -fomit-frame-pointer 
 FAIL: gcc.c-torture/execute/memset-1.c execution,  -O3 -fomit-frame-pointer
-funroll-loops 
 FAIL: gcc.c-torture/execute/memset-1.c execution,  -O3 -fomit-frame-pointer
-funroll-all-loops -finline-functions 
 FAIL: gcc.c-torture/execute/memset-1.c execution,  -O3 -g 
 FAIL: gcc.c-torture/execute/memset-2.c execution,  -O3 -fomit-frame-pointer 
 FAIL: gcc.c-torture/execute/memset-2.c execution,  -O3 -fomit-frame-pointer
-funroll-loops 
 FAIL: gcc.c-torture/execute/memset-2.c execution,  -O3 -fomit-frame-pointer
-funroll-all-loops -finline-functions 
 FAIL: gcc.c-torture/execute/memset-2.c execution,  -O3 -g 
 FAIL: gcc.c-torture/execute/memset-3.c execution,  -O1 
 FAIL: gcc.c-torture/execute/memset-3.c execution,  -O2 
 FAIL: gcc.c-torture/execute/memset-3.c execution,  -O3 -fomit-frame-pointer 
 FAIL: gcc.c-torture/execute/memset-3.c execution,  -O3 -fomit-frame-pointer
-funroll-loops 
 FAIL: gcc.c-torture/execute/memset-3.c execution,  -O3 -fomit-frame-pointer
-funroll-all-loops -finline-functions 
 FAIL: gcc.c-torture/execute/memset-3.c execution,  -O3 -g 
 unix/-m32/-mtune=pentium-m/-mstringop-strategy=rep_4byte
-FAIL: gcc.c-torture/execute/memset-3.c execution,  -O1 
-FAIL: gcc.c-torture/execute/memset-3.c execution,  -O2 
-FAIL: gcc.c-torture/execute/memset-3.c execution,  -O3 -fomit-frame-pointer 
-FAIL: gcc.c-torture/execute/memset-3.c execution,  -O3 -fomit-frame-pointer
-funroll-loops 
-FAIL: gcc.c-torture/execute/memset-3.c execution,  -O3 -fomit-frame-pointer
-funroll-all-loops -finline-functions 
-FAIL: gcc.c-torture/execute/memset-3.c execution,  -O3 -g 

( FAIL is before+after the patch, -FAIL is before the patch, cured by the
patch).
To reject rep_8byte for -m32 we IMHO want:
--- i386.c.jj42008-12-27 10:12:25.000000000 +0100
+++ i386.c2009-01-03 11:53:15.000000000 +0100
@@ -2686,7 +2686,8 @@ override_options (bool main_args_p)
 stringop_alg = libcall;
       else if (!strcmp (ix86_stringop_string, "rep_4byte"))
 stringop_alg = rep_prefix_4_byte;
-      else if (!strcmp (ix86_stringop_string, "rep_8byte"))
+      else if (!strcmp (ix86_stringop_string, "rep_8byte")
+       && TARGET_64BIT)
 stringop_alg = rep_prefix_8_byte;
       else if (!strcmp (ix86_stringop_string, "byte_loop"))
 stringop_alg = loop_1_byte;

and obviously the remaining FAILs need to be investigated.


-- 


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


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

* [Bug target/38708] [4.4 Regression] Revision 137646 caused gcc.c-torture/execute/memset-[23].c fail with -mtune=pentiumpro
  2009-01-02 18:45 [Bug target/38708] New: [4.4 Regression] gcc.c-torture/execute/memset-3.c Fails with -march=pentium-m -O1 pinskia at gcc dot gnu dot org
                   ` (9 preceding siblings ...)
  2009-01-03 11:40 ` jakub at gcc dot gnu dot org
@ 2009-01-04 14:26 ` jakub at gcc dot gnu dot org
  2009-01-05 11:32 ` rguenth at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: jakub at gcc dot gnu dot org @ 2009-01-04 14:26 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #10 from jakub at gcc dot gnu dot org  2009-01-04 14:26 -------
The problem is that if size is smaller than epilogue_size_needed, desired_align
> align and size_needed == 1, then ix86_expand_setmem jumps around the
initialization of promoted_val (when val_exp isn't CONST_INT) and alignment,
but then uses promoted_val for rep stosb (which is thus uninitialized).
I have a fix.


-- 

jakub at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |jakub at gcc dot gnu dot org
                   |dot org                     |
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2009-01-02 19:01:18         |2009-01-04 14:26:28
               date|                            |


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


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

* [Bug target/38708] [4.4 Regression] Revision 137646 caused gcc.c-torture/execute/memset-[23].c fail with -mtune=pentiumpro
  2009-01-02 18:45 [Bug target/38708] New: [4.4 Regression] gcc.c-torture/execute/memset-3.c Fails with -march=pentium-m -O1 pinskia at gcc dot gnu dot org
                   ` (10 preceding siblings ...)
  2009-01-04 14:26 ` jakub at gcc dot gnu dot org
@ 2009-01-05 11:32 ` rguenth at gcc dot gnu dot org
  2009-01-05 11:44 ` rguenth at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2009-01-05 11:32 UTC (permalink / raw)
  To: gcc-bugs



-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P2


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


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

* [Bug target/38708] [4.4 Regression] Revision 137646 caused gcc.c-torture/execute/memset-[23].c fail with -mtune=pentiumpro
  2009-01-02 18:45 [Bug target/38708] New: [4.4 Regression] gcc.c-torture/execute/memset-3.c Fails with -march=pentium-m -O1 pinskia at gcc dot gnu dot org
                   ` (11 preceding siblings ...)
  2009-01-05 11:32 ` rguenth at gcc dot gnu dot org
@ 2009-01-05 11:44 ` rguenth at gcc dot gnu dot org
  2009-01-06 11:13 ` jakub at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2009-01-05 11:44 UTC (permalink / raw)
  To: gcc-bugs



-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P2                          |P1


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


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

* [Bug target/38708] [4.4 Regression] Revision 137646 caused gcc.c-torture/execute/memset-[23].c fail with -mtune=pentiumpro
  2009-01-02 18:45 [Bug target/38708] New: [4.4 Regression] gcc.c-torture/execute/memset-3.c Fails with -march=pentium-m -O1 pinskia at gcc dot gnu dot org
                   ` (12 preceding siblings ...)
  2009-01-05 11:44 ` rguenth at gcc dot gnu dot org
@ 2009-01-06 11:13 ` jakub at gcc dot gnu dot org
  2009-01-09 17:13 ` jakub at gcc dot gnu dot org
  2009-01-09 17:14 ` jakub at gcc dot gnu dot org
  15 siblings, 0 replies; 17+ messages in thread
From: jakub at gcc dot gnu dot org @ 2009-01-06 11:13 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #11 from jakub at gcc dot gnu dot org  2009-01-06 11:13 -------
*** Bug 38686 has been marked as a duplicate of this bug. ***


-- 


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


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

* [Bug target/38708] [4.4 Regression] Revision 137646 caused gcc.c-torture/execute/memset-[23].c fail with -mtune=pentiumpro
  2009-01-02 18:45 [Bug target/38708] New: [4.4 Regression] gcc.c-torture/execute/memset-3.c Fails with -march=pentium-m -O1 pinskia at gcc dot gnu dot org
                   ` (13 preceding siblings ...)
  2009-01-06 11:13 ` jakub at gcc dot gnu dot org
@ 2009-01-09 17:13 ` jakub at gcc dot gnu dot org
  2009-01-09 17:14 ` jakub at gcc dot gnu dot org
  15 siblings, 0 replies; 17+ messages in thread
From: jakub at gcc dot gnu dot org @ 2009-01-09 17:13 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #12 from jakub at gcc dot gnu dot org  2009-01-09 17:13 -------
Subject: Bug 38708

Author: jakub
Date: Fri Jan  9 17:12:40 2009
New Revision: 143211

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=143211
Log:
        PR target/38686
        PR target/38708
        * config/i386/i386.c (override_options): Reject
        -mstringop-strategy=rep_8byte with -m32.
        (ix86_expand_movmem): For size_needed == 1 set epilogue_size_needed
        to 1.  Do count comparison against epilogue_size_needed at compile
        time even when count_exp was constant forced into register.  For
        size_needed don't jump to epilogue, instead just avoid aligning
        and invoke the body algorithm.  If need_zero_guard, add zero guard
        even if count is non-zero, but smaller than size_needed + number of
        bytes that could be stored for alignment.
        (ix86_expand_setmem): For size_needed == 1 set epilogue_size_needed
        to 1.  If need_zero_guard, add zero guard even if count is non-zero,
        but smaller than size_needed + number of bytes that could be stored
        for alignment.  Compare size_needed with epilogue_size_needed instead
        of desired_align - align, don't adjust size_needed, pass
        epilogue_size_needed to the epilogue expanders.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/config/i386/i386.c


-- 


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


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

* [Bug target/38708] [4.4 Regression] Revision 137646 caused gcc.c-torture/execute/memset-[23].c fail with -mtune=pentiumpro
  2009-01-02 18:45 [Bug target/38708] New: [4.4 Regression] gcc.c-torture/execute/memset-3.c Fails with -march=pentium-m -O1 pinskia at gcc dot gnu dot org
                   ` (14 preceding siblings ...)
  2009-01-09 17:13 ` jakub at gcc dot gnu dot org
@ 2009-01-09 17:14 ` jakub at gcc dot gnu dot org
  15 siblings, 0 replies; 17+ messages in thread
From: jakub at gcc dot gnu dot org @ 2009-01-09 17:14 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #13 from jakub at gcc dot gnu dot org  2009-01-09 17:13 -------
Fixed.


-- 

jakub at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED


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


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

end of thread, other threads:[~2009-01-09 17:14 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-01-02 18:45 [Bug target/38708] New: [4.4 Regression] gcc.c-torture/execute/memset-3.c Fails with -march=pentium-m -O1 pinskia at gcc dot gnu dot org
2009-01-02 18:49 ` [Bug target/38708] " pinskia at gcc dot gnu dot org
2009-01-02 18:51 ` pinskia at gcc dot gnu dot org
2009-01-02 19:03 ` [Bug target/38708] [4.4 Regression] Revision 137646 caused gcc.c-torture/execute/memset-[23].c fail with -mtune=pentium-m hjl dot tools at gmail dot com
2009-01-02 22:03 ` hjl dot tools at gmail dot com
2009-01-02 22:10 ` [Bug target/38708] [4.4 Regression] Revision 137646 caused gcc.c-torture/execute/memset-[23].c fail with -mtune=pentiumpro pinskia at gcc dot gnu dot org
2009-01-03  8:47 ` jakub at gcc dot gnu dot org
2009-01-03  9:10 ` jakub at gcc dot gnu dot org
2009-01-03 10:27 ` jakub at gcc dot gnu dot org
2009-01-03 10:28 ` jakub at gcc dot gnu dot org
2009-01-03 11:40 ` jakub at gcc dot gnu dot org
2009-01-04 14:26 ` jakub at gcc dot gnu dot org
2009-01-05 11:32 ` rguenth at gcc dot gnu dot org
2009-01-05 11:44 ` rguenth at gcc dot gnu dot org
2009-01-06 11:13 ` jakub at gcc dot gnu dot org
2009-01-09 17:13 ` jakub at gcc dot gnu dot org
2009-01-09 17:14 ` jakub 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).