public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug rtl-optimization/48331] New: [4.7 Regression] gcc.c-torture/execute/built-in-setjmp.c FAILs with -O -fira-algorithm=priority -fPIC
@ 2011-03-29 12:10 zsojka at seznam dot cz
  2011-03-29 12:54 ` [Bug rtl-optimization/48331] " zsojka at seznam dot cz
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: zsojka at seznam dot cz @ 2011-03-29 12:10 UTC (permalink / raw)
  To: gcc-bugs

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

           Summary: [4.7 Regression]
                    gcc.c-torture/execute/built-in-setjmp.c FAILs with -O
                    -fira-algorithm=priority -fPIC
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: rtl-optimization
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: zsojka@seznam.cz


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

Output:
$ gcc -O -fira-algorithm=priority -fPIC testcase.c
$ valgrind -q ./a.out  
==1889== Use of uninitialised value of size 8
==1889==    at 0x400599: sub2 (testcase.c:6)
==1889==    by 0x4E4EB6C: (below main) (in /lib64/libc-2.11.3.so)
==1889== 
==1889== Jump to the invalid address stated on the next line
==1889==    at 0x0: ???
==1889==    by 0x4E4EB6C: (below main) (in /lib64/libc-2.11.3.so)
==1889==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==1889== 
==1889== 
==1889== Process terminating with default action of signal 11 (SIGSEGV)
==1889==  Bad permissions for mapped region at address 0x0
==1889==    at 0x0: ???
==1889==    by 0x4E4EB6C: (below main) (in /lib64/libc-2.11.3.so)
Segmentation fault


Tested revisions:
r171653 - fail
r171626 - OK


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

* [Bug rtl-optimization/48331] [4.7 Regression] gcc.c-torture/execute/built-in-setjmp.c FAILs with -O -fira-algorithm=priority -fPIC
  2011-03-29 12:10 [Bug rtl-optimization/48331] New: [4.7 Regression] gcc.c-torture/execute/built-in-setjmp.c FAILs with -O -fira-algorithm=priority -fPIC zsojka at seznam dot cz
@ 2011-03-29 12:54 ` zsojka at seznam dot cz
  2011-03-29 14:37 ` zsojka at seznam dot cz
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: zsojka at seznam dot cz @ 2011-03-29 12:54 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Zdenek Sojka <zsojka at seznam dot cz> 2011-03-29 12:10:38 UTC ---
The "while (1)" part of the testcase is not actually needed.

The problem seems to be there (at the assembly level):
...
    mov    rax, QWORD PTR buf@GOTPCREL[rip]    #,
    mov    rax, QWORD PTR 8[rax]    #,
    mov    QWORD PTR -8[rbp], rax    # %sfp, # stores value
    mov    rax, QWORD PTR buf@GOTPCREL[rip]    #,
    mov    rbp, QWORD PTR [rax]    #, # rbp changes
    mov    rsp, QWORD PTR 16[rax]    #,
    jmp    [QWORD PTR -8[rbp]]    # %sfp # uses new value or rbp
...

Maybe this was just uncovered by recent changes - comparing asm output from
r171626 and r171653 shows the priority allocator now gives much worse results.

In r171626, the generated code is the same as with CB's allocator, but in
r171653 there is much higher stack usage, causing this problem to show up.


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

* [Bug rtl-optimization/48331] [4.7 Regression] gcc.c-torture/execute/built-in-setjmp.c FAILs with -O -fira-algorithm=priority -fPIC
  2011-03-29 12:10 [Bug rtl-optimization/48331] New: [4.7 Regression] gcc.c-torture/execute/built-in-setjmp.c FAILs with -O -fira-algorithm=priority -fPIC zsojka at seznam dot cz
  2011-03-29 12:54 ` [Bug rtl-optimization/48331] " zsojka at seznam dot cz
@ 2011-03-29 14:37 ` zsojka at seznam dot cz
  2011-03-29 15:24 ` vmakarov at redhat dot com
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: zsojka at seznam dot cz @ 2011-03-29 14:37 UTC (permalink / raw)
  To: gcc-bugs

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

Zdenek Sojka <zsojka at seznam dot cz> changed:

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

--- Comment #2 from Zdenek Sojka <zsojka at seznam dot cz> 2011-03-29 14:35:34 UTC ---
It started with http://gcc.gnu.org/viewcvs?view=revision&revision=171649

I don't know what's the status of this allocator (how near is its end), nor if
there are any targets that have to use it as CB's allocator doesn't work for
them.


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

* [Bug rtl-optimization/48331] [4.7 Regression] gcc.c-torture/execute/built-in-setjmp.c FAILs with -O -fira-algorithm=priority -fPIC
  2011-03-29 12:10 [Bug rtl-optimization/48331] New: [4.7 Regression] gcc.c-torture/execute/built-in-setjmp.c FAILs with -O -fira-algorithm=priority -fPIC zsojka at seznam dot cz
  2011-03-29 12:54 ` [Bug rtl-optimization/48331] " zsojka at seznam dot cz
  2011-03-29 14:37 ` zsojka at seznam dot cz
@ 2011-03-29 15:24 ` vmakarov at redhat dot com
  2011-03-29 21:43 ` vmakarov at gcc dot gnu.org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: vmakarov at redhat dot com @ 2011-03-29 15:24 UTC (permalink / raw)
  To: gcc-bugs

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

Vladimir Makarov <vmakarov at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |vmakarov at redhat dot com

--- Comment #3 from Vladimir Makarov <vmakarov at redhat dot com> 2011-03-29 15:07:46 UTC ---
(In reply to comment #2)
> It started with http://gcc.gnu.org/viewcvs?view=revision&revision=171649
> 
> I don't know what's the status of this allocator (how near is its end), nor if
> there are any targets that have to use it as CB's allocator doesn't work for
> them.

Thanks for reporting.  The patch is to permit to use CB allocator for ports
which had to use the priority allocator.  The performance result of the
modified CB allocator is expected to be better than the usage of priority one
for the ports.

In perspective, priority coloring will be removed.  I'd recommend maintainers
of the ports using priority coloring to check CB coloring and plan to switch to
it by default.

The changes in IRA are big and complex and probably will result some port
problems for some time because RA is the most machine-dependent part of the
compiler.  Therefore the patch was committed to the trunk on the beginning of
stage1 to have more time to fix all the problems.

Meanwhile, I am going to work and try to fix this PR.


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

* [Bug rtl-optimization/48331] [4.7 Regression] gcc.c-torture/execute/built-in-setjmp.c FAILs with -O -fira-algorithm=priority -fPIC
  2011-03-29 12:10 [Bug rtl-optimization/48331] New: [4.7 Regression] gcc.c-torture/execute/built-in-setjmp.c FAILs with -O -fira-algorithm=priority -fPIC zsojka at seznam dot cz
                   ` (2 preceding siblings ...)
  2011-03-29 15:24 ` vmakarov at redhat dot com
@ 2011-03-29 21:43 ` vmakarov at gcc dot gnu.org
  2011-03-30  1:49 ` hp at gcc dot gnu.org
  2011-03-30  8:41 ` rguenth at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: vmakarov at gcc dot gnu.org @ 2011-03-29 21:43 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Vladimir Makarov <vmakarov at gcc dot gnu.org> 2011-03-29 20:51:18 UTC ---
Author: vmakarov
Date: Tue Mar 29 20:51:14 2011
New Revision: 171699

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=171699
Log:
2011-03-29  Vladimir Makarov  <vmakarov@redhat.com>

    PR rtl-optimization/48331
    PR rtl-optimization/48334
    * ira-color.c (color_allocnos): Call setup_profitable_hard_regs
    for any used algorithm.


Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/ira-color.c


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

* [Bug rtl-optimization/48331] [4.7 Regression] gcc.c-torture/execute/built-in-setjmp.c FAILs with -O -fira-algorithm=priority -fPIC
  2011-03-29 12:10 [Bug rtl-optimization/48331] New: [4.7 Regression] gcc.c-torture/execute/built-in-setjmp.c FAILs with -O -fira-algorithm=priority -fPIC zsojka at seznam dot cz
                   ` (3 preceding siblings ...)
  2011-03-29 21:43 ` vmakarov at gcc dot gnu.org
@ 2011-03-30  1:49 ` hp at gcc dot gnu.org
  2011-03-30  8:41 ` rguenth at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: hp at gcc dot gnu.org @ 2011-03-30  1:49 UTC (permalink / raw)
  To: gcc-bugs

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

Hans-Peter Nilsson <hp at gcc dot gnu.org> changed:

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

--- Comment #5 from Hans-Peter Nilsson <hp at gcc dot gnu.org> 2011-03-30 01:37:08 UTC ---
Should this be closed now?


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

* [Bug rtl-optimization/48331] [4.7 Regression] gcc.c-torture/execute/built-in-setjmp.c FAILs with -O -fira-algorithm=priority -fPIC
  2011-03-29 12:10 [Bug rtl-optimization/48331] New: [4.7 Regression] gcc.c-torture/execute/built-in-setjmp.c FAILs with -O -fira-algorithm=priority -fPIC zsojka at seznam dot cz
                   ` (4 preceding siblings ...)
  2011-03-30  1:49 ` hp at gcc dot gnu.org
@ 2011-03-30  8:41 ` rguenth at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-03-30  8:41 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|---                         |4.7.0

--- Comment #6 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-03-30 08:38:09 UTC ---
Assuming fixed.


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

end of thread, other threads:[~2011-03-30  8:38 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-03-29 12:10 [Bug rtl-optimization/48331] New: [4.7 Regression] gcc.c-torture/execute/built-in-setjmp.c FAILs with -O -fira-algorithm=priority -fPIC zsojka at seznam dot cz
2011-03-29 12:54 ` [Bug rtl-optimization/48331] " zsojka at seznam dot cz
2011-03-29 14:37 ` zsojka at seznam dot cz
2011-03-29 15:24 ` vmakarov at redhat dot com
2011-03-29 21:43 ` vmakarov at gcc dot gnu.org
2011-03-30  1:49 ` hp at gcc dot gnu.org
2011-03-30  8:41 ` rguenth 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).