Launchpad has imported 16 comments from the remote bug at
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=38902.

If you reply to an imported comment from within Launchpad, your comment
will be sent to the remote bug automatically. Read more about
Launchpad's inter-bugtracker facilities at
https://documentation.ubuntu.com/launchpad/user/reference/bugs/multi-project-bugs/about-multi-project-bugs/#bugs-in-external-trackers.

------------------------------------------------------------------------
On 2009-01-18T00:19:46+00:00 Hjl-tools wrote:

[hjl@gnu-17 gcc]$ /export/gnu/import/svn/gcc-test/bld/gcc/xgcc 
-B/export/gnu/import/svn/gcc-test/bld/gcc/ 
/export/gnu/import/svn/gcc-test/src-4.3/gcc/testsuite/gcc.dg/pr38616.c   -S 
-fstack-protector -fno-show-column  -lm      -O2 -Wall -w
[hjl@gnu-17 gcc]$ ./a.out
[hjl@gnu-17 gcc]$ echo $?
255
[hjl@gnu-17 gcc]$ /export/gnu/import/svn/gcc-test/bld/gcc/xgcc -v
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: ../src-4.3/configure --enable-clocale=gnu --with-system-zlib 
--enable-shared --with-demangler-in-ld
Thread model: posix
gcc version 4.3.3 20090117 (prerelease) [gcc-4_3-branch revision 143471] (GCC)
[hjl@gnu-17 gcc]$

Reply at:
https://bugs.launchpad.net/ubuntu/+source/gcc-4.3/+bug/316019/comments/4

------------------------------------------------------------------------
On 2009-01-18T01:41:26+00:00 Hjl-tools wrote:

bash-3.2$ cat /tmp/x.c
extern void abort ();

int foo (const char *, const char *);

int main (void)
{
  char buffer[1024]="";
  __builtin_strcpy (buffer, "1234567890abcdefghijklmno");
  if (foo (buffer, "1234567890abcdefghijklmno"))
    abort ();
}
bash-3.2$ cat /tmp/y.c
int
foo (const char *x , const char * y)
{
  return __builtin_strcmp (x, y);
}
bash-3.2$ ./xgcc -B./ -O2 -m32 -c /tmp/y.c
bash-3.2$ ./xgcc -B./ -O2 -m32 -O2 -fstack-protector /tmp/x.c y.o
bash-3.2$ ./a.out 
Aborted
bash-3.2$ 

Reply at:
https://bugs.launchpad.net/ubuntu/+source/gcc-4.3/+bug/316019/comments/5

------------------------------------------------------------------------
On 2009-01-18T01:43:27+00:00 Hjl-tools wrote:

bash-3.2$ cat /tmp/x.c
extern void abort ();

int foo (const char *, const char *);

int main (void)
{
  char buffer[1024]="";
  __builtin_strcpy (buffer, "1234567890abcdefghijklmno");
  if (foo (buffer, "1234567890abcdefghijklmno"))
    abort ();
}
bash-3.2$ cat /tmp/y.c
int
foo (const char *x , const char * y)
{
  return __builtin_strcmp (x, y);
}
bash-3.2$ ./xgcc -B./ -O2 -m32 -c /tmp/y.c
bash-3.2$ ./xgcc -B./ -O2 -m32 -O2 -fstack-protector /tmp/x.c -c
bash-3.2$ ./xgcc -B./ -m32 x.o  y.o
bash-3.2$ ./a.out 
Aborted
bash-3.2$ 

Reply at:
https://bugs.launchpad.net/ubuntu/+source/gcc-4.3/+bug/316019/comments/6

------------------------------------------------------------------------
On 2009-01-18T10:01:59+00:00 Matthias Klose wrote:

yes, I do see this failure again as well.


Reply at: 
https://bugs.launchpad.net/ubuntu/+source/gcc-4.3/+bug/316019/comments/7

------------------------------------------------------------------------
On 2009-01-18T17:05:18+00:00 Hjl-tools wrote:

bash-3.2$ cat /tmp/x.c
extern void abort ();
int foo (const char *, const char *);
void bar (void)
{
  char buffer[1024]="";
  __builtin_strcpy (buffer, "1234567890abcdefghijklmno");
  if (foo (buffer, "1234567890abcdefghijklmno"))
    abort ();
}
bash-3.2$ cat /tmp/y.c
int
foo (const char *x , const char * y)
{
  return __builtin_strcmp (x, y);
}
extern void bar (void);
int
main ()
{
  bar ();
  return 0;
}
bash-3.2$ ./xgcc -B./ -O2 -m32 -O2 -fstack-protector /tmp/x.c -c
bash-3.2$ ./xgcc -B./ -m32 /tmp/y.c -c
bash-3.2$ ./xgcc -B./ -m32 x.o y.o
bash-3.2$ ./a.out 
Aborted
bash-3.2$ ./xgcc -B./ -O2 -m32 -O2 -fstack-protector /tmp/x.c -S
bash-3.2$ cat x.s
        .file   "x.c"
        .section        .rodata.str1.1,"aMS",@progbits,1
.LC0:
        .string "1234567890abcdefghijklmno"
        .text
        .p2align 4,,15
.globl bar
        .type   bar, @function
bar:
        pushl   %ebp
        movl    $255, %ecx
        movl    %esp, %ebp
        pushl   %edi
        subl    $1060, %esp
        movl    %gs:20, %eax
        movl    %eax, -8(%ebp)
        xorl    %eax, %eax
        leal    -1028(%ebp), %edi
        movl    $875770417, -1032(%ebp)
        movl    $1650536505, -1024(%ebp)
        movl    $1717920867, -1020(%ebp)
        movl    $1785292903, -1016(%ebp)
        movl    $1852664939, -1012(%ebp)
        rep stosl <<<<<<< Wrong place
        leal    -1032(%ebp), %eax
        movl    $943142453, -1028(%ebp)
        movw    $111, -1008(%ebp)
        movl    $.LC0, 4(%esp)
        movl    %eax, (%esp)
        call    foo
        testl   %eax, %eax
        jne     .L7
        movl    -8(%ebp), %eax
        xorl    %gs:20, %eax
        jne     .L8
        addl    $1060, %esp
        popl    %edi
        popl    %ebp
        .p2align 4,,3
        .p2align 3
        ret
.L7:
        .p2align 4,,6
        .p2align 3
        call    abort
.L8:
        .p2align 4,,5
        .p2align 3
        call    __stack_chk_fail
        .size   bar, .-bar


Reply at: 
https://bugs.launchpad.net/ubuntu/+source/gcc-4.3/+bug/316019/comments/9

------------------------------------------------------------------------
On 2009-01-18T18:12:21+00:00 Kees Cook wrote:

Created attachment 17135
multiple tests for the regression

This contains a series of tests, none of which should fail.

Reply at:
https://bugs.launchpad.net/ubuntu/+source/gcc-4.3/+bug/316019/comments/10

------------------------------------------------------------------------
On 2009-01-18T18:26:29+00:00 Hjl-tools wrote:

Revision 142891

http://gcc.gnu.org/ml/gcc-cvs/2008-12/msg00591.html

fixes this.

Reply at:
https://bugs.launchpad.net/ubuntu/+source/gcc-4.3/+bug/316019/comments/12

------------------------------------------------------------------------
On 2009-01-18T18:27:43+00:00 Hjl-tools wrote:

(In reply to comment #5)
> Created an attachment (id=17135) [edit]
> multiple tests for the regression
> 
> This contains a series of tests, none of which should fail.
> 

Some of those tests failed on both Linux/ia32 and Linux/x86-64.

Reply at:
https://bugs.launchpad.net/ubuntu/+source/gcc-4.3/+bug/316019/comments/13

------------------------------------------------------------------------
On 2009-01-18T22:02:21+00:00 Hjl-tools wrote:

This is introduced by revision 128537:

http://gcc.gnu.org/ml/gcc-cvs/2007-09/msg00531.html
http://gcc.gnu.org/ml/gcc-patches/2007-09/msg00084.html

Reply at:
https://bugs.launchpad.net/ubuntu/+source/gcc-4.3/+bug/316019/comments/14

------------------------------------------------------------------------
On 2009-01-18T22:06:38+00:00 Hjl-tools wrote:

*** Bug 38616 has been marked as a duplicate of this bug. ***

Reply at:
https://bugs.launchpad.net/ubuntu/+source/gcc-4.3/+bug/316019/comments/15

------------------------------------------------------------------------
On 2009-01-19T19:30:30+00:00 Hjl-tools wrote:

The problem is x86 doesn't set the memory size correct for rep_stos.
Gcc 4.3.3 gave:

(gdb) call debug_rtx (destmem)
(mem/s/c:BLK (reg:DI 59) [3 buffer+8 S1 A64])
(gdb) 

Jakub's patch corrected it to

(gdb) call debug_rtx (destmem)
(mem/s/c:BLK (reg:DI 59) [0 buffer+8 S1016 A64])
(gdb) 

Since scheduler thinks the size of memory is 1, it changed

(insn:HI 13 12 15 2 x.c:5 (parallel [
            (set (reg:DI 2 cx [62])
                (const_int 0 [0x0]))
            (set (reg:DI 5 di [59])
                (plus:DI (ashift:DI (reg:DI 2 cx [62])
                        (const_int 3 [0x3]))
                    (reg:DI 5 di [59])))
            (set (mem/s/c:BLK (reg:DI 5 di [59]) [3 buffer+8 S1 A64])
                (const_int 0 [0x0]))
            (use (reg:DI 0 ax [60]))
            (use (reg:DI 2 cx [62]))
        ]) 801 {*rep_stosdi_rex64} (expr_list:REG_DEAD (reg:DI 0 ax [60])
        (expr_list:REG_UNUSED (reg:DI 5 di [59])
            (expr_list:REG_UNUSED (reg:DI 2 cx [62])
                (nil)))))
...
(insn:HI 22 65 24 2 x.c:6 (set (mem/s/c:HI (plus:DI (reg/f:DI 7 sp)
                (const_int 24 [0x18])) [0 buffer+24 S2 A64])
        (const_int 111 [0x6f])) 53 {*movhi_1} (nil)

into

(insn:HI 22 65 24 2 x.c:6 (set (mem/s/c:HI (plus:DI (reg/f:DI 7 sp)
                (const_int 24 [0x18])) [0 buffer+24 S2 A64])
        (const_int 111 [0x6f])) 53 {*movhi_1} (nil)
...
(insn:TI 13 22 68 2 x.c:5 (parallel [
            (set (reg:DI 2 cx [62])
                (const_int 0 [0x0]))
            (set (reg:DI 5 di [59])
                (plus:DI (ashift:DI (reg:DI 2 cx [62])
                        (const_int 3 [0x3]))
                    (reg:DI 5 di [59])))
            (set (mem/s/c:BLK (reg:DI 5 di [59]) [3 buffer+8 S1 A64])
                (const_int 0 [0x0]))
            (use (reg:DI 0 ax [60]))
            (use (reg:DI 2 cx [62]))
        ]) 801 {*rep_stosdi_rex64} (expr_list:REG_DEAD (reg:DI 0 ax [60])
        (expr_list:REG_UNUSED (reg:DI 5 di [59])
            (expr_list:REG_UNUSED (reg:DI 2 cx [62])
                (nil)))))

Reply at:
https://bugs.launchpad.net/ubuntu/+source/gcc-4.3/+bug/316019/comments/16

------------------------------------------------------------------------
On 2009-01-19T20:30:19+00:00 Hjl-tools wrote:

A patch is posted at

http://gcc.gnu.org/ml/gcc-patches/2009-01/msg00948.html

Reply at:
https://bugs.launchpad.net/ubuntu/+source/gcc-4.3/+bug/316019/comments/17

------------------------------------------------------------------------
On 2009-01-20T14:40:46+00:00 Hjl-0 wrote:

Subject: Bug 38902

Author: hjl
Date: Tue Jan 20 14:40:30 2009
New Revision: 143516

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=143516
Log:
2009-01-20  Kees Cook  <[email protected]>
            H.J. Lu  <[email protected]>

        PR target/38902
        * gcc.dg/pr38902.c: New.

Added:
    trunk/gcc/testsuite/gcc.dg/pr38902.c
Modified:
    trunk/gcc/testsuite/ChangeLog


Reply at:
https://bugs.launchpad.net/ubuntu/+source/gcc-4.3/+bug/316019/comments/19

------------------------------------------------------------------------
On 2009-01-24T10:21:12+00:00 Rguenth wrote:

GCC 4.3.3 is being released, adjusting target milestone.

Reply at:
https://bugs.launchpad.net/ubuntu/+source/gcc-4.3/+bug/316019/comments/21

------------------------------------------------------------------------
On 2009-01-24T15:31:27+00:00 Hjl-0 wrote:

Subject: Bug 38902

Author: hjl
Date: Sat Jan 24 15:31:13 2009
New Revision: 143646

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=143646
Log:
gcc/

2009-01-24  H.J. Lu  <[email protected]>

        PR target/38902
        Backport from mainline:
        2008-12-23  Jakub Jelinek  <[email protected]>

        * config/i386/i386.c (expand_movmem_via_rep_mov): Set MEM_SIZE
        correctly.
        (expand_setmem_via_rep_stos): Add ORIG_VALUE argument.  If
        ORIG_VALUE is const0_rtx and COUNT is constant, set MEM_SIZE
        on DESTMEM.
        (ix86_expand_setmem): Adjust callers.

gcc/testsuite/

2009-01-24  H.J. Lu  <[email protected]>

        Backport from mainline:
        2009-01-20  Kees Cook  <[email protected]>
                    H.J. Lu  <[email protected]>

        PR target/38902
        * gcc.dg/pr38902.c: New.

Added:
    branches/gcc-4_3-branch/gcc/testsuite/gcc.dg/pr38902.c
Modified:
    branches/gcc-4_3-branch/gcc/ChangeLog
    branches/gcc-4_3-branch/gcc/config/i386/i386.c
    branches/gcc-4_3-branch/gcc/testsuite/ChangeLog


Reply at:
https://bugs.launchpad.net/ubuntu/+source/gcc-4.3/+bug/316019/comments/22

------------------------------------------------------------------------
On 2009-01-24T17:55:12+00:00 Hjl-tools wrote:

Fixed.

Reply at:
https://bugs.launchpad.net/ubuntu/+source/gcc-4.3/+bug/316019/comments/24

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/316019

Title:
  [4.3 Regression] Wrong code when -O3 or -O2 -fstack-protector used

To manage notifications about this bug go to:
https://bugs.launchpad.net/gcc/+bug/316019/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to