public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/48142] New: miscompilation with -mpreferred-stack-boundary=5 -fstack-check=specific
@ 2011-03-16  2:15 zsojka at seznam dot cz
  2011-03-16 10:55 ` [Bug target/48142] [4.6/4.7 Regression] " rguenth at gcc dot gnu.org
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: zsojka at seznam dot cz @ 2011-03-16  2:15 UTC (permalink / raw)
  To: gcc-bugs

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

           Summary: miscompilation with -mpreferred-stack-boundary=5
                    -fstack-check=specific
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: zsojka@seznam.cz
              Host: x86_64-pc-linux-gnu
            Target: x86_64-pc-linux-gnu


Created attachment 23674
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=23674
reduced testcase

Output:
$ g++ -Os -mpreferred-stack-boundary=5 -fstack-check=specific
-fno-omit-frame-pointer testcase.C
$ valgrind -q ./a.out 
==16640== Invalid read of size 8
==16640==    at 0x4007D0: main (testcase.C:6)
==16640==  Address 0xfffffffffffffff8 is not stack'd, malloc'd or (recently)
free'd

(gdb) i r rsp
rsp            0xfffffffffffffff8       0xfffffffffffffff8
(gdb) disassemble
   0x00000000004007c6 <+82>:    pop    %rcx
   0x00000000004007c7 <+83>:    pop    %r10
   0x00000000004007c9 <+85>:    xor    %eax,%eax
   0x00000000004007cb <+87>:    pop    %rbp
   0x00000000004007cc <+88>:    lea    -0x8(%r10),%rsp
=> 0x00000000004007d0 <+92>:    retq   
End of assembler dump.

Tested revisions:
r171001 - fail
4.6 r170955 - fail
4.5 r170955 - OK


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

* [Bug target/48142] [4.6/4.7 Regression] miscompilation with -mpreferred-stack-boundary=5 -fstack-check=specific
  2011-03-16  2:15 [Bug target/48142] New: miscompilation with -mpreferred-stack-boundary=5 -fstack-check=specific zsojka at seznam dot cz
@ 2011-03-16 10:55 ` rguenth at gcc dot gnu.org
  2011-03-16 15:21 ` jakub at gcc dot gnu.org
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-03-16 10:55 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Guenther <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2011.03.16 10:55:01
   Target Milestone|---                         |4.6.0
            Summary|miscompilation with         |[4.6/4.7 Regression]
                   |-mpreferred-stack-boundary= |miscompilation with
                   |5 -fstack-check=specific    |-mpreferred-stack-boundary=
                   |                            |5 -fstack-check=specific
     Ever Confirmed|0                           |1

--- Comment #1 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-03-16 10:55:01 UTC ---
Confirmed.


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

* [Bug target/48142] [4.6/4.7 Regression] miscompilation with -mpreferred-stack-boundary=5 -fstack-check=specific
  2011-03-16  2:15 [Bug target/48142] New: miscompilation with -mpreferred-stack-boundary=5 -fstack-check=specific zsojka at seznam dot cz
  2011-03-16 10:55 ` [Bug target/48142] [4.6/4.7 Regression] " rguenth at gcc dot gnu.org
@ 2011-03-16 15:21 ` jakub at gcc dot gnu.org
  2011-03-17  8:27 ` ebotcazou at gcc dot gnu.org
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: jakub at gcc dot gnu.org @ 2011-03-16 15:21 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ebotcazou at gcc dot
                   |                            |gnu.org

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-03-16 14:56:01 UTC ---
Caused by http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=161952


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

* [Bug target/48142] [4.6/4.7 Regression] miscompilation with -mpreferred-stack-boundary=5 -fstack-check=specific
  2011-03-16  2:15 [Bug target/48142] New: miscompilation with -mpreferred-stack-boundary=5 -fstack-check=specific zsojka at seznam dot cz
  2011-03-16 10:55 ` [Bug target/48142] [4.6/4.7 Regression] " rguenth at gcc dot gnu.org
  2011-03-16 15:21 ` jakub at gcc dot gnu.org
@ 2011-03-17  8:27 ` ebotcazou at gcc dot gnu.org
  2011-03-17  9:38 ` jakub at gcc dot gnu.org
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: ebotcazou at gcc dot gnu.org @ 2011-03-17  8:27 UTC (permalink / raw)
  To: gcc-bugs

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

Eric Botcazou <ebotcazou at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
         AssignedTo|unassigned at gcc dot       |ebotcazou at gcc dot
                   |gnu.org                     |gnu.org

--- Comment #3 from Eric Botcazou <ebotcazou at gcc dot gnu.org> 2011-03-17 08:20:51 UTC ---
I'll fix once 4.6.0 is out.


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

* [Bug target/48142] [4.6/4.7 Regression] miscompilation with -mpreferred-stack-boundary=5 -fstack-check=specific
  2011-03-16  2:15 [Bug target/48142] New: miscompilation with -mpreferred-stack-boundary=5 -fstack-check=specific zsojka at seznam dot cz
                   ` (2 preceding siblings ...)
  2011-03-17  8:27 ` ebotcazou at gcc dot gnu.org
@ 2011-03-17  9:38 ` jakub at gcc dot gnu.org
  2011-03-31 11:45 ` [Bug target/48142] [4.6/4.7 Regression] miscompilation with -Os -mpreferred-stack-boundary=5 -fstack-check ebotcazou at gcc dot gnu.org
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: jakub at gcc dot gnu.org @ 2011-03-17  9:38 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org
   Target Milestone|4.6.0                       |4.6.1


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

* [Bug target/48142] [4.6/4.7 Regression] miscompilation with -Os -mpreferred-stack-boundary=5 -fstack-check
  2011-03-16  2:15 [Bug target/48142] New: miscompilation with -mpreferred-stack-boundary=5 -fstack-check=specific zsojka at seznam dot cz
                   ` (3 preceding siblings ...)
  2011-03-17  9:38 ` jakub at gcc dot gnu.org
@ 2011-03-31 11:45 ` ebotcazou at gcc dot gnu.org
  2011-03-31 12:01 ` ebotcazou at gcc dot gnu.org
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: ebotcazou at gcc dot gnu.org @ 2011-03-31 11:45 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Eric Botcazou <ebotcazou at gcc dot gnu.org> 2011-03-31 11:11:03 UTC ---
Author: ebotcazou
Date: Thu Mar 31 11:10:59 2011
New Revision: 171777

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=171777
Log:
    PR target/48142
    * config/i386/i386.c (ix86_adjust_stack_and_probe): Differentiate
    frame-related from frame-unrelated adjustments to the stack pointer.

Added:
    trunk/gcc/testsuite/g++.dg/other/i386-9.C
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/config/i386/i386.c
    trunk/gcc/testsuite/ChangeLog


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

* [Bug target/48142] [4.6/4.7 Regression] miscompilation with -Os -mpreferred-stack-boundary=5 -fstack-check
  2011-03-16  2:15 [Bug target/48142] New: miscompilation with -mpreferred-stack-boundary=5 -fstack-check=specific zsojka at seznam dot cz
                   ` (4 preceding siblings ...)
  2011-03-31 11:45 ` [Bug target/48142] [4.6/4.7 Regression] miscompilation with -Os -mpreferred-stack-boundary=5 -fstack-check ebotcazou at gcc dot gnu.org
@ 2011-03-31 12:01 ` ebotcazou at gcc dot gnu.org
  2011-03-31 12:13 ` ebotcazou at gcc dot gnu.org
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: ebotcazou at gcc dot gnu.org @ 2011-03-31 12:01 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Eric Botcazou <ebotcazou at gcc dot gnu.org> 2011-03-31 11:14:44 UTC ---
Author: ebotcazou
Date: Thu Mar 31 11:14:41 2011
New Revision: 171778

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=171778
Log:
    PR target/48142
    * config/i386/i386.c (ix86_adjust_stack_and_probe): Differentiate
    frame-related from frame-unrelated adjustments to the stack pointer.

Added:
    branches/gcc-4_6-branch/gcc/testsuite/g++.dg/other/i386-9.C
      - copied unchanged from r171777,
trunk/gcc/testsuite/g++.dg/other/i386-9.C
Modified:
    branches/gcc-4_6-branch/gcc/ChangeLog
    branches/gcc-4_6-branch/gcc/config/i386/i386.c
    branches/gcc-4_6-branch/gcc/testsuite/ChangeLog


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

* [Bug target/48142] [4.6/4.7 Regression] miscompilation with -Os -mpreferred-stack-boundary=5 -fstack-check
  2011-03-16  2:15 [Bug target/48142] New: miscompilation with -mpreferred-stack-boundary=5 -fstack-check=specific zsojka at seznam dot cz
                   ` (5 preceding siblings ...)
  2011-03-31 12:01 ` ebotcazou at gcc dot gnu.org
@ 2011-03-31 12:13 ` ebotcazou at gcc dot gnu.org
  2011-04-22 18:54 ` ubizjak at gmail dot com
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: ebotcazou at gcc dot gnu.org @ 2011-03-31 12:13 UTC (permalink / raw)
  To: gcc-bugs

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

Eric Botcazou <ebotcazou at gcc dot gnu.org> changed:

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

--- Comment #6 from Eric Botcazou <ebotcazou at gcc dot gnu.org> 2011-03-31 11:16:15 UTC ---
.


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

* [Bug target/48142] [4.6/4.7 Regression] miscompilation with -Os -mpreferred-stack-boundary=5 -fstack-check
  2011-03-16  2:15 [Bug target/48142] New: miscompilation with -mpreferred-stack-boundary=5 -fstack-check=specific zsojka at seznam dot cz
                   ` (6 preceding siblings ...)
  2011-03-31 12:13 ` ebotcazou at gcc dot gnu.org
@ 2011-04-22 18:54 ` ubizjak at gmail dot com
  2011-04-22 19:50 ` ebotcazou at gcc dot gnu.org
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: ubizjak at gmail dot com @ 2011-04-22 18:54 UTC (permalink / raw)
  To: gcc-bugs

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

Uros Bizjak <ubizjak at gmail dot com> changed:

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

--- Comment #7 from Uros Bizjak <ubizjak at gmail dot com> 2011-04-22 18:53:24 UTC ---
This test fails again after the fix for PR target/48723 [1,2].

PR 48723 fails due to clear omission of accounting, but this PR is more
involved and IMO, the fix there is wrong.

Reopened.

[1] http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48723
[2] http://gcc.gnu.org/ml/gcc-patches/2011-04/msg01883.html


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

* [Bug target/48142] [4.6/4.7 Regression] miscompilation with -Os -mpreferred-stack-boundary=5 -fstack-check
  2011-03-16  2:15 [Bug target/48142] New: miscompilation with -mpreferred-stack-boundary=5 -fstack-check=specific zsojka at seznam dot cz
                   ` (7 preceding siblings ...)
  2011-04-22 18:54 ` ubizjak at gmail dot com
@ 2011-04-22 19:50 ` ebotcazou at gcc dot gnu.org
  2011-04-23  7:39 ` ubizjak at gmail dot com
  2011-04-27 13:12 ` ebotcazou at gcc dot gnu.org
  10 siblings, 0 replies; 12+ messages in thread
From: ebotcazou at gcc dot gnu.org @ 2011-04-22 19:50 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 from Eric Botcazou <ebotcazou at gcc dot gnu.org> 2011-04-22 19:49:10 UTC ---
> This test fails again after the fix for PR target/48723 [1,2].

Sure, stack checking is totally broken:

Running /home/eric/svn/gcc/gcc/testsuite/gnat.dg/dg.exp ...
FAIL: gnat.dg/stack_check1.adb (test for excess errors)
WARNING: gnat.dg/stack_check1.adb compilation failed to produce executable
FAIL: gnat.dg/stack_check2.adb (test for excess errors)
WARNING: gnat.dg/stack_check2.adb compilation failed to produce executable

FAIL:   c52103x
FAIL:   c52104x
FAIL:   c52104y
FAIL:   cb1010a
FAIL:   cb1010c
FAIL:   cb1010d

FAIL: g++.dg/other/i386-9.C (internal compiler error)
FAIL: g++.dg/other/i386-9.C (test for excess errors)

I don't understand how the patch can have been installed.  I'd suggest
reverting it ASAP (and assigning PR target/48723 to me).


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

* [Bug target/48142] [4.6/4.7 Regression] miscompilation with -Os -mpreferred-stack-boundary=5 -fstack-check
  2011-03-16  2:15 [Bug target/48142] New: miscompilation with -mpreferred-stack-boundary=5 -fstack-check=specific zsojka at seznam dot cz
                   ` (8 preceding siblings ...)
  2011-04-22 19:50 ` ebotcazou at gcc dot gnu.org
@ 2011-04-23  7:39 ` ubizjak at gmail dot com
  2011-04-27 13:12 ` ebotcazou at gcc dot gnu.org
  10 siblings, 0 replies; 12+ messages in thread
From: ubizjak at gmail dot com @ 2011-04-23  7:39 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #9 from Uros Bizjak <ubizjak at gmail dot com> 2011-04-23 07:38:35 UTC ---
(In reply to comment #8)
> > This test fails again after the fix for PR target/48723 [1,2].
> 
> Sure, stack checking is totally broken:
> 
> Running /home/eric/svn/gcc/gcc/testsuite/gnat.dg/dg.exp ...
> FAIL: gnat.dg/stack_check1.adb (test for excess errors)
> WARNING: gnat.dg/stack_check1.adb compilation failed to produce executable
> FAIL: gnat.dg/stack_check2.adb (test for excess errors)
> WARNING: gnat.dg/stack_check2.adb compilation failed to produce executable
> 
> FAIL:   c52103x
> FAIL:   c52104x
> FAIL:   c52104y
> FAIL:   cb1010a
> FAIL:   cb1010c
> FAIL:   cb1010d
> 
> FAIL: g++.dg/other/i386-9.C (internal compiler error)
> FAIL: g++.dg/other/i386-9.C (test for excess errors)
> 
> I don't understand how the patch can have been installed.  I'd suggest
> reverting it ASAP (and assigning PR target/48723 to me).

OK, I have reverted it (I don't have ADA installed, and didn't notice g++
failure...).


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

* [Bug target/48142] [4.6/4.7 Regression] miscompilation with -Os -mpreferred-stack-boundary=5 -fstack-check
  2011-03-16  2:15 [Bug target/48142] New: miscompilation with -mpreferred-stack-boundary=5 -fstack-check=specific zsojka at seznam dot cz
                   ` (9 preceding siblings ...)
  2011-04-23  7:39 ` ubizjak at gmail dot com
@ 2011-04-27 13:12 ` ebotcazou at gcc dot gnu.org
  10 siblings, 0 replies; 12+ messages in thread
From: ebotcazou at gcc dot gnu.org @ 2011-04-27 13:12 UTC (permalink / raw)
  To: gcc-bugs

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

Eric Botcazou <ebotcazou at gcc dot gnu.org> changed:

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

--- Comment #10 from Eric Botcazou <ebotcazou at gcc dot gnu.org> 2011-04-27 13:09:44 UTC ---
> OK, I have reverted it (I don't have ADA installed, and didn't notice g++
> failure...).

Thanks.


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

end of thread, other threads:[~2011-04-27 13:12 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-03-16  2:15 [Bug target/48142] New: miscompilation with -mpreferred-stack-boundary=5 -fstack-check=specific zsojka at seznam dot cz
2011-03-16 10:55 ` [Bug target/48142] [4.6/4.7 Regression] " rguenth at gcc dot gnu.org
2011-03-16 15:21 ` jakub at gcc dot gnu.org
2011-03-17  8:27 ` ebotcazou at gcc dot gnu.org
2011-03-17  9:38 ` jakub at gcc dot gnu.org
2011-03-31 11:45 ` [Bug target/48142] [4.6/4.7 Regression] miscompilation with -Os -mpreferred-stack-boundary=5 -fstack-check ebotcazou at gcc dot gnu.org
2011-03-31 12:01 ` ebotcazou at gcc dot gnu.org
2011-03-31 12:13 ` ebotcazou at gcc dot gnu.org
2011-04-22 18:54 ` ubizjak at gmail dot com
2011-04-22 19:50 ` ebotcazou at gcc dot gnu.org
2011-04-23  7:39 ` ubizjak at gmail dot com
2011-04-27 13:12 ` ebotcazou at gcc dot gnu.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).