public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* optimization/8632: [3.3 regression] uninitialized argument passed to leaf function w/o side-effects
@ 2002-11-25  8:48 glen
  0 siblings, 0 replies; 3+ messages in thread
From: glen @ 2002-11-25  8:48 UTC (permalink / raw)
  To: gcc-gnats


>Number:         8632
>Category:       optimization
>Synopsis:       [3.3 regression] uninitialized argument passed to leaf function w/o side-effects
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          wrong-code
>Submitter-Id:   net
>Arrival-Date:   Mon Nov 18 19:26:01 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     Glen Nakamura
>Release:        gcc version 3.3 20021118 (experimental)
>Organization:
>Environment:
i686-pc-linux-gnu
>Description:
GCC generates the following code for function main:

main:
        pushl   %ebp
        movl    %esp, %ebp
        pushl   %edi
        pushl   %esi
        xorl    %esi, %esi
        pushl   %ebx
        subl    $12, %esp
        andl    $-16, %esp
        .p2align 4,,15
.L8:
        movl    %esi, 4(%esp)
        movl    a, %eax
        movl    %eax, (%esp)
        call    foo
        testl   %eax, %eax
        je      .L14
        decl    %eax
        leal    1(%esi), %ebx
        je      .L15
.L11:
        movl    %ebx, %esi
        jmp     .L8
        .p2align 4,,7
.L15:
        movl    %ebx, 4(%esp)
        movl    %edi, (%esp)   <<< %edi is uninitialized
        call    foo
        ...

The problem goes away if foo calls another function,
or if foo writes to a global variable. The testcase also
works if we compile with any of the following:
gcc -O0 -mcpu=i686 testcase.c
gcc -O1 -mcpu=i686 testcase.c
gcc -O2 -mcpu=i586 testcase.c
>How-To-Repeat:
gcc -O2 -mcpu=i686 testcase.c
./a.out
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="testcase.c"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="testcase.c"

ZXh0ZXJuIHZvaWQgYWJvcnQgKCk7CgpzdGF0aWMgaW50IGEgPSAxMjM0NTsKCnN0YXRpYyBpbnQK
Zm9vIChpbnQgYiwgaW50IGlkeCkKewogIGlmIChiICE9IGEpCiAgICByZXR1cm4gLTE7CiAgZWxz
ZSBpZiAoaWR4IDwgMikKICAgIHJldHVybiAxOwogIGVsc2UKICAgIHJldHVybiAwOwp9CgppbnQK
bWFpbiAoKQp7CiAgaW50IGlkeCA9IDA7CgogIHdoaWxlIChmb28gKGEsIGlkeCkpCiAgICB7CiAg
ICAgIGlmIChmb28gKGEsIGlkeCkgPT0gMQoJICAmJiBmb28gKGEsIGlkeCArIDEpID09IC0xKQoJ
ewoJICBhYm9ydCAoKTsKCX0KICAgICAgKytpZHg7CiAgICB9CiAgcmV0dXJuIDA7Cn0K


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

* Re: optimization/8632: [3.3 regression] uninitialized argument passed to leaf function w/o side-effects
@ 2003-02-18 14:07 ebotcazou
  0 siblings, 0 replies; 3+ messages in thread
From: ebotcazou @ 2003-02-18 14:07 UTC (permalink / raw)
  To: gcc-bugs, gcc-prs, glen, nobody

Synopsis: [3.3 regression] uninitialized argument passed to leaf function w/o side-effects

State-Changed-From-To: open->closed
State-Changed-By: ebotcazou
State-Changed-When: Tue Feb 18 14:07:01 2003
State-Changed-Why:
    Fixed, very likely by Jan's patch.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=8632


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

* Re: optimization/8632: [3.3 regression] uninitialized argument passed to leaf function w/o side-effects
@ 2002-12-02 18:06 Glen Nakamura
  0 siblings, 0 replies; 3+ messages in thread
From: Glen Nakamura @ 2002-12-02 18:06 UTC (permalink / raw)
  To: nobody; +Cc: gcc-prs

The following reply was made to PR optimization/8632; it has been noted by GNATS.

From: Glen Nakamura <glen@imodulo.com>
To: gcc-gnats@gcc.gnu.org, gcc-bugs@gcc.gnu.org
Cc:  
Subject: Re: optimization/8632: [3.3 regression] uninitialized argument passed to leaf function w/o side-effects
Date: Mon, 2 Dec 2002 16:01:25 -1000

 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=8632
 
 This patch by Jan Hubicka fixes the problem on i686-pc-linux-gnu:
 http://gcc.gnu.org/ml/gcc-patches/2002-12/msg00136.html
 
 - glen


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

end of thread, other threads:[~2003-02-18 14:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-11-25  8:48 optimization/8632: [3.3 regression] uninitialized argument passed to leaf function w/o side-effects glen
2002-12-02 18:06 Glen Nakamura
2003-02-18 14:07 ebotcazou

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