public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug other/67630] New: ymm and zmm register aren't preserved in interrupt handler
@ 2015-09-18 17:03 hjl.tools at gmail dot com
  2015-09-18 17:29 ` [Bug other/67630] " hjl.tools at gmail dot com
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: hjl.tools at gmail dot com @ 2015-09-18 17:03 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 67630
           Summary: ymm and zmm register aren't preserved in interrupt
                    handler
           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: ---

[hjl@gnu-6 interrupt-5]$ make clean
rm -f *.o *.so *.s *.i.* *.x.*
[hjl@gnu-6 interrupt-5]$ cat ymm.i
void
__attribute__((interrupt))
fn1 (void)
{
  asm ("#"
       :
       : 
       : "ymm0");
}
[hjl@gnu-6 interrupt-5]$ make ymm.s
/export/build/gnu/gcc/build-x86_64-linux/gcc/xgcc
-B/export/build/gnu/gcc/build-x86_64-linux/gcc/ -O2 -mavx -S -o ymm.s ymm.i
[hjl@gnu-6 interrupt-5]$ cat ymm.s
        .file   "ymm.i"
        .section        .text.unlikely,"ax",@progbits
.LCOLDB0:
        .text
.LHOTB0:
        .p2align 4,,15
        .globl  fn1
        .type   fn1, @function
fn1:
.LFB0:
        .cfi_startproc
        subq    $24, %rsp
        .cfi_def_cfa_offset 32
        vmovaps %xmm0, (%rsp)
        .cfi_offset 17, -32
#APP
# 5 "ymm.i" 1
        #
# 0 "" 2
#NO_APP
        vzeroupper
        vmovaps (%rsp), %xmm0
        addq    $24, %rsp
        .cfi_def_cfa_offset 8
        iret
        .cfi_endproc
.LFE0:
        .size   fn1, .-fn1
        .section        .text.unlikely
.LCOLDE0:
        .text
.LHOTE0:
        .ident  "GCC: (GNU) 6.0.0 20150917 (experimental)"
        .section        .note.GNU-stack,"",@progbits
[hjl@gnu-6 interrupt-5]$


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

* [Bug other/67630] ymm and zmm register aren't preserved in interrupt handler
  2015-09-18 17:03 [Bug other/67630] New: ymm and zmm register aren't preserved in interrupt handler hjl.tools at gmail dot com
@ 2015-09-18 17:29 ` hjl.tools at gmail dot com
  2015-09-18 22:52 ` hjl.tools at gmail dot com
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: hjl.tools at gmail dot com @ 2015-09-18 17:29 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #1 from H.J. Lu <hjl.tools at gmail dot com> ---
ix86_compute_frame_layout has

  /* Align and set SSE register save area.  */
  if (frame->nsseregs)
    {
      /* The only ABI that has saved SSE registers (Win64) also has a
         16-byte aligned default stack, and thus we don't need to be
         within the re-aligned local stack frame to save them.  */
      gcc_assert (INCOMING_STACK_BOUNDARY >= 128); 
      offset = (offset + 16 - 1) & -16;
      offset += frame->nsseregs * 16; 
    }

It isn't true for interrupt handler.


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

* [Bug other/67630] ymm and zmm register aren't preserved in interrupt handler
  2015-09-18 17:03 [Bug other/67630] New: ymm and zmm register aren't preserved in interrupt handler hjl.tools at gmail dot com
  2015-09-18 17:29 ` [Bug other/67630] " hjl.tools at gmail dot com
@ 2015-09-18 22:52 ` hjl.tools at gmail dot com
  2015-09-19 22:35 ` hjl.tools at gmail dot com
  2015-09-20 10:36 ` ubizjak at gmail dot com
  3 siblings, 0 replies; 5+ messages in thread
From: hjl.tools at gmail dot com @ 2015-09-18 22:52 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from H.J. Lu <hjl.tools at gmail dot com> ---
Created attachment 36349
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=36349&action=edit
A patch


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

* [Bug other/67630] ymm and zmm register aren't preserved in interrupt handler
  2015-09-18 17:03 [Bug other/67630] New: ymm and zmm register aren't preserved in interrupt handler hjl.tools at gmail dot com
  2015-09-18 17:29 ` [Bug other/67630] " hjl.tools at gmail dot com
  2015-09-18 22:52 ` hjl.tools at gmail dot com
@ 2015-09-19 22:35 ` hjl.tools at gmail dot com
  2015-09-20 10:36 ` ubizjak at gmail dot com
  3 siblings, 0 replies; 5+ 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=67630

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED
   Target Milestone|---                         |6.0

--- Comment #3 from H.J. Lu <hjl.tools at gmail dot com> ---
Fixed on hjl/interrupt/master branch.


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

* [Bug other/67630] ymm and zmm register aren't preserved in interrupt handler
  2015-09-18 17:03 [Bug other/67630] New: ymm and zmm register aren't preserved in interrupt handler hjl.tools at gmail dot com
                   ` (2 preceding siblings ...)
  2015-09-19 22:35 ` hjl.tools at gmail dot com
@ 2015-09-20 10:36 ` ubizjak at gmail dot com
  3 siblings, 0 replies; 5+ messages in thread
From: ubizjak at gmail dot com @ 2015-09-20 10:36 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Uroš Bizjak <ubizjak at gmail dot com> ---
(In reply to H.J. Lu from comment #2)
> Created attachment 36349 [details]
> A patch

@@ -867,10 +867,12 @@
        case MODE_V16SF:
        case MODE_V8SF:
        case MODE_V4SF:
-         if (TARGET_AVX
-             && (misaligned_operand (operands[0], <MODE>mode)
-                 || misaligned_operand (operands[1], <MODE>mode)))
-           return "vmovups\t{%1, %0|%0, %1}";
+         /* We must handle SSE since ix86_emit_save_reg_using_mov
+            generates the normal *mov<mode>_internal pattern for
+            interrupt handler.  */
+         if (misaligned_operand (operands[0], <MODE>mode)
+             || misaligned_operand (operands[1], <MODE>mode))
+           return "%vmovups\t{%1, %0|%0, %1}";
          else
            return "%vmovaps\t{%1, %0|%0, %1}";

You should use

          if ((TARGET_AVX || cfun->machine->is_interrupt)
              && (misaligned_operand (operands[0], <MODE>mode)
                  || misaligned_operand (operands[1], <MODE>mode)))
            return "%vmovups\t{%1, %0|%0, %1}";

Your patch gives legacy SSE targets ability to load/store unaligned operands
outside interrupt handler for no reason. Legacy SSE is different to AVX, the
latter also allows unaligned 16byte operands in arithmetic/logic VEX-prefixed
insns. This is the reason we have to relax alignment requirements on V4SFmode
load/stores for AVX targets.
>From gcc-bugs-return-497604-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sun Sep 20 13:04:38 2015
Return-Path: <gcc-bugs-return-497604-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 27738 invoked by alias); 20 Sep 2015 13:04:38 -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 22986 invoked by uid 48); 20 Sep 2015 13:04:34 -0000
From: "dimhen at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug bootstrap/67647] New: [6 regression] boostrap FAIL with --disable-libstdcxx-dual-abi
Date: Sun, 20 Sep 2015 13:04:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: new
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: bootstrap
X-Bugzilla-Version: 6.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: dimhen at gmail dot com
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Resolution:
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone
Message-ID: <bug-67647-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2015-09/txt/msg01582.txt.bz2
Content-length: 3160

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

            Bug ID: 67647
           Summary: [6 regression] boostrap FAIL with
                    --disable-libstdcxx-dual-abi
           Product: gcc
           Version: 6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: bootstrap
          Assignee: unassigned at gcc dot gnu.org
          Reporter: dimhen at gmail dot com
  Target Milestone: ---

r227942 FAIL
r227792 PASS

~/src/gcc_current/configure --prefix=/usr/local/gcc_current
--enable-languages=c,c++,lto --enable-plugin --disable-multilib
make PASS

~/src/gcc_current/configure --prefix=/usr/local/gcc_current
--enable-languages=c,c++,lto --enable-plugin --disable-multilib
--disable-libstdcxx-dual-abi
make FAIL

/home/dimhen/build/gcc_current/./prev-gcc/xg++
-B/home/dimhen/build/gcc_current/./prev-gcc/
-B/usr/local/gcc_current/x86_64-pc-linux-gnu/bin/ -nostdinc++
-B/home/dimhen/build/gcc_current/prev-x86_64-pc-linux-gnu/libstdc++-v3/src/.libs
-B/home/dimhen/build/gcc_current/prev-x86_64-pc-linux-gnu/libstdc++-v3/libsupc++/.libs

-I/home/dimhen/build/gcc_current/prev-x86_64-pc-linux-gnu/libstdc++-v3/include/x86_64-pc-linux-gnu
 -I/home/dimhen/build/gcc_current/prev-x86_64-pc-linux-gnu/libstdc++-v3/include
 -I/home/dimhen/src/gcc_current/libstdc++-v3/libsupc++
-L/home/dimhen/build/gcc_current/prev-x86_64-pc-linux-gnu/libstdc++-v3/src/.libs
-L/home/dimhen/build/gcc_current/prev-x86_64-pc-linux-gnu/libstdc++-v3/libsupc++/.libs
-c   -g -O2 -gtoggle -DIN_GCC     -fno-exceptions -fno-rtti
-fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings
-Wcast-qual -Wmissing-format-attribute -Woverloaded-virtual -pedantic
-Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -Werror -fno-common
 -DHAVE_CONFIG_H -DGENERATOR_FILE -fno-PIE -I. -Ibuild
-I/home/dimhen/src/gcc_current/gcc -I/home/dimhen/src/gcc_current/gcc/build
-I/home/dimhen/src/gcc_current/gcc/../include 
-I/home/dimhen/src/gcc_current/gcc/../libcpp/include  \
        -o build/inchash.o /home/dimhen/src/gcc_current/gcc/inchash.c
In file included from
/home/dimhen/build/gcc_current/prev-x86_64-pc-linux-gnu/libstdc++-v3/include/string:52:0,
                 from /home/dimhen/src/gcc_current/gcc/system.h:201,
                 from /home/dimhen/src/gcc_current/gcc/genconstants.c:28:
/home/dimhen/build/gcc_current/prev-x86_64-pc-linux-gnu/libstdc++-v3/include/bits/basic_string.h:3304:7:
error: expected initializer before ‘capacity’
       capacity() const _GLIBCXX_NOEXCEPT
       ^
/home/dimhen/build/gcc_current/prev-x86_64-pc-linux-gnu/libstdc++-v3/include/bits/basic_string.h:3325:15:
error: variable or field ‘reserve’ declared void
       reserve(size_type __res_arg = 0);
               ^
/home/dimhen/build/gcc_current/prev-x86_64-pc-linux-gnu/libstdc++-v3/include/bits/basic_string.h:3325:15:
error: ‘size_type’ was not declared in this scope
/home/dimhen/build/gcc_current/prev-x86_64-pc-linux-gnu/libstdc++-v3/include/bits/basic_string.h:
In function ‘void std::clear()’:

[...]
>From gcc-bugs-return-497605-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sun Sep 20 13:05:31 2015
Return-Path: <gcc-bugs-return-497605-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 88258 invoked by alias); 20 Sep 2015 13:05:30 -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 81742 invoked by uid 48); 20 Sep 2015 13:05:26 -0000
From: "dimhen at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug bootstrap/67647] [6 regression] boostrap FAIL with --disable-libstdcxx-dual-abi
Date: Sun, 20 Sep 2015 13:05:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: bootstrap
X-Bugzilla-Version: 6.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: dimhen at gmail dot com
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Resolution:
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-67647-4-6cUQFn50a2@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-67647-4@http.gcc.gnu.org/bugzilla/>
References: <bug-67647-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/msg01583.txt.bz2
Content-length: 139

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

--- Comment #1 from Dmitry G. Dyachenko <dimhen at gmail dot com> ---
Fedora 22 / x64


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

end of thread, other threads:[~2015-09-20 10:36 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-18 17:03 [Bug other/67630] New: ymm and zmm register aren't preserved in interrupt handler hjl.tools at gmail dot com
2015-09-18 17:29 ` [Bug other/67630] " hjl.tools at gmail dot com
2015-09-18 22:52 ` hjl.tools at gmail dot com
2015-09-19 22:35 ` hjl.tools at gmail dot com
2015-09-20 10:36 ` ubizjak 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).