public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/66838] New: Calling multiple SYSV AMD64 ABI functions from MS x64 ABI one results in clobbered parameters
@ 2015-07-11  0:59 michal.ruza at gmail dot com
  2015-07-12 15:21 ` [Bug rtl-optimization/66838] " ubizjak at gmail dot com
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: michal.ruza at gmail dot com @ 2015-07-11  0:59 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 66838
           Summary: Calling multiple SYSV AMD64 ABI functions from MS x64
                    ABI one results in clobbered parameters
           Product: gcc
           Version: 5.1.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: michal.ruza at gmail dot com
  Target Milestone: ---

Created attachment 35951
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=35951&action=edit
source code demonstrating the problem

This seems to be yet another corner case of bug 57003.

Description:
Calling a sequence of SYSV AMD64 ABI functions from an __attribute__((ms_abi))
function while passing an address of the same global variable to them results
in all but the first one in the sequence receiving clobbered values instead of
the expected address.

In code:
__attribute__((ms_abi, noinline, noclone)) void ms_abi_func() {
        sysv_abi_func("1st call", &global);
        sysv_abi_func("2nd call", &global);
        sysv_abi_func("3rd call", &global);
}
In this example only the first call of the "sysv_abi_func" is passed the
address of the global variable "global". All the other calls of the function
are passed clobbered values.

To see the problem:
- generate assembly for the attached "clobber_repro.c" for the x86_64
architecture as follows:
        gcc -S -O1 -m64 -o clobber_repro.S clobber_repro.c
- inspect the assembly code for the "ms_abi_func" fucntion
- you should see something like this after the function's prologue code:
        movl    $global, %esi
        movl    $.LC2, %edi
        call    sysv_abi_func
        movl    $.LC3, %edi
        call    sysv_abi_func
        movl    $.LC4, %edi
        call    sysv_abi_func

This apparently cannot work if "sysv_abi_func" clobbers %esi - and it is free
to do so as it is a SYSV AMD64 ABI function.

Additional notes:
- this doesn't happen when the "ms_abi_func" is NOT declared as
__attribute__((ms_abi))
- this doesn't happen when the "sysv_abi_func" IS declared as
__attribute__((ms_abi))
- this doesn't happen when the "global" is not a global variable - i.e. it
works when all of the calls are passed an address of the same local variable
- this doesn't happen when optimization is disabled (-O0)


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

* [Bug rtl-optimization/66838] Calling multiple SYSV AMD64 ABI functions from MS x64 ABI one results in clobbered parameters
  2015-07-11  0:59 [Bug c/66838] New: Calling multiple SYSV AMD64 ABI functions from MS x64 ABI one results in clobbered parameters michal.ruza at gmail dot com
@ 2015-07-12 15:21 ` ubizjak at gmail dot com
  2015-07-12 16:42 ` ubizjak at gmail dot com
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: ubizjak at gmail dot com @ 2015-07-12 15:21 UTC (permalink / raw)
  To: gcc-bugs

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

Uroš Bizjak <ubizjak at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Target|                            |x86_64
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2015-07-12
                 CC|                            |law at gcc dot gnu.org,
                   |                            |ubizjak at gmail dot com
          Component|c                           |rtl-optimization
   Target Milestone|---                         |5.2
     Ever confirmed|0                           |1

--- Comment #1 from Uroš Bizjak <ubizjak at gmail dot com> ---
Confirmed, this one is in postreload pass. The testcase from Comment #0, when
compiled with -O2 creates following dumps:

Register allocator creates correct sequence, _.reload dump shows for
ms_abi_func:

    2: NOTE_INSN_FUNCTION_BEG
    5: si:DI=`global'
    6: di:DI=`*.LC2'
    7: call [`sysv_abi_func'] argc:0
      REG_EH_REGION 0
    8: si:DI=`global'
    9: di:DI=`*.LC3'
   10: call [`sysv_abi_func'] argc:0
      REG_EH_REGION 0
   11: si:DI=`global'
   12: di:DI=`*.LC4'
   13: call [`sysv_abi_func'] argc:0
      REG_EH_REGION 0
   16: NOTE_INSN_DELETED

and _.postreload shows:

    2: NOTE_INSN_FUNCTION_BEG
    5: si:DI=`global'
    6: di:DI=`*.LC2'
    7: call [`sysv_abi_func'] argc:0
      REG_EH_REGION 0
    8: si:DI=si:DI
    9: di:DI=`*.LC3'
   10: call [`sysv_abi_func'] argc:0
      REG_EH_REGION 0
   11: si:DI=si:DI
   12: di:DI=`*.LC4'
   13: call [`sysv_abi_func'] argc:0
      REG_EH_REGION 0
   16: NOTE_INSN_DELETED

Please note invalid SI register propagation through function call to (insn 8)
and (insn 11).

Confirmed as rtl-optimization problem, CC added.
>From gcc-bugs-return-492082-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sun Jul 12 15:27:25 2015
Return-Path: <gcc-bugs-return-492082-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 92620 invoked by alias); 12 Jul 2015 15:27:25 -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 92566 invoked by uid 48); 12 Jul 2015 15:27:22 -0000
From: "ubizjak at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug rtl-optimization/66845] one more %si register function clobbering issue
Date: Sun, 12 Jul 2015 15:27:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: rtl-optimization
X-Bugzilla-Version: 5.1.0
X-Bugzilla-Keywords: wrong-code
X-Bugzilla-Severity: normal
X-Bugzilla-Who: ubizjak at gmail dot com
X-Bugzilla-Status: RESOLVED
X-Bugzilla-Resolution: DUPLICATE
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_status resolution
Message-ID: <bug-66845-4-9cOZP2R9rZ@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-66845-4@http.gcc.gnu.org/bugzilla/>
References: <bug-66845-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-07/txt/msg00972.txt.bz2
Content-length: 493

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

Uroš Bizjak <ubizjak at gmail dot com> changed:

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

--- Comment #3 from Uroš Bizjak <ubizjak at gmail dot com> ---
Dup.

*** This bug has been marked as a duplicate of bug 66838 ***
>From gcc-bugs-return-492083-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sun Jul 12 15:27:26 2015
Return-Path: <gcc-bugs-return-492083-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 92631 invoked by alias); 12 Jul 2015 15:27:25 -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 92582 invoked by uid 48); 12 Jul 2015 15:27:22 -0000
From: "ubizjak at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug rtl-optimization/66838] Calling multiple SYSV AMD64 ABI functions from MS x64 ABI one results in clobbered parameters
Date: Sun, 12 Jul 2015 15:27:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: rtl-optimization
X-Bugzilla-Version: 5.1.1
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: ubizjak at gmail dot com
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.2
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: cc
Message-ID: <bug-66838-4-p7KZliAtvc@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-66838-4@http.gcc.gnu.org/bugzilla/>
References: <bug-66838-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-07/txt/msg00973.txt.bz2
Content-length: 451

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

Uroš Bizjak <ubizjak at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |marcus at jet dot franken.de

--- Comment #2 from Uroš Bizjak <ubizjak at gmail dot com> ---
*** Bug 66845 has been marked as a duplicate of this bug. ***
>From gcc-bugs-return-492084-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sun Jul 12 15:47:28 2015
Return-Path: <gcc-bugs-return-492084-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 2160 invoked by alias); 12 Jul 2015 15:47:28 -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 2101 invoked by uid 48); 12 Jul 2015 15:47:24 -0000
From: "howarth.at.gcc at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug boehm-gc/66848] boehm-gc fails test suite on x86_64-apple-darwin15
Date: Sun, 12 Jul 2015 15:47:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: boehm-gc
X-Bugzilla-Version: 5.2.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: howarth.at.gcc 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-66848-4-Km88fg3rfq@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-66848-4@http.gcc.gnu.org/bugzilla/>
References: <bug-66848-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-07/txt/msg00974.txt.bz2
Content-length: 2651

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

--- Comment #2 from Jack Howarth <howarth.at.gcc at gmail dot com> ---
The seg fault in the thread_leak_test back traces as...

# lldb ./thread_leak_test
(lldb) target create "./thread_leak_test"
Current executable set to './thread_leak_test' (x86_64).
(lldb) r
Process 35899 launched: './thread_leak_test' (x86_64)
Process 35899 stopped
* thread #2: tid = 0x20cc95, 0x000000010000c48b
libgcjgc.1.dylib`GC_mark_from(mark_stack_top=0x00000001000b1430,
mark_stack=0x00000001000b1000, mark_stack_limit=0x00000001000c1000) + 283 at
mark.c:759, stop reason = EXC_BAD_ACCESS (code=1, address=0x7fff7f95a158)
    frame #0: 0x000000010000c48b
libgcjgc.1.dylib`GC_mark_from(mark_stack_top=0x00000001000b1430,
mark_stack=0x00000001000b1000, mark_stack_limit=0x00000001000c1000) + 283 at
mark.c:759
   756          for(;;) {
   757            PREFETCH((ptr_t)limit - PREF_DIST*CACHE_LINE_SIZE);
   758            GC_ASSERT(limit >= current_p);
-> 759            deferred = *limit;
   760            FIXUP_POINTER(deferred);
   761            limit = (word *)((char *)limit - ALIGNMENT);
   762            if ((ptr_t)deferred >= least_ha && (ptr_t)deferred <
greatest_ha) {
(lldb) bt
* thread #2: tid = 0x20cc95, 0x000000010000c48b
libgcjgc.1.dylib`GC_mark_from(mark_stack_top=0x00000001000b1430,
mark_stack=0x00000001000b1000, mark_stack_limit=0x00000001000c1000) + 283 at
mark.c:759, stop reason = EXC_BAD_ACCESS (code=1, address=0x7fff7f95a158)
  * frame #0: 0x000000010000c48b
libgcjgc.1.dylib`GC_mark_from(mark_stack_top=0x00000001000b1430,
mark_stack=0x00000001000b1000, mark_stack_limit=0x00000001000c1000) + 283 at
mark.c:759
    frame #1: 0x000000010000db66
libgcjgc.1.dylib`GC_mark_some(cold_gc_frame=0x0000700000080d6c) + 518 at
mark.c:378
    frame #2: 0x00000001000054d8
libgcjgc.1.dylib`GC_stopped_mark(stop_func=0x00000001000051c0) + 120 at
alloc.c:531
    frame #3: 0x0000000100005d31
libgcjgc.1.dylib`GC_try_to_collect_inner(stop_func=0x00000001000051c0) + 145 at
alloc.c:378
    frame #4: 0x0000000100005ffc
libgcjgc.1.dylib`GC_try_to_collect(stop_func=0x00000001000051c0) + 92 at
alloc.c:781
    frame #5: 0x0000000100006070 libgcjgc.1.dylib`GC_gcollect + 16 at
alloc.c:794
    frame #6: 0x0000000100000d18 thread_leak_test`test + 72
    frame #7: 0x00000001000145c4
libgcjgc.1.dylib`GC_start_routine(arg=<unavailable>) + 244 at
pthread_support.c:1301
    frame #8: 0x00007fff9e60fc8f libsystem_pthread.dylib`_pthread_body + 131
    frame #9: 0x00007fff9e60fc0c libsystem_pthread.dylib`_pthread_start + 168
    frame #10: 0x00007fff9e60d3f5 libsystem_pthread.dylib`thread_start + 13
(lldb)


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

* [Bug rtl-optimization/66838] Calling multiple SYSV AMD64 ABI functions from MS x64 ABI one results in clobbered parameters
  2015-07-11  0:59 [Bug c/66838] New: Calling multiple SYSV AMD64 ABI functions from MS x64 ABI one results in clobbered parameters michal.ruza at gmail dot com
  2015-07-12 15:21 ` [Bug rtl-optimization/66838] " ubizjak at gmail dot com
@ 2015-07-12 16:42 ` ubizjak at gmail dot com
  2015-07-15  7:29 ` uros at gcc dot gnu.org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: ubizjak at gmail dot com @ 2015-07-12 16:42 UTC (permalink / raw)
  To: gcc-bugs

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

Uroš Bizjak <ubizjak at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|unassigned at gcc dot gnu.org      |ubizjak at gmail dot com

--- Comment #3 from Uroš Bizjak <ubizjak at gmail dot com> ---
Created attachment 35961
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=35961&action=edit
Untested patch

Patch that adds missing CALL_INSN_FUNCTION_USAGE processing to
postreload.c/reload_cse_move2add.
>From gcc-bugs-return-492092-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sun Jul 12 16:43:26 2015
Return-Path: <gcc-bugs-return-492092-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 125605 invoked by alias); 12 Jul 2015 16:43:26 -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 125560 invoked by uid 48); 12 Jul 2015 16:43:22 -0000
From: "ubizjak at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug rtl-optimization/66838] Calling multiple SYSV AMD64 ABI functions from MS x64 ABI one results in clobbered parameters
Date: Sun, 12 Jul 2015 16:43:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: rtl-optimization
X-Bugzilla-Version: 5.1.1
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: ubizjak at gmail dot com
X-Bugzilla-Status: ASSIGNED
X-Bugzilla-Resolution:
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: ubizjak at gmail dot com
X-Bugzilla-Target-Milestone: 5.2
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: bug_status
Message-ID: <bug-66838-4-zoosNNZzYm@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-66838-4@http.gcc.gnu.org/bugzilla/>
References: <bug-66838-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-07/txt/msg00982.txt.bz2
Content-length: 298

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

Uroš Bizjak <ubizjak at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
>From gcc-bugs-return-492093-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sun Jul 12 20:33:39 2015
Return-Path: <gcc-bugs-return-492093-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 45150 invoked by alias); 12 Jul 2015 20:33:39 -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 45118 invoked by uid 55); 12 Jul 2015 20:33:34 -0000
From: "andrew.n.sutton at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/66834] [concepts] concept parameter kind mismatch causes hard error
Date: Sun, 12 Jul 2015 20:33:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: c++
X-Bugzilla-Version: c++-concepts
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: andrew.n.sutton 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-66834-4-Ml3hqZuBfV@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-66834-4@http.gcc.gnu.org/bugzilla/>
References: <bug-66834-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-07/txt/msg00983.txt.bz2
Content-length: 530

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

--- Comment #7 from Andrew Sutton <andrew.n.sutton at gmail dot com> ---
> I would expect a partial ordering to prefer the two-parameter overload in that
> case. But yeah, it's a separate issue.

The problem is that partial ordering doesn't apply to template
parameters whose arguments can only be given explicitly. I got caught
by this last year, and sent an email to core, and then (I think) Ville
submitted a core issue or NB comment (I don't remember the details).

Andrew


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

* [Bug rtl-optimization/66838] Calling multiple SYSV AMD64 ABI functions from MS x64 ABI one results in clobbered parameters
  2015-07-11  0:59 [Bug c/66838] New: Calling multiple SYSV AMD64 ABI functions from MS x64 ABI one results in clobbered parameters michal.ruza at gmail dot com
  2015-07-12 15:21 ` [Bug rtl-optimization/66838] " ubizjak at gmail dot com
  2015-07-12 16:42 ` ubizjak at gmail dot com
@ 2015-07-15  7:29 ` uros at gcc dot gnu.org
  2015-07-16  9:15 ` [Bug rtl-optimization/66838] [5 Regression] " rguenth at gcc dot gnu.org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: uros at gcc dot gnu.org @ 2015-07-15  7:29 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from uros at gcc dot gnu.org ---
Author: uros
Date: Wed Jul 15 07:28:33 2015
New Revision: 225806

URL: https://gcc.gnu.org/viewcvs?rev=225806&root=gcc&view=rev
Log:
        PR rtl-optimization/66838
        * postreload.c (reload_cse_move2add): Also process
        CALL_INSN_FUNCTION_USAGE when resetting information of
        call-clobbered registers.

testsuite/ChangeLog:

        PR rtl-optimization/66838
        * gcc.target/i386/pr66838.c: New test.


Added:
    trunk/gcc/testsuite/gcc.target/i386/pr66838.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/postreload.c
    trunk/gcc/testsuite/ChangeLog


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

* [Bug rtl-optimization/66838] [5 Regression] Calling multiple SYSV AMD64 ABI functions from MS x64 ABI one results in clobbered parameters
  2015-07-11  0:59 [Bug c/66838] New: Calling multiple SYSV AMD64 ABI functions from MS x64 ABI one results in clobbered parameters michal.ruza at gmail dot com
                   ` (2 preceding siblings ...)
  2015-07-15  7:29 ` uros at gcc dot gnu.org
@ 2015-07-16  9:15 ` rguenth at gcc dot gnu.org
  2015-07-17 13:51 ` uros at gcc dot gnu.org
  2015-07-17 14:06 ` ubizjak at gmail dot com
  5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu.org @ 2015-07-16  9:15 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|5.2                         |5.3

--- Comment #6 from Richard Biener <rguenth at gcc dot gnu.org> ---
GCC 5.2 is being released, adjusting target milestone to 5.3.


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

* [Bug rtl-optimization/66838] [5 Regression] Calling multiple SYSV AMD64 ABI functions from MS x64 ABI one results in clobbered parameters
  2015-07-11  0:59 [Bug c/66838] New: Calling multiple SYSV AMD64 ABI functions from MS x64 ABI one results in clobbered parameters michal.ruza at gmail dot com
                   ` (3 preceding siblings ...)
  2015-07-16  9:15 ` [Bug rtl-optimization/66838] [5 Regression] " rguenth at gcc dot gnu.org
@ 2015-07-17 13:51 ` uros at gcc dot gnu.org
  2015-07-17 14:06 ` ubizjak at gmail dot com
  5 siblings, 0 replies; 7+ messages in thread
From: uros at gcc dot gnu.org @ 2015-07-17 13:51 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from uros at gcc dot gnu.org ---
Author: uros
Date: Fri Jul 17 13:50:38 2015
New Revision: 225935

URL: https://gcc.gnu.org/viewcvs?rev=225935&root=gcc&view=rev
Log:
        Backport from mainline:
        2015-07-15  Uros Bizjak  <ubizjak@gmail.com>

        PR rtl-optimization/66838
        * postreload.c (reload_cse_move2add): Also process
        CALL_INSN_FUNCTION_USAGE when resetting information of
        call-clobbered registers.

testsuite/ChangeLog:

        Backport from mainline:
        2015-07-15  Uros Bizjak  <ubizjak@gmail.com>

        PR rtl-optimization/66838
        * gcc.target/i386/pr66838.c: New test.


Added:
    branches/gcc-5-branch/gcc/testsuite/gcc.target/i386/pr66838.c
Modified:
    branches/gcc-5-branch/gcc/ChangeLog
    branches/gcc-5-branch/gcc/postreload.c
    branches/gcc-5-branch/gcc/testsuite/ChangeLog


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

* [Bug rtl-optimization/66838] [5 Regression] Calling multiple SYSV AMD64 ABI functions from MS x64 ABI one results in clobbered parameters
  2015-07-11  0:59 [Bug c/66838] New: Calling multiple SYSV AMD64 ABI functions from MS x64 ABI one results in clobbered parameters michal.ruza at gmail dot com
                   ` (4 preceding siblings ...)
  2015-07-17 13:51 ` uros at gcc dot gnu.org
@ 2015-07-17 14:06 ` ubizjak at gmail dot com
  5 siblings, 0 replies; 7+ messages in thread
From: ubizjak at gmail dot com @ 2015-07-17 14:06 UTC (permalink / raw)
  To: gcc-bugs

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

Uroš Bizjak <ubizjak at gmail dot com> changed:

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

--- Comment #8 from Uroš Bizjak <ubizjak at gmail dot com> ---
Fixed.
>From gcc-bugs-return-492635-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Fri Jul 17 14:12:17 2015
Return-Path: <gcc-bugs-return-492635-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 119294 invoked by alias); 17 Jul 2015 14:12:17 -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 119201 invoked by uid 48); 17 Jul 2015 14:12:12 -0000
From: "ubizjak at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug rtl-optimization/66865] [6 Regression] wine64 segfaults from gcc in trunk (r225757) (regression)
Date: Fri, 17 Jul 2015 14:12:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: rtl-optimization
X-Bugzilla-Version: 6.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: ubizjak at gmail dot com
X-Bugzilla-Status: WAITING
X-Bugzilla-Resolution:
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: 6.0
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: bug_status cf_reconfirmed_on cc everconfirmed
Message-ID: <bug-66865-4-psq4XTJZ48@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-66865-4@http.gcc.gnu.org/bugzilla/>
References: <bug-66865-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-07/txt/msg01525.txt.bz2
Content-length: 651

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

Uroš Bizjak <ubizjak at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |WAITING
   Last reconfirmed|                            |2015-07-17
                 CC|                            |ubizjak at gmail dot com
     Ever confirmed|0                           |1

--- Comment #14 from Uroš Bizjak <ubizjak at gmail dot com> ---
Can you please retry now that PR 66782 and PR 66838 are both fixed on mainline
and gcc-5 branch?
>From gcc-bugs-return-492636-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Fri Jul 17 14:16:17 2015
Return-Path: <gcc-bugs-return-492636-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 13796 invoked by alias); 17 Jul 2015 14:16:17 -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 13392 invoked by uid 48); 17 Jul 2015 14:16:13 -0000
From: "barry.revzin at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/66914] New: incorrect template partial ordering prefers non-member function instead of being ambiguous
Date: Fri, 17 Jul 2015 14:16:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: new
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: c++
X-Bugzilla-Version: 5.1.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: barry.revzin 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-66914-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-07/txt/msg01526.txt.bz2
Content-length: 916

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

            Bug ID: 66914
           Summary: incorrect template partial ordering prefers non-member
                    function instead of being ambiguous
           Product: gcc
           Version: 5.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: barry.revzin at gmail dot com
  Target Milestone: ---

The following code:

#include <iostream>

template <typename N>
struct A {
    template <typename T>
    void operator+(T const&) {
        std::cout << "member\n";
    }
};

template <typename N>
void operator+(A<N>&, int const& ) {
    std::cout << "free\n";
}

int main()
{
    A<int> a;
    a + 2;
}

compiles and prints "free". It should be ambiguous as neither function template
is more specialized than the other.


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

end of thread, other threads:[~2015-07-17 14:06 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-11  0:59 [Bug c/66838] New: Calling multiple SYSV AMD64 ABI functions from MS x64 ABI one results in clobbered parameters michal.ruza at gmail dot com
2015-07-12 15:21 ` [Bug rtl-optimization/66838] " ubizjak at gmail dot com
2015-07-12 16:42 ` ubizjak at gmail dot com
2015-07-15  7:29 ` uros at gcc dot gnu.org
2015-07-16  9:15 ` [Bug rtl-optimization/66838] [5 Regression] " rguenth at gcc dot gnu.org
2015-07-17 13:51 ` uros at gcc dot gnu.org
2015-07-17 14:06 ` 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).