public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/56165] New: Missed optimization for 'noreturn' functions
@ 2013-01-31 17:21 akobets at mail dot ru
  2013-01-31 17:27 ` [Bug target/56165] " akobets at mail dot ru
                   ` (17 more replies)
  0 siblings, 18 replies; 19+ messages in thread
From: akobets at mail dot ru @ 2013-01-31 17:21 UTC (permalink / raw)
  To: gcc-bugs


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

             Bug #: 56165
           Summary: Missed optimization for 'noreturn' functions
    Classification: Unclassified
           Product: gcc
           Version: 4.7.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: akobets@mail.ru
            Target: x86_64-linux-gnu


Created attachment 29318
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=29318
Example source code

1) Functions with __attribute__((noreturn)) contain unnecessary
push rbx
or
sub rsp,8
instructions in prologue.

2) Tail call need replace to jmp.

Source code (there is 4 highlighted lines with !!!):

===Intrpt64.cpp===
struct _BiosConsole
{
    virtual void  __attribute__((stdcall)) PrintHexDWord(long n);
};

void __attribute__((noreturn)) Intrpt_All(long* thr, long IntNum)
{
    _BiosConsole BiosCons;

    BiosCons.PrintHexDWord((long)thr);
    asm volatile("mov rsp, %0;"
        : : "r" (thr));
    for(;;){}
}

void __attribute__((noreturn)) Intrpt_0()
{
    register long* thr;
    asm volatile("mov %0,rsp" : "=g" (thr));
    Intrpt_All(thr, 0);
}
===END===

Compile:
x86_64-linux-gnu-gcc -c -Wall -Wno-attributes -save-temps -fverbose-asm
-masm=intel -march=core2 -mcmodel=large -mno-mmx -mno-sse -O1 -fno-rtti
-fno-default-inline -fomit-frame-pointer -falign-functions=16
-foptimize-sibling-calls -ffreestanding -fno-stack-protector --no-exceptions
Intrpt64.cpp

Generated Assembly code:

===Intrpt64.s===
    .text
    .p2align 4,,15
    .globl    _Z10Intrpt_AllPll
    .type    _Z10Intrpt_AllPll, @function
_Z10Intrpt_AllPll:
.LFB0:
    .cfi_startproc
    push    rbx    # TRASH !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    .cfi_def_cfa_offset 16
    .cfi_offset 3, -16
    sub    rsp, 16    #,
    .cfi_def_cfa_offset 32
    mov    rbx, rdi    # thr, thr
    movabs    rax, OFFSET FLAT:_ZTV12_BiosConsole+16    #,
    mov    QWORD PTR [rsp+8], rax    # BiosCons._vptr._BiosConsole,
    mov    rsi, rdi    #, thr
    lea    rdi, [rsp+8]    #,
    movabs    rax, OFFSET FLAT:_ZN12_BiosConsole13PrintHexDWordEl    # tmp64,
    call    rax    # JMP !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
#APP
# 14 "Intrpt64.cpp" 1
    mov rsp, rbx;    # thr
# 0 "" 2
#NO_APP
.L2:
    jmp    .L2    #
    .cfi_endproc
.LFE0:
    .size    _Z10Intrpt_AllPll, .-_Z10Intrpt_AllPll
    .p2align 4,,15
    .globl    _Z8Intrpt_0v
    .type    _Z8Intrpt_0v, @function
_Z8Intrpt_0v:
.LFB4:
    .cfi_startproc
    sub    rsp, 8    # TRASH !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    .cfi_def_cfa_offset 16
#APP
# 21 "Intrpt64.cpp" 1
    mov rdi,rsp    # thr
# 0 "" 2
#NO_APP
    mov    esi, 0    #,
    movabs    rax, OFFSET FLAT:_Z10Intrpt_AllPll    # tmp61,
    call    rax    # JMP !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    .cfi_endproc
.LFE4:
    .size    _Z8Intrpt_0v, .-_Z8Intrpt_0v
    .ident    "GCC: (GNU) 4.7.2"
    .section    .note.GNU-stack,"",@progbits
===END===


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

* [Bug target/56165] Missed optimization for 'noreturn' functions
  2013-01-31 17:21 [Bug target/56165] New: Missed optimization for 'noreturn' functions akobets at mail dot ru
@ 2013-01-31 17:27 ` akobets at mail dot ru
  2013-01-31 17:36 ` jakub at gcc dot gnu.org
                   ` (16 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: akobets at mail dot ru @ 2013-01-31 17:27 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #1 from Alexander Kobets <akobets at mail dot ru> 2013-01-31 17:26:51 UTC ---
Created attachment 29319
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=29319
Result code


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

* [Bug target/56165] Missed optimization for 'noreturn' functions
  2013-01-31 17:21 [Bug target/56165] New: Missed optimization for 'noreturn' functions akobets at mail dot ru
  2013-01-31 17:27 ` [Bug target/56165] " akobets at mail dot ru
@ 2013-01-31 17:36 ` jakub at gcc dot gnu.org
  2013-01-31 20:55 ` akobets at mail dot ru
                   ` (15 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: jakub at gcc dot gnu.org @ 2013-01-31 17:36 UTC (permalink / raw)
  To: gcc-bugs


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

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

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

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> 2013-01-31 17:35:34 UTC ---
This is intentional, often from within a noreturn function such as abort you
want to do a backtrace and get an accurrate backtrace.  Also, even noreturn
functions can throw, even if not caught immediately in the caller, so you can't
trash call saved registers.


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

* [Bug target/56165] Missed optimization for 'noreturn' functions
  2013-01-31 17:21 [Bug target/56165] New: Missed optimization for 'noreturn' functions akobets at mail dot ru
  2013-01-31 17:27 ` [Bug target/56165] " akobets at mail dot ru
  2013-01-31 17:36 ` jakub at gcc dot gnu.org
@ 2013-01-31 20:55 ` akobets at mail dot ru
  2013-01-31 21:48 ` pinskia at gcc dot gnu.org
                   ` (14 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: akobets at mail dot ru @ 2013-01-31 20:55 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #3 from Alexander Kobets <akobets at mail dot ru> 2013-01-31 20:55:23 UTC ---
(In reply to comment #2)
This is I use --no-exceptions and count other optimize parameters and
absolutely do not intent any debug services or exceptions. I control my code.


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

* [Bug target/56165] Missed optimization for 'noreturn' functions
  2013-01-31 17:21 [Bug target/56165] New: Missed optimization for 'noreturn' functions akobets at mail dot ru
                   ` (2 preceding siblings ...)
  2013-01-31 20:55 ` akobets at mail dot ru
@ 2013-01-31 21:48 ` pinskia at gcc dot gnu.org
  2013-01-31 22:13 ` akobets at mail dot ru
                   ` (13 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: pinskia at gcc dot gnu.org @ 2013-01-31 21:48 UTC (permalink / raw)
  To: gcc-bugs


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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |DUPLICATE

--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> 2013-01-31 21:46:42 UTC ---
Dup of bug 10837.

*** This bug has been marked as a duplicate of bug 10837 ***


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

* [Bug target/56165] Missed optimization for 'noreturn' functions
  2013-01-31 17:21 [Bug target/56165] New: Missed optimization for 'noreturn' functions akobets at mail dot ru
                   ` (3 preceding siblings ...)
  2013-01-31 21:48 ` pinskia at gcc dot gnu.org
@ 2013-01-31 22:13 ` akobets at mail dot ru
  2013-01-31 22:16 ` pinskia at gcc dot gnu.org
                   ` (12 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: akobets at mail dot ru @ 2013-01-31 22:13 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #5 from Alexander Kobets <akobets at mail dot ru> 2013-01-31 22:13:18 UTC ---
(In reply to comment #4)
Please do not mark bug as duplicate of another bug that was not resolveed. Give
any chance to anybody to fix it. Even if you wontfix, it is do not means that
others wontfix.


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

* [Bug target/56165] Missed optimization for 'noreturn' functions
  2013-01-31 17:21 [Bug target/56165] New: Missed optimization for 'noreturn' functions akobets at mail dot ru
                   ` (4 preceding siblings ...)
  2013-01-31 22:13 ` akobets at mail dot ru
@ 2013-01-31 22:16 ` pinskia at gcc dot gnu.org
  2013-01-31 22:31 ` akobets at mail dot ru
                   ` (11 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: pinskia at gcc dot gnu.org @ 2013-01-31 22:16 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #6 from Andrew Pinski <pinskia at gcc dot gnu.org> 2013-01-31 22:16:19 UTC ---
(In reply to comment #5)
> (In reply to comment #4)
> Please do not mark bug as duplicate of another bug that was not resolveed. Give
> any chance to anybody to fix it. Even if you wontfix, it is do not means that
> others wontfix.

Please read the reasons why it was marked as won't fix before commenting on why
it was resolved to be won't fix.  Won't fix does not mean this is a bug but we
won't fix it but rather this won't be fixed the way the user wants it to be
fixed.


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

* [Bug target/56165] Missed optimization for 'noreturn' functions
  2013-01-31 17:21 [Bug target/56165] New: Missed optimization for 'noreturn' functions akobets at mail dot ru
                   ` (5 preceding siblings ...)
  2013-01-31 22:16 ` pinskia at gcc dot gnu.org
@ 2013-01-31 22:31 ` akobets at mail dot ru
  2013-02-03  1:44 ` akobets at mail dot ru
                   ` (10 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: akobets at mail dot ru @ 2013-01-31 22:31 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #7 from Alexander Kobets <akobets at mail dot ru> 2013-01-31 22:30:38 UTC ---
(In reply to comment #6)
Do you have alternative solution or proposals to remove unwanted code?


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

* [Bug target/56165] Missed optimization for 'noreturn' functions
  2013-01-31 17:21 [Bug target/56165] New: Missed optimization for 'noreturn' functions akobets at mail dot ru
                   ` (6 preceding siblings ...)
  2013-01-31 22:31 ` akobets at mail dot ru
@ 2013-02-03  1:44 ` akobets at mail dot ru
  2013-02-03  2:19 ` pinskia at gcc dot gnu.org
                   ` (9 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: akobets at mail dot ru @ 2013-02-03  1:44 UTC (permalink / raw)
  To: gcc-bugs


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

Alexander Kobets <akobets at mail dot ru> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |UNCONFIRMED
         Resolution|DUPLICATE                   |

--- Comment #8 from Alexander Kobets <akobets at mail dot ru> 2013-02-03 01:44:33 UTC ---
1) I agree for "push rbx" seves reg. But "sub rsp,8" is completely trash,
because stack frame do not used at all, not for save reg, nor anything other.

2) (request feature) I want __attribute__((interrupt)), especial for
eliminating epilog/prolog.


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

* [Bug target/56165] Missed optimization for 'noreturn' functions
  2013-01-31 17:21 [Bug target/56165] New: Missed optimization for 'noreturn' functions akobets at mail dot ru
                   ` (7 preceding siblings ...)
  2013-02-03  1:44 ` akobets at mail dot ru
@ 2013-02-03  2:19 ` pinskia at gcc dot gnu.org
  2013-02-03  9:08 ` jakub at gcc dot gnu.org
                   ` (8 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: pinskia at gcc dot gnu.org @ 2013-02-03  2:19 UTC (permalink / raw)
  To: gcc-bugs


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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |DUPLICATE

--- Comment #9 from Andrew Pinski <pinskia at gcc dot gnu.org> 2013-02-03 02:18:59 UTC ---
(In reply to comment #8)
> 1) I agree for "push rbx" seves reg. But "sub rsp,8" is completely trash,
> because stack frame do not used at all, not for save reg, nor anything other.

Alignment of the stack register is needed to be kept 16byte aligned.

Still a dup of bug 10837.(In reply to comment #8)

> 2) (request feature) I want __attribute__((interrupt)), especial for
> eliminating epilog/prolog.

File a different bug report but really you should be writing first stage
handlers interrupt in assembler

*** This bug has been marked as a duplicate of bug 10837 ***


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

* [Bug target/56165] Missed optimization for 'noreturn' functions
  2013-01-31 17:21 [Bug target/56165] New: Missed optimization for 'noreturn' functions akobets at mail dot ru
                   ` (8 preceding siblings ...)
  2013-02-03  2:19 ` pinskia at gcc dot gnu.org
@ 2013-02-03  9:08 ` jakub at gcc dot gnu.org
  2013-02-03 12:39 ` akobets at mail dot ru
                   ` (7 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: jakub at gcc dot gnu.org @ 2013-02-03  9:08 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #10 from Jakub Jelinek <jakub at gcc dot gnu.org> 2013-02-03 09:07:57 UTC ---
(In reply to comment #9)
> 1) I agree for "push rbx" seves reg. But "sub rsp,8" is completely trash,
> because stack frame do not used at all, not for save reg, nor anything other.

You're wrong.  That is to maintain the ABI, which for x86_64 says that the
stack is 16-byte aligned.  Consider e.g. the noreturn function using SSE
instructions, without that subq $8, %rsp the stack in the noreturn function
would be not properly aligned to 16-bytes and any movdqa and similar insns on
stack slots would crash.


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

* [Bug target/56165] Missed optimization for 'noreturn' functions
  2013-01-31 17:21 [Bug target/56165] New: Missed optimization for 'noreturn' functions akobets at mail dot ru
                   ` (9 preceding siblings ...)
  2013-02-03  9:08 ` jakub at gcc dot gnu.org
@ 2013-02-03 12:39 ` akobets at mail dot ru
  2013-02-03 13:07 ` jakub at gcc dot gnu.org
                   ` (6 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: akobets at mail dot ru @ 2013-02-03 12:39 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #11 from Alexander Kobets <akobets at mail dot ru> 2013-02-03 12:39:00 UTC ---
(In reply to comment #10)
> You're wrong.  That is to maintain the ABI, which for x86_64 says that the
> stack is 16-byte aligned.  Consider e.g. the noreturn function using SSE
> instructions, without that subq $8, %rsp the stack in the noreturn function
> would be not properly aligned to 16-bytes and any movdqa and similar insns on
> stack slots would crash.

See carefully my compile keys (from first message):
x86_64-linux-gnu-gcc -c -Wall -Wno-attributes -save-temps -fverbose-asm
-masm=intel -march=core2 -mcmodel=large -mno-mmx -mno-sse -O1 -fno-rtti
-fno-default-inline -fomit-frame-pointer -falign-functions=16
-foptimize-sibling-calls -ffreestanding -fno-stack-protector --no-exceptions

There is:
-mno-mmx
-mno-sse
and in the long run
-fomit-frame-pointer

I do not need your charge with your injected code at all. Please understand me.


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

* [Bug target/56165] Missed optimization for 'noreturn' functions
  2013-01-31 17:21 [Bug target/56165] New: Missed optimization for 'noreturn' functions akobets at mail dot ru
                   ` (10 preceding siblings ...)
  2013-02-03 12:39 ` akobets at mail dot ru
@ 2013-02-03 13:07 ` jakub at gcc dot gnu.org
  2013-02-03 13:48 ` akobets at mail dot ru
                   ` (5 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: jakub at gcc dot gnu.org @ 2013-02-03 13:07 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #12 from Jakub Jelinek <jakub at gcc dot gnu.org> 2013-02-03 13:07:35 UTC ---
(In reply to comment #11)
> (In reply to comment #10)
> > You're wrong.  That is to maintain the ABI, which for x86_64 says that the
> > stack is 16-byte aligned.  Consider e.g. the noreturn function using SSE
> > instructions, without that subq $8, %rsp the stack in the noreturn function
> > would be not properly aligned to 16-bytes and any movdqa and similar insns on
> > stack slots would crash.
> 
> See carefully my compile keys (from first message):
> x86_64-linux-gnu-gcc -c -Wall -Wno-attributes -save-temps -fverbose-asm
> -masm=intel -march=core2 -mcmodel=large -mno-mmx -mno-sse -O1 -fno-rtti
> -fno-default-inline -fomit-frame-pointer -falign-functions=16
> -foptimize-sibling-calls -ffreestanding -fno-stack-protector --no-exceptions
> 
> There is:
> -mno-mmx
> -mno-sse
> and in the long run
> -fomit-frame-pointer
> 
> I do not need your charge with your injected code at all. Please understand me.

That is completely irrelevant.  The noreturn function is usually defined in
some other CU, so you don't know what compiler flags it will be compiled with,
and -mpreferred-stack-boundary=4 (i.e. 16 bytes alignment) is for x86_64 the
smallest supported alignment.  Even if you don't use SSE etc., the compiler is
allowed and does assume the 16-byte alignment of stack pointer in many places.
Note -mcmodel=large in your flags is much bigger slowdown than what you are
complaining about here.


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

* [Bug target/56165] Missed optimization for 'noreturn' functions
  2013-01-31 17:21 [Bug target/56165] New: Missed optimization for 'noreturn' functions akobets at mail dot ru
                   ` (11 preceding siblings ...)
  2013-02-03 13:07 ` jakub at gcc dot gnu.org
@ 2013-02-03 13:48 ` akobets at mail dot ru
  2013-02-03 14:57 ` jakub at gcc dot gnu.org
                   ` (4 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: akobets at mail dot ru @ 2013-02-03 13:48 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #13 from Alexander Kobets <akobets at mail dot ru> 2013-02-03 13:48:15 UTC ---
(In reply to comment #12)
> That is completely irrelevant.  The noreturn function is usually defined in
> some other CU, so you don't know what compiler flags it will be compiled with,
> and -mpreferred-stack-boundary=4 (i.e. 16 bytes alignment) is for x86_64 the
> smallest supported alignment.

Now I tested with -mpreferred-stack-boundary=4
it has no effect.
-mpreferred-stack-boundary=4 do not worked, it is fake.

> Even if you don't use SSE etc., the compiler is
> allowed and does assume the 16-byte alignment of stack pointer in many places.

I try to use some options for explain to compolers what I want.

> Note -mcmodel=large in your flags is much bigger slowdown than what you are
> complaining about here.

I will take it in account. But I need mainly the unchanged stack pointer at
function run.


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

* [Bug target/56165] Missed optimization for 'noreturn' functions
  2013-01-31 17:21 [Bug target/56165] New: Missed optimization for 'noreturn' functions akobets at mail dot ru
                   ` (12 preceding siblings ...)
  2013-02-03 13:48 ` akobets at mail dot ru
@ 2013-02-03 14:57 ` jakub at gcc dot gnu.org
  2013-02-03 21:56 ` akobets at mail dot ru
                   ` (3 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: jakub at gcc dot gnu.org @ 2013-02-03 14:57 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #14 from Jakub Jelinek <jakub at gcc dot gnu.org> 2013-02-03 14:57:19 UTC ---
Not fake, but the default and smallest value, i.e. for x86_64 ABI we don't
allow lowering the value to smaller than ABI required alignments.  Only for
32-bit i?86 code it is allowed to lower it from 16 down to 4 bytes (the
argument to -mpreferred-stack-boundary is N where (1 << N) is the alignment).


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

* [Bug target/56165] Missed optimization for 'noreturn' functions
  2013-01-31 17:21 [Bug target/56165] New: Missed optimization for 'noreturn' functions akobets at mail dot ru
                   ` (13 preceding siblings ...)
  2013-02-03 14:57 ` jakub at gcc dot gnu.org
@ 2013-02-03 21:56 ` akobets at mail dot ru
  2013-02-03 22:02 ` akobets at mail dot ru
                   ` (2 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: akobets at mail dot ru @ 2013-02-03 21:56 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #15 from Alexander Kobets <akobets at mail dot ru> 2013-02-03 21:56:41 UTC ---
(In reply to comment #14)
> Not fake, but the default and smallest value, i.e. for x86_64 ABI we don't
> allow lowering the value to smaller than ABI required alignments.  Only for
> 32-bit i?86 code it is allowed to lower it from 16 down to 4 bytes (the
> argument to -mpreferred-stack-boundary is N where (1 << N) is the alignment).

But no error is printed when I use -mpreferred-stack-boundary=4 on 64-bit CPU.
Only when defined 0, then printed:
error: -mpreferred-stack-boundary=0 is not between 4 and 12
while 4 is realy not worked.


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

* [Bug target/56165] Missed optimization for 'noreturn' functions
  2013-01-31 17:21 [Bug target/56165] New: Missed optimization for 'noreturn' functions akobets at mail dot ru
                   ` (14 preceding siblings ...)
  2013-02-03 21:56 ` akobets at mail dot ru
@ 2013-02-03 22:02 ` akobets at mail dot ru
  2013-02-05 13:01 ` jakub at gcc dot gnu.org
  2013-02-05 18:36 ` akobets at mail dot ru
  17 siblings, 0 replies; 19+ messages in thread
From: akobets at mail dot ru @ 2013-02-03 22:02 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #16 from Alexander Kobets <akobets at mail dot ru> 2013-02-03 22:02:06 UTC ---
(In reply to comment #15)
> But no error is printed when I use -mpreferred-stack-boundary=4 on 64-bit CPU.
> Only when defined 0, then printed:
> error: -mpreferred-stack-boundary=0 is not between 4 and 12
> while 4 is realy not worked.

Sorry, I cont this parameter in bytes, while it is power of 2. Now all clear to
me.


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

* [Bug target/56165] Missed optimization for 'noreturn' functions
  2013-01-31 17:21 [Bug target/56165] New: Missed optimization for 'noreturn' functions akobets at mail dot ru
                   ` (15 preceding siblings ...)
  2013-02-03 22:02 ` akobets at mail dot ru
@ 2013-02-05 13:01 ` jakub at gcc dot gnu.org
  2013-02-05 18:36 ` akobets at mail dot ru
  17 siblings, 0 replies; 19+ messages in thread
From: jakub at gcc dot gnu.org @ 2013-02-05 13:01 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #17 from Jakub Jelinek <jakub at gcc dot gnu.org> 2013-02-05 13:01:25 UTC ---
Ah, since PR53383 you can actually use -mno-sse -mpreferred-stack-boundary=3
on x86_64, but only with -mno-sse.  Of course it is an ABI incompatible change,
so you need to rebuild everything with that option.


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

* [Bug target/56165] Missed optimization for 'noreturn' functions
  2013-01-31 17:21 [Bug target/56165] New: Missed optimization for 'noreturn' functions akobets at mail dot ru
                   ` (16 preceding siblings ...)
  2013-02-05 13:01 ` jakub at gcc dot gnu.org
@ 2013-02-05 18:36 ` akobets at mail dot ru
  17 siblings, 0 replies; 19+ messages in thread
From: akobets at mail dot ru @ 2013-02-05 18:36 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #18 from Alexander Kobets <akobets at mail dot ru> 2013-02-05 18:36:18 UTC ---
(In reply to comment #17)

Well.


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

end of thread, other threads:[~2013-02-05 18:36 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-31 17:21 [Bug target/56165] New: Missed optimization for 'noreturn' functions akobets at mail dot ru
2013-01-31 17:27 ` [Bug target/56165] " akobets at mail dot ru
2013-01-31 17:36 ` jakub at gcc dot gnu.org
2013-01-31 20:55 ` akobets at mail dot ru
2013-01-31 21:48 ` pinskia at gcc dot gnu.org
2013-01-31 22:13 ` akobets at mail dot ru
2013-01-31 22:16 ` pinskia at gcc dot gnu.org
2013-01-31 22:31 ` akobets at mail dot ru
2013-02-03  1:44 ` akobets at mail dot ru
2013-02-03  2:19 ` pinskia at gcc dot gnu.org
2013-02-03  9:08 ` jakub at gcc dot gnu.org
2013-02-03 12:39 ` akobets at mail dot ru
2013-02-03 13:07 ` jakub at gcc dot gnu.org
2013-02-03 13:48 ` akobets at mail dot ru
2013-02-03 14:57 ` jakub at gcc dot gnu.org
2013-02-03 21:56 ` akobets at mail dot ru
2013-02-03 22:02 ` akobets at mail dot ru
2013-02-05 13:01 ` jakub at gcc dot gnu.org
2013-02-05 18:36 ` akobets at mail dot ru

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