public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug other/67552] New: [meta] x86 interrupt attribute
@ 2015-09-11 15:40 hjl.tools at gmail dot com
  2015-09-11 15:41 ` [Bug other/67552] " hjl.tools at gmail dot com
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: hjl.tools at gmail dot com @ 2015-09-11 15:40 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67552

            Bug ID: 67552
           Summary: [meta] x86 interrupt attribute
           Product: gcc
           Version: 6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: other
          Assignee: unassigned at gcc dot gnu.org
          Reporter: hjl.tools at gmail dot com
                CC: julia.koval at intel dot com
  Target Milestone: ---

This meta bug covers all interrupt attribute issues on jkoval/interrupt/master
branch in GCC git repo.


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

* [Bug other/67552] [meta] x86 interrupt attribute
  2015-09-11 15:40 [Bug other/67552] New: [meta] x86 interrupt attribute hjl.tools at gmail dot com
@ 2015-09-11 15:41 ` hjl.tools at gmail dot com
  2015-09-11 15:46 ` hjl.tools at gmail dot com
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: hjl.tools at gmail dot com @ 2015-09-11 15:41 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67552

--- Comment #1 from H.J. Lu <hjl.tools at gmail dot com> ---
Created attachment 36324
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=36324&action=edit
A patch to remove railing whitespaces in interrupt-switch-abi.c


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

* [Bug other/67552] [meta] x86 interrupt attribute
  2015-09-11 15:40 [Bug other/67552] New: [meta] x86 interrupt attribute hjl.tools at gmail dot com
  2015-09-11 15:41 ` [Bug other/67552] " hjl.tools at gmail dot com
@ 2015-09-11 15:46 ` hjl.tools at gmail dot com
  2015-09-11 17:43 ` hjl.tools at gmail dot com
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: hjl.tools at gmail dot com @ 2015-09-11 15:46 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67552

--- Comment #2 from H.J. Lu <hjl.tools at gmail dot com> ---
Red zone isn't supported in interrupt handler:

'interrupt'
     Use this attribute to indicate that the specified void function
     without arguments is an interrupt handler.  The compiler generates
     function entry and exit sequences suitable for use in an interrupt
     handler when this attribute is present.  The 'IRET' instruction,
     instead of the 'RET' instruction, is used to return from interrupt
     handlers.  All registers, except for the EFLAGS register which is
     restored by the 'IRET' instruction, are preserved by the compiler.
     The red zone isn't supported in an interrupt handler; that is an
     interrupt handler can't access stack beyond the current stack
     pointer.

It is wrong to do

-  if (crtl->args.pops_args && crtl->args.size)
+  if (ix86_is_interrupt_p ())
+    {
+      if (ix86_using_red_zone ())
+          emit_insn (gen_adddi3 (
+                   gen_rtx_REG (DImode, SP_REG),
+                   gen_rtx_REG (DImode, SP_REG),
+                   GEN_INT (128)));

GCC should assume that red zone isn't used in interrupt handler.


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

* [Bug other/67552] [meta] x86 interrupt attribute
  2015-09-11 15:40 [Bug other/67552] New: [meta] x86 interrupt attribute hjl.tools at gmail dot com
  2015-09-11 15:41 ` [Bug other/67552] " hjl.tools at gmail dot com
  2015-09-11 15:46 ` hjl.tools at gmail dot com
@ 2015-09-11 17:43 ` hjl.tools at gmail dot com
  2015-09-11 17:44 ` hjl.tools at gmail dot com
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: hjl.tools at gmail dot com @ 2015-09-11 17:43 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67552

--- Comment #3 from H.J. Lu <hjl.tools at gmail dot com> ---
X87 instructions should be disallowed in interrupt handler:

[hjl@gnu-6 interrupt-1]$ cat f.i
extern long double y, x;

void
__attribute__((interrupt))
fn1 (void)
{
  x += y;
}
[hjl@gnu-6 interrupt-1]$ make f.s
/export/build/gnu/gcc-5/build-x86_64-linux/gcc/xgcc
-B/export/build/gnu/gcc-5/build-x86_64-linux/gcc/ -O2 -S -o f.s f.i
[hjl@gnu-6 interrupt-1]$ cat f.s
        .file   "f.i"
        .section        .text.unlikely,"ax",@progbits
.LCOLDB1:
        .text
.LHOTB1:
        .p2align 4,,15
        .globl  fn1
        .type   fn1, @function
fn1:
.LFB0:
        .cfi_startproc
        fldt    y(%rip)
        addq    $-128, %rsp
        fldt    x(%rip)
        faddp   %st, %st(1)
        fstpt   x(%rip)
        ret
        .cfi_endproc
.LFE0:
        .size   fn1, .-fn1
        .section        .text.unlikely
.LCOLDE1:
        .text
.LHOTE1:
        .ident  "GCC: (GNU) 5.2.1 20150911"
        .section        .note.GNU-stack,"",@progbits
[hjl@gnu-6 interrupt-1]$


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

* [Bug other/67552] [meta] x86 interrupt attribute
  2015-09-11 15:40 [Bug other/67552] New: [meta] x86 interrupt attribute hjl.tools at gmail dot com
                   ` (2 preceding siblings ...)
  2015-09-11 17:43 ` hjl.tools at gmail dot com
@ 2015-09-11 17:44 ` hjl.tools at gmail dot com
  2015-09-14  9:26 ` julia.koval at intel dot com
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: hjl.tools at gmail dot com @ 2015-09-11 17:44 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67552

--- Comment #4 from H.J. Lu <hjl.tools at gmail dot com> ---
MMX instructions should be disallowed in interrupt handler:

[hjl@gnu-6 interrupt-1]$ cat m.i 
typedef short __v4hi __attribute__ ((__vector_size__ (8)));
typedef int __m64 __attribute__ ((__vector_size__ (8), __may_alias__));

extern __m64 y, x;

void
__attribute__((interrupt))
fn1 (void)
{
  x = (__m64) __builtin_ia32_packsswb ((__v4hi) x, (__v4hi) y);
}
[hjl@gnu-6 interrupt-1]$ make m.s
/export/build/gnu/gcc-5/build-x86_64-linux/gcc/xgcc
-B/export/build/gnu/gcc-5/build-x86_64-linux/gcc/ -O2 -S -o m.s m.i
[hjl@gnu-6 interrupt-1]$ cat m.s
        .file   "m.i"
        .section        .text.unlikely,"ax",@progbits
.LCOLDB0:
        .text
.LHOTB0:
        .p2align 4,,15
        .globl  fn1
        .type   fn1, @function
fn1:
.LFB0:
        .cfi_startproc
        movq    x(%rip), %mm0
        addq    $-128, %rsp
        packsswb        y(%rip), %mm0
        movq    %mm0, x(%rip)
        ret
        .cfi_endproc
.LFE0:
        .size   fn1, .-fn1
        .section        .text.unlikely
.LCOLDE0:
        .text
.LHOTE0:
        .ident  "GCC: (GNU) 5.2.1 20150911"
        .section        .note.GNU-stack,"",@progbits
[hjl@gnu-6 interrupt-1]$


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

* [Bug other/67552] [meta] x86 interrupt attribute
  2015-09-11 15:40 [Bug other/67552] New: [meta] x86 interrupt attribute hjl.tools at gmail dot com
                   ` (3 preceding siblings ...)
  2015-09-11 17:44 ` hjl.tools at gmail dot com
@ 2015-09-14  9:26 ` julia.koval at intel dot com
  2015-09-14 11:25 ` hjl.tools at gmail dot com
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: julia.koval at intel dot com @ 2015-09-14  9:26 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67552

--- Comment #5 from Yulia Koval <julia.koval at intel dot com> ---
Sorry, I don't understand why we shouldn't preserve the red zone. The function
"foo", executing before the interrupt was called, used its red zone. If the
interrupt does not adjust the stack pointer, who control that "foo" function's
red zone would not be overwritten?


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

* [Bug other/67552] [meta] x86 interrupt attribute
  2015-09-11 15:40 [Bug other/67552] New: [meta] x86 interrupt attribute hjl.tools at gmail dot com
                   ` (4 preceding siblings ...)
  2015-09-14  9:26 ` julia.koval at intel dot com
@ 2015-09-14 11:25 ` hjl.tools at gmail dot com
  2015-09-19 22:35 ` hjl.tools at gmail dot com
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: hjl.tools at gmail dot com @ 2015-09-14 11:25 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67552

H.J. Lu <hjl.tools at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2015-09-14
     Ever confirmed|0                           |1

--- Comment #6 from H.J. Lu <hjl.tools at gmail dot com> ---
(In reply to Yulia Koval from comment #5)
> Sorry, I don't understand why we shouldn't preserve the red zone. The
> function "foo", executing before the interrupt was called, used its red
> zone. If the interrupt does not adjust the stack pointer, who control that
> "foo" function's red zone would not be overwritten?

Please take a look at Exception- or Interrupt-Handler Procedures in
Intel64 and IA-32 Architectures Software Developer’s Manual vol 3.
There is no red zone on stack of interrupt handler, which is controlled
by processor, independent of any calling conventions.
>From gcc-bugs-return-497167-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon Sep 14 11:29:10 2015
Return-Path: <gcc-bugs-return-497167-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 50583 invoked by alias); 14 Sep 2015 11:29:10 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 50539 invoked by uid 48); 14 Sep 2015 11:29:06 -0000
From: "rguenth at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug lto/67548] [5/6 Regression] LTO drops weak binding with "ld -r"
Date: Mon, 14 Sep 2015 11:29:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: lto
X-Bugzilla-Version: 6.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: rguenth at gcc dot gnu.org
X-Bugzilla-Status: NEW
X-Bugzilla-Resolution:
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: 5.3
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-67548-4-tuC4qviT2i@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-67548-4@http.gcc.gnu.org/bugzilla/>
References: <bug-67548-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2015-09/txt/msg01145.txt.bz2
Content-length: 380

https://gcc.gnu.org/bugzilla/show_bug.cgi?idg548

--- Comment #7 from Richard Biener <rguenth at gcc dot gnu.org> ---
I thought we do nothing in an incremental link but concat the LTO input
sections?
That's why we put that $ID suffix on the section names.  So maybe with plugin
auto-loading (and thus slim objects?) the LTO plugin shouldn't claim any files
with LDPO_REL mode.


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

* [Bug other/67552] [meta] x86 interrupt attribute
  2015-09-11 15:40 [Bug other/67552] New: [meta] x86 interrupt attribute hjl.tools at gmail dot com
                   ` (6 preceding siblings ...)
  2015-09-19 22:35 ` hjl.tools at gmail dot com
@ 2015-09-19 22:35 ` hjl.tools at gmail dot com
  2015-09-29 13:39 ` hjl.tools at gmail dot com
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: hjl.tools at gmail dot com @ 2015-09-19 22:35 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67552
Bug 67552 depends on bug 67634, which changed state.

Bug 67634 Summary: Can't preserve bound register in interrupt handler
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67634

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


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

* [Bug other/67552] [meta] x86 interrupt attribute
  2015-09-11 15:40 [Bug other/67552] New: [meta] x86 interrupt attribute hjl.tools at gmail dot com
                   ` (5 preceding siblings ...)
  2015-09-14 11:25 ` hjl.tools at gmail dot com
@ 2015-09-19 22:35 ` hjl.tools at gmail dot com
  2015-09-19 22:35 ` hjl.tools at gmail dot com
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: hjl.tools at gmail dot com @ 2015-09-19 22:35 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67552
Bug 67552 depends on bug 67630, which changed state.

Bug 67630 Summary: ymm and zmm register aren't preserved in interrupt handler
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67630

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


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

* [Bug other/67552] [meta] x86 interrupt attribute
  2015-09-11 15:40 [Bug other/67552] New: [meta] x86 interrupt attribute hjl.tools at gmail dot com
                   ` (7 preceding siblings ...)
  2015-09-19 22:35 ` hjl.tools at gmail dot com
@ 2015-09-29 13:39 ` hjl.tools at gmail dot com
  2015-10-05 17:30 ` hjl.tools at gmail dot com
  2015-10-12 12:48 ` hjl.tools at gmail dot com
  10 siblings, 0 replies; 12+ messages in thread
From: hjl.tools at gmail dot com @ 2015-09-29 13:39 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67552
Bug 67552 depends on bug 67698, which changed state.

Bug 67698 Summary: internal compiler error: in maybe_record_trace_start, at dwarf2cfi.c:2297
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67698

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


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

* [Bug other/67552] [meta] x86 interrupt attribute
  2015-09-11 15:40 [Bug other/67552] New: [meta] x86 interrupt attribute hjl.tools at gmail dot com
                   ` (8 preceding siblings ...)
  2015-09-29 13:39 ` hjl.tools at gmail dot com
@ 2015-10-05 17:30 ` hjl.tools at gmail dot com
  2015-10-12 12:48 ` hjl.tools at gmail dot com
  10 siblings, 0 replies; 12+ messages in thread
From: hjl.tools at gmail dot com @ 2015-10-05 17:30 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67552
Bug 67552 depends on bug 67855, which changed state.

Bug 67855 Summary: -g doesn't with x86 interrupt handler
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67855

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


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

* [Bug other/67552] [meta] x86 interrupt attribute
  2015-09-11 15:40 [Bug other/67552] New: [meta] x86 interrupt attribute hjl.tools at gmail dot com
                   ` (9 preceding siblings ...)
  2015-10-05 17:30 ` hjl.tools at gmail dot com
@ 2015-10-12 12:48 ` hjl.tools at gmail dot com
  10 siblings, 0 replies; 12+ messages in thread
From: hjl.tools at gmail dot com @ 2015-10-12 12:48 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67552
Bug 67552 depends on bug 67850, which changed state.

Bug 67850 Summary: Wrong call_used_regs used in aggregate_value_p
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67850

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


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

end of thread, other threads:[~2015-10-12 12:48 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-11 15:40 [Bug other/67552] New: [meta] x86 interrupt attribute hjl.tools at gmail dot com
2015-09-11 15:41 ` [Bug other/67552] " hjl.tools at gmail dot com
2015-09-11 15:46 ` hjl.tools at gmail dot com
2015-09-11 17:43 ` hjl.tools at gmail dot com
2015-09-11 17:44 ` hjl.tools at gmail dot com
2015-09-14  9:26 ` julia.koval at intel dot com
2015-09-14 11:25 ` hjl.tools at gmail dot com
2015-09-19 22:35 ` hjl.tools at gmail dot com
2015-09-19 22:35 ` hjl.tools at gmail dot com
2015-09-29 13:39 ` hjl.tools at gmail dot com
2015-10-05 17:30 ` hjl.tools at gmail dot com
2015-10-12 12:48 ` hjl.tools at gmail dot com

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