public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug rtl-optimization/58679] New: [4.9 regression] ICE in create_pre_exit, at mode-switching.c:421 with -mavx after r202915
@ 2013-10-10  8:46 izamyatin at gmail dot com
  2013-10-10 12:02 ` [Bug rtl-optimization/58679] " rguenth at gcc dot gnu.org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: izamyatin at gmail dot com @ 2013-10-10  8:46 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 58679
           Summary: [4.9 regression] ICE in create_pre_exit, at
                    mode-switching.c:421 with -mavx after r202915
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: rtl-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: izamyatin at gmail dot com
                CC: yvan.roux at linaro dot org
              Host: x86
            Target: x86

Happens with gcc.c-torture/execute/pr30185.c with just "-O2 -mavx" options.

Removing all REG_DEAD and REG_UNUSED notes as said in r202915 affected work of
single_set_2 for 

  if (GET_CODE (pat) == PARALLEL)

and hence in mode-switching.c single_set now returns NULL for

  return_copy_pat = single_set (return_copy);


Not sure who is exactly wrong here - create_pre_exit code doesn't look very
clear :(


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

* [Bug rtl-optimization/58679] [4.9 regression] ICE in create_pre_exit, at mode-switching.c:421 with -mavx after r202915
  2013-10-10  8:46 [Bug rtl-optimization/58679] New: [4.9 regression] ICE in create_pre_exit, at mode-switching.c:421 with -mavx after r202915 izamyatin at gmail dot com
@ 2013-10-10 12:02 ` rguenth at gcc dot gnu.org
  2013-10-26  7:38 ` ubizjak at gmail dot com
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu.org @ 2013-10-10 12:02 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.9.0


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

* [Bug rtl-optimization/58679] [4.9 regression] ICE in create_pre_exit, at mode-switching.c:421 with -mavx after r202915
  2013-10-10  8:46 [Bug rtl-optimization/58679] New: [4.9 regression] ICE in create_pre_exit, at mode-switching.c:421 with -mavx after r202915 izamyatin at gmail dot com
  2013-10-10 12:02 ` [Bug rtl-optimization/58679] " rguenth at gcc dot gnu.org
@ 2013-10-26  7:38 ` ubizjak at gmail dot com
  2013-10-26 11:42 ` ubizjak at gmail dot com
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: ubizjak at gmail dot com @ 2013-10-26  7:38 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2013-10-26
               Host|x86                         |
     Ever confirmed|0                           |1

--- Comment #1 from Uroš Bizjak <ubizjak at gmail dot com> ---
The patch at [1] now removes useless moves in the exit bb. This change breaks
assumption in the mode-switching pass that all USEs of return values have a
corresponding simple return value copy somewhere up in the insn stream.

The testcase:

--cut here--
typedef long long __m128i __attribute__ ((__vector_size__ (16)));
typedef char __v16qi __attribute__ ((__vector_size__ (16)));


__m128i _mm_cmpistrm (__m128i __X, __m128i __Y, const int __M)
{
  return (__m128i) __builtin_ia32_pcmpistrm128((__v16qi)__X, (__v16qi)__Y, 1);
}
--cut here--

Before the above change, RA generated:

(insn 2 6 3 2 (set (reg/v:V2DI 21 xmm0 [orig:92 __X ] [92])
        (reg:V2DI 21 xmm0 [ __X ])) tt.c:6 1156 {*movv2di_internal}
     (nil))
(note 3 2 5 2 NOTE_INSN_DELETED)
(note 5 3 20 2 NOTE_INSN_FUNCTION_BEG)
(insn 20 5 14 2 (parallel [
            (set (reg:V16QI 21 xmm0 [95])
                (unspec:V16QI [
                        (reg:V16QI 21 xmm0 [orig:92 __X ] [92])
                        (reg:V16QI 22 xmm1 [ __Y ])
                        (const_int 1 [0x1])
                    ] UNSPEC_PCMPISTR))
            (set (reg:CC 17 flags)
                (unspec:CC [
                        (reg:V16QI 21 xmm0 [orig:92 __X ] [92])
                        (reg:V16QI 22 xmm1 [ __Y ])
                        (const_int 1 [0x1])
                    ] UNSPEC_PCMPISTR))
        ]) tt.c:7 1979 {sse4_2_pcmpistrm}
     (nil))
(insn 14 20 17 2 (set (reg/i:V2DI 21 xmm0)
        (reg:V2DI 21 xmm0 [95])) tt.c:8 1156 {*movv2di_internal}
     (nil))
(insn 17 14 21 2 (use (reg/i:V2DI 21 xmm0)) tt.c:8 -1
     (nil))

Please note useless (insn 14), expected by mode switching pass (this insn was
actually removed by later passes). After the change, following insn stream is
generated:

(insn 20 5 17 2 (parallel [
            (set (reg:V16QI 21 xmm0 [95])
                (unspec:V16QI [
                        (reg:V16QI 21 xmm0 [orig:92 __X ] [92])
                        (reg:V16QI 22 xmm1 [ __Y ])
                        (const_int 1 [0x1])
                    ] UNSPEC_PCMPISTR))
            (set (reg:CC 17 flags)
                (unspec:CC [
                        (reg:V16QI 21 xmm0 [orig:92 __X ] [92])
                        (reg:V16QI 22 xmm1 [ __Y ])
                        (const_int 1 [0x1])
                    ] UNSPEC_PCMPISTR))
        ]) tt.c:7 1979 {sse4_2_pcmpistrm}
     (nil))
(insn 17 20 21 2 (use (reg/i:V2DI 21 xmm0)) tt.c:8 -1
     (nil))

There is no return value copy insn.

The assumption in the mode switching pass, that there is a return value copy is
not correct anymore, due to recent enhancements in the RA. The mode switching
pass should perform life analysis by itself. Simply looking for a return copy
is not correct anymore.

Confirmed by above testcase.
>From gcc-bugs-return-432778-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sat Oct 26 07:58:13 2013
Return-Path: <gcc-bugs-return-432778-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 14757 invoked by alias); 26 Oct 2013 07:58:12 -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 14680 invoked by uid 48); 26 Oct 2013 07:58:08 -0000
From: "ubizjak at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug rtl-optimization/58679] [4.9 regression] ICE in create_pre_exit, at mode-switching.c:421 with -mavx after r202915
Date: Sat, 26 Oct 2013 07:58: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: 4.9.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: ubizjak at gmail dot com
X-Bugzilla-Status: NEW
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: 4.9.0
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-58679-4-eZ2MKHQ6WD@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-58679-4@http.gcc.gnu.org/bugzilla/>
References: <bug-58679-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: 2013-10/txt/msg01922.txt.bz2
Content-length: 628

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

--- Comment #2 from Uroš Bizjak <ubizjak at gmail dot com> ---
The compile failure with the testcase from Comment #0 has gone latent, but the
problem looks similar to PR 58792 [1].

On a related note, the allocator introduces extra move for pr30185.c testcase
that results in:

foo:
        movq    %rsi, %rax
        cqto
        idivq   %rcx
        movq    %rax, %rsi         <---- here (*)
        xorl    %eax, %eax
        movq    %rsi, %rdx
        ret

"movq %rax, %rdx" should be emitted at (*).

[1] http://gcc.gnu.org/ml/gcc-patches/2013-10/msg01606.html
>From gcc-bugs-return-432779-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sat Oct 26 08:05:07 2013
Return-Path: <gcc-bugs-return-432779-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 18403 invoked by alias); 26 Oct 2013 08:05:07 -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 18347 invoked by uid 48); 26 Oct 2013 08:05:02 -0000
From: "ubizjak at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug rtl-optimization/58679] [4.9 regression] ICE in create_pre_exit, at mode-switching.c:421 with -mavx after r202915
Date: Sat, 26 Oct 2013 08:05: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: 4.9.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: ubizjak at gmail dot com
X-Bugzilla-Status: NEW
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: 4.9.0
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-58679-4-4QIcfHTGd8@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-58679-4@http.gcc.gnu.org/bugzilla/>
References: <bug-58679-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: 2013-10/txt/msg01923.txt.bz2
Content-length: 286

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

--- Comment #3 from Uroš Bizjak <ubizjak at gmail dot com> ---
For reference, the discussion of the change that removed REG_DEAD and
REG_UNUSED notes, started at [1].

[1] http://gcc.gnu.org/ml/gcc-patches/2013-09/msg01781.html
>From gcc-bugs-return-432780-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sat Oct 26 08:13:18 2013
Return-Path: <gcc-bugs-return-432780-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 23955 invoked by alias); 26 Oct 2013 08:13: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 23899 invoked by uid 48); 26 Oct 2013 08:13:13 -0000
From: "ubizjak at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug rtl-optimization/58679] [4.9 regression] ICE in create_pre_exit, at mode-switching.c:421 with -mavx after r202915
Date: Sat, 26 Oct 2013 08:13: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: 4.9.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: ubizjak at gmail dot com
X-Bugzilla-Status: NEW
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: 4.9.0
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: cc
Message-ID: <bug-58679-4-BICzTYHdEq@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-58679-4@http.gcc.gnu.org/bugzilla/>
References: <bug-58679-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: 2013-10/txt/msg01924.txt.bz2
Content-length: 525

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |amylaar at gcc dot gnu.org,
                   |                            |olegendo at gcc dot gnu.org

--- Comment #4 from Uroš Bizjak <ubizjak at gmail dot com> ---
Adding some CCs for targets that also use mode switching pass.
>From gcc-bugs-return-432781-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sat Oct 26 08:56:13 2013
Return-Path: <gcc-bugs-return-432781-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 10055 invoked by alias); 26 Oct 2013 08:56:13 -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 10015 invoked by uid 48); 26 Oct 2013 08:56:09 -0000
From: "octoploid at yandex dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/58627] [4.9 Regression] crash during compilation of boost testsuite
Date: Sat, 26 Oct 2013 08:56: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: unknown
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: octoploid at yandex dot com
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: 4.9.0
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-58627-4-pe6D9wkWJW@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-58627-4@http.gcc.gnu.org/bugzilla/>
References: <bug-58627-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: 2013-10/txt/msg01925.txt.bz2
Content-length: 3169

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

--- Comment #3 from octoploid at yandex dot com ---
Valgrind shows:

markus@x4 /tmp % valgrind --track-origins=yes --trace-children=yes g++ -O2
-std=c++11 -c test.ii
==6647== Memcheck, a memory error detector
==6647== Copyright (C) 2002-2012, and GNU GPL'd, by Julian Seward et al.
==6647== Using Valgrind-3.8.1 and LibVEX; rerun with -h for copyright info
==6647== Command: g++ -O2 -std=c++11 -c test.ii
==6647== 
==6647== Memcheck, a memory error detector
==6647== Copyright (C) 2002-2012, and GNU GPL'd, by Julian Seward et al.
==6647== Using Valgrind-3.8.1 and LibVEX; rerun with -h for copyright info
==6647== Command: /usr/x86_64-pc-linux-gnu/gcc-bin/4.9.0/g++ -O2 -std=c++11 -c
test.ii
==6647== 
==6655== Memcheck, a memory error detector
==6655== Copyright (C) 2002-2012, and GNU GPL'd, by Julian Seward et al.
==6655== Using Valgrind-3.8.1 and LibVEX; rerun with -h for copyright info
==6655== Command: /usr/libexec/gcc/x86_64-pc-linux-gnu/4.9.0/cc1plus
-fpreprocessed test.ii -quiet -dumpbase test.ii -mtune=generic -march=x86-64
-auxbase test -O2 -std=c++11 -o /tmp/cctcTn3y.s
==6655== 
==6655== Invalid read of size 1
==6655==    at 0x5E453A: gt_ggc_mx_lang_tree_node(void*) (c-common.h:1211)
==6655==    by 0x5E5AEB: gt_ggc_mx_lang_tree_node(void*) (gt-cp-tree.h:510)
==6655==    by 0x5E61AF: gt_ggc_mx_tinst_level(void*) (gt-cp-tree.h:124)
==6655==    by 0x533E3F: gt_ggc_mx_pending_template(void*) (gt-cp-pt.h:44)
==6655==    by 0x78A8E5: ggc_mark_root_tab(ggc_root_tab const*)
(ggc-common.c:133)
==6655==    by 0x78AC90: ggc_mark_roots() (ggc-common.c:152)
==6655==    by 0x65A9EA: ggc_collect() (ggc-page.c:2077)
==6655==    by 0x869A4D: execute_one_pass(opt_pass*) (passes.c:2255)
==6655==    by 0x869D65: execute_pass_list(opt_pass*) (passes.c:2267)
==6655==    by 0x6AF0EB: analyze_function(cgraph_node*) (cgraphunit.c:650)
==6655==    by 0x6B0127: analyze_functions() (cgraphunit.c:1004)
==6655==    by 0x6B0F35: finalize_compilation_unit() (cgraphunit.c:2262)
==6655==  Address 0x17125d8 is not stack'd, malloc'd or (recently) free'd
==6655== 
test.ii: In function ‘void
fastest_itl_total_icl_quantifier_check_monoid_plus_4_bicremental_types_invoker()’:
test.ii:3069:14: internal compiler error: Segmentation fault
  static void
fastest_itl_total_icl_quantifier_check_monoid_plus_4_bicremental_types_invoker()
{ ::boost::unit_test::unit_test_log.set_checkpoint(
::boost::unit_test::const_string(
"../libs/icl/test/fastest_total_icl_quantifier_/../fastest_total_icl_quantifier_cases.hpp",
sizeof(
"../libs/icl/test/fastest_total_icl_quantifier_/../fastest_total_icl_quantifier_cases.hpp"
) - 1 ), static_cast<std::size_t>(  15 
              ^
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
>From gcc-bugs-return-432782-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sat Oct 26 09:03:01 2013
Return-Path: <gcc-bugs-return-432782-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 13426 invoked by alias); 26 Oct 2013 09:03:00 -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 13383 invoked by uid 48); 26 Oct 2013 09:02:55 -0000
From: "paolo.carlini at oracle dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/58885] Template static variable linking issue!
Date: Sat, 26 Oct 2013 09:03: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: 4.8.1
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: paolo.carlini at oracle dot com
X-Bugzilla-Status: UNCONFIRMED
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_severity
Message-ID: <bug-58885-4-e723JDw6Hr@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-58885-4@http.gcc.gnu.org/bugzilla/>
References: <bug-58885-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: 2013-10/txt/msg01926.txt.bz2
Content-length: 497

http://gcc.gnu.org/bugzilla/show_bug.cgi?idX885

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|major                       |normal

--- Comment #1 from Paolo Carlini <paolo.carlini at oracle dot com> ---
Yet to be analyzed, but looks like a bug in your code: up to date g++, clang++,
icc, all reject it at link time the same way.


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

* [Bug rtl-optimization/58679] [4.9 regression] ICE in create_pre_exit, at mode-switching.c:421 with -mavx after r202915
  2013-10-10  8:46 [Bug rtl-optimization/58679] New: [4.9 regression] ICE in create_pre_exit, at mode-switching.c:421 with -mavx after r202915 izamyatin at gmail dot com
  2013-10-10 12:02 ` [Bug rtl-optimization/58679] " rguenth at gcc dot gnu.org
  2013-10-26  7:38 ` ubizjak at gmail dot com
@ 2013-10-26 11:42 ` ubizjak at gmail dot com
  2013-10-26 13:25 ` amylaar at gcc dot gnu.org
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: ubizjak at gmail dot com @ 2013-10-26 11:42 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Uroš Bizjak <ubizjak at gmail dot com> ---
Another problem:

--cut here--
int f (long long a, long long b)
{
  return (a * b) >> 16;
}
--cut here--

-O2 -mavx -m32 results in the ICE in mode switching due to following sequence:

(insn 14 12 23 2 (parallel [
            (set (reg:DI 0 ax [orig:99 D.1985 ] [99])
                (ashiftrt:DI (reg:DI 0 ax [orig:97 D.1985 ] [97])
                    (const_int 16 [0x10])))
            (clobber (reg:CC 17 flags))
        ]) t-2.c:3 528 {*ashrdi3_doubleword}
     (nil))
(insn 23 14 30 2 (use (reg/i:SI 0 ax)) t-2.c:4 -1
     (nil))

The set and use have different modes. Before the change:

(insn 14 12 20 2 (parallel [
            (set (reg:DI 0 ax [orig:99 D.1985 ] [99])
                (ashiftrt:DI (reg:DI 0 ax [orig:97 D.1985 ] [97])
                    (const_int 16 [0x10])))
            (clobber (reg:CC 17 flags))
        ]) t-2.c:3 528 {*ashrdi3_doubleword}
     (nil))
(insn 20 14 23 2 (set (reg/i:SI 0 ax)
        (reg:SI 0 ax [orig:99 D.1985 ] [99])) t-2.c:4 86 {*movsi_internal}
     (nil))
(insn 23 20 30 2 (use (reg/i:SI 0 ax)) t-2.c:4 -1
     (nil))
>From gcc-bugs-return-432784-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sat Oct 26 11:59:10 2013
Return-Path: <gcc-bugs-return-432784-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 7690 invoked by alias); 26 Oct 2013 11:59: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 7667 invoked by uid 48); 26 Oct 2013 11:59:06 -0000
From: "bremende55 at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libgcc/58886] New: regex with (?s) (valid in Java and boost) yields regex_error
Date: Sat, 26 Oct 2013 11:59:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: new
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: libgcc
X-Bugzilla-Version: 4.9.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: bremende55 at gmail dot com
X-Bugzilla-Status: UNCONFIRMED
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
Message-ID: <bug-58886-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: 2013-10/txt/msg01928.txt.bz2
Content-length: 1331

http://gcc.gnu.org/bugzilla/show_bug.cgi?idX886

            Bug ID: 58886
           Summary: regex with (?s) (valid in Java and boost) yields
                    regex_error
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libgcc
          Assignee: unassigned at gcc dot gnu.org
          Reporter: bremende55 at gmail dot com

regex  with (?s) (valid in Java and boost) yields regex_error
(?s) ist the 'dot-matches-all" match mode, i.e. \n ist treated as normal char
see example:

#include <iostream>
#include <regex>
#include <string>
int main() {
   std::string multilinecomment("/* text\n\n\n */");
// execution of the next line gives regex_error !!
   std::string result = std::regex_replace(multilinecomment,
                           std::regex("(?s)/\\*.*?\\*/"), "replacement");
   std::cout << result << std::endl;
}
// The same code DOES WORK with BOOST:
// #include <iostream>
// #include<boost/regex.hpp>
// #include <string>
// int main() {
//    std::string multilinecomment("/* text\n\n\n */");
//    std::string result = boost::regex_replace(multilinecomment,
//                            boost::regex("(?s)/\\*.*?\\*/"), "replacement");
//    std::cout << result << std::endl;  // replacement
// }


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

* [Bug rtl-optimization/58679] [4.9 regression] ICE in create_pre_exit, at mode-switching.c:421 with -mavx after r202915
  2013-10-10  8:46 [Bug rtl-optimization/58679] New: [4.9 regression] ICE in create_pre_exit, at mode-switching.c:421 with -mavx after r202915 izamyatin at gmail dot com
                   ` (2 preceding siblings ...)
  2013-10-26 11:42 ` ubizjak at gmail dot com
@ 2013-10-26 13:25 ` amylaar at gcc dot gnu.org
  2013-10-26 14:35 ` ubizjak at gmail dot com
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: amylaar at gcc dot gnu.org @ 2013-10-26 13:25 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Jorn Wolfgang Rennecke <amylaar at gcc dot gnu.org> ---
(In reply to Uroš Bizjak from comment #1)

> There is no return value copy insn.
> 
> The assumption in the mode switching pass, that there is a return value copy
> is not correct anymore, due to recent enhancements in the RA. The mode
> switching pass should perform life analysis by itself. Simply looking for a
> return copy is not correct anymore.

You got that backwards.  The point of most of the code in create_pre_exit
is to look for a return value copy, to make sure it is not separated any
more from the return statement unless that can't be helped.

The reason is that for likely_spilled registers, there is a double
hazard of clobbering the return value:
- The mode switching code itself might clobber the return value.
- A successive pass might clobber the return value.
  At the time the mode switching code was written - not sure if that
  has changed in the meantime - the value in a likely_spilled FUNCTION_VALUE
  register was only guaranteed to be preserved if the return value copy was
  the very last instruction before the return insn (or the end of the exit
  block).  Every pass is supposed to keep the return value copy in that
  position if a likely_spilled register FUNCTION_VALUE register is involved.


Thus, we still have to look for a return value copy.

The change in the rtl representation means that we can no longer use
REG_DEAD / REG_UNUSED notes in optimize_mode_switching to keep track of
the set of live registers that EMIT_MODE_SET has to avoid using as scratch
registers.
Also, new cases of disappearing return value copies can mean one of two
things:
- the removal is a legit optimization, and the sanity checks in
create_pre_exit should be accordingly relaxed.
- the removal increases likely_spilled register pressure in a manner that can
  lead to wrong code, and must be suppressed.

There is also a wider issue: the documentation in passes.texi is incorrect now.
It says:
"Unlike the reload pass, intermediate LRA decisions are reflected in
 RTL as much as possible."
Now, with the removal of REG_DEAD / REG_UNUSED notes, the complete opposite
is true.  These notes are a bit fuzzy after reload, but their fuzzyness is
well-defined - i.e. the notes pertain to a death in the same BB, unless
superceded by a simultaneous (with use) or later set.
But with lra, we don't have them at all anymore - that means a lot of target
code has to be re-written to use DF.
Some of this seems quite preposterous to do in place- e.g. using df inside
an output pattern.  So maybe we need to put more clobbers for opportunistic
register usage into rtl - we might use additional peephole2 patterns,
e.g. one after branch shortening for the arc casesi patterns.

SH splitters could also use such inserted clobbers, not sure where the extra
peephole2 pass should be inserted.

That raises the question - should we able to tag peephole2 patterns to
be run during specific peephole2 passes / pass sets?
Or should we call them peepholen, with n being an integer?

Or should we use a different approach, and use DF to re-create REG_DEAD notes?
Will that work now in the later stages of the compiler too?
>From gcc-bugs-return-432787-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sat Oct 26 13:37:56 2013
Return-Path: <gcc-bugs-return-432787-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 18323 invoked by alias); 26 Oct 2013 13:37:56 -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 18287 invoked by uid 48); 26 Oct 2013 13:37:53 -0000
From: "redi at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libstdc++/58839] [4.8/4.9 Regression] dereferencing void* in shared_ptr(unique_ptr&& u) constructor
Date: Sat, 26 Oct 2013 13:37:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: libstdc++
X-Bugzilla-Version: 4.8.1
X-Bugzilla-Keywords: rejects-valid
X-Bugzilla-Severity: normal
X-Bugzilla-Who: redi at gcc dot gnu.org
X-Bugzilla-Status: ASSIGNED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: redi at gcc dot gnu.org
X-Bugzilla-Target-Milestone: 4.8.3
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: keywords cc cf_known_to_work target_milestone short_desc
Message-ID: <bug-58839-4-NO1XlrIfUh@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-58839-4@http.gcc.gnu.org/bugzilla/>
References: <bug-58839-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: 2013-10/txt/msg01931.txt.bz2
Content-length: 745

http://gcc.gnu.org/bugzilla/show_bug.cgi?idX839

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |rejects-valid
                 CC|jwakely.gcc at gmail dot com       |
      Known to work|                            |4.7.3
   Target Milestone|---                         |4.8.3
            Summary|Regression: dereferencing   |[4.8/4.9 Regression]
                   |void* in                    |dereferencing void* in
                   |shared_ptr(unique_ptr&& u)  |shared_ptr(unique_ptr&& u)
                   |constructor                 |constructor


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

* [Bug rtl-optimization/58679] [4.9 regression] ICE in create_pre_exit, at mode-switching.c:421 with -mavx after r202915
  2013-10-10  8:46 [Bug rtl-optimization/58679] New: [4.9 regression] ICE in create_pre_exit, at mode-switching.c:421 with -mavx after r202915 izamyatin at gmail dot com
                   ` (3 preceding siblings ...)
  2013-10-26 13:25 ` amylaar at gcc dot gnu.org
@ 2013-10-26 14:35 ` ubizjak at gmail dot com
  2013-10-26 16:05 ` ubizjak at gmail dot com
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: ubizjak at gmail dot com @ 2013-10-26 14:35 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #7 from Uroš Bizjak <ubizjak at gmail dot com> ---
(In reply to Uroš Bizjak from comment #1)
> The patch at [1] now removes useless moves in the exit bb. This change
> breaks assumption in the mode-switching pass that all USEs of return values
> have a corresponding simple return value copy somewhere up in the insn
> stream.

I was referring to:

[1] http://gcc.gnu.org/ml/gcc-patches/2013-10/msg02208.html

CC author. Hopefully, following part will be reverted:

2013-10-25  Vladimir Makarov <vmakarov@redhat.com>

        [...]
        * lra-spills.c (lra_final_code_change): Remove useless move insns.
>From gcc-bugs-return-432790-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sat Oct 26 14:48:39 2013
Return-Path: <gcc-bugs-return-432790-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 16970 invoked by alias); 26 Oct 2013 14:48: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 16944 invoked by uid 48); 26 Oct 2013 14:48:36 -0000
From: "mtewoodbury at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug preprocessor/58887] New: Allow recursion in varadic macros?
Date: Sat, 26 Oct 2013 14:48:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: new
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: preprocessor
X-Bugzilla-Version: unknown
X-Bugzilla-Keywords:
X-Bugzilla-Severity: enhancement
X-Bugzilla-Who: mtewoodbury at gmail dot com
X-Bugzilla-Status: UNCONFIRMED
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
Message-ID: <bug-58887-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: 2013-10/txt/msg01934.txt.bz2
Content-length: 2149

http://gcc.gnu.org/bugzilla/show_bug.cgi?idX887

            Bug ID: 58887
           Summary: Allow recursion in varadic macros?
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: preprocessor
          Assignee: unassigned at gcc dot gnu.org
          Reporter: mtewoodbury at gmail dot com

With good reason, recursion in macro definitions is suppressed -- it leads to
infinite expansion loops and subsequent software failure, HOWEVER

Recursion of varadic macros where the number of arguments in the argument list
decreases would necessarily stop expanding when the argument list became empty.

It would be nice if this could be handled easily, but doing it requires an
extension -- something beyond what the standard calls for/allows.

I can see two ways to do this -- there may be other ways as well:

1)  Allow recursion as long as the new invocation has fewer arguments
    than the current invocation.

    This is the general solution, but should only be allowed if some
    special mode is set, such as a command line switch or 'pragma'

2)  Make the number of arguments easily available.

    There is a way to write a varadic macro that return a count of
    its arguments, but it has severe limitations -- it will necessarily
    have an upper bound on the number of arguments it can count and
    that limit will be half the implementation limit the preprocessor
    puts on the number of arguments that can be passed to varadic
    macros.

    It would help if there were a predefined macro that did this
    counting and did not have the upper bound limitation.

    Once the argument count is available, it is possible to construct
    the name of a macro for the correct number of arguments and have
    those macros chain their expansion.

    This solution is sub-optimal:  macros for each argument count have
    to be defined, which means there will be an arbitrary upper bound
    on the number of arguments handled and puts a strain on preprocessor
    resources.

    For this reason, solution 1 is preferable.


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

* [Bug rtl-optimization/58679] [4.9 regression] ICE in create_pre_exit, at mode-switching.c:421 with -mavx after r202915
  2013-10-10  8:46 [Bug rtl-optimization/58679] New: [4.9 regression] ICE in create_pre_exit, at mode-switching.c:421 with -mavx after r202915 izamyatin at gmail dot com
                   ` (4 preceding siblings ...)
  2013-10-26 14:35 ` ubizjak at gmail dot com
@ 2013-10-26 16:05 ` ubizjak at gmail dot com
  2013-10-26 16:13 ` amylaar at gcc dot gnu.org
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: ubizjak at gmail dot com @ 2013-10-26 16:05 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #9 from Uroš Bizjak <ubizjak at gmail dot com> ---
(In reply to Eric Botcazou from comment #8)
> > Or should we use a different approach, and use DF to re-create REG_DEAD
> > notes?
> 
> Yes, if you need REG_DEAD/REG_UNUSED notes, just tell DF to compute them:

I think that missing REG_DEAD/REG_UNUSED notes and r202915 just triggered the
problem, fixed with [1] - at least I'm not able to trigger the ICE described in
Comment #0 anymore.

The new problem was introduced by Vladimir's patch that removed final
assignments to return registers in several cases. The postreload mode-switching
pass depends on them, and gcc.target/i386/{avx-1,sse-23,sse-24}.c testcases
start to fail on x86 [2]. Also, bootstrap will be broken when configured with
"--with-arch=core-avx-i --with-cpu=core-avx-i --with-fpmath=avx" due to
post-reload mode switching failures in libjava and libgo.


[1] http://gcc.gnu.org/ml/gcc-patches/2013-10/msg01606.html
[2] http://gcc.gnu.org/ml/gcc-testresults/2013-10/msg02051.html
>From gcc-bugs-return-432794-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sat Oct 26 16:12:14 2013
Return-Path: <gcc-bugs-return-432794-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 21194 invoked by alias); 26 Oct 2013 16:12:14 -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 21160 invoked by uid 48); 26 Oct 2013 16:12:09 -0000
From: "redi at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libstdc++/58804] dynamic_bitset<> uses popcountl on long long
Date: Sat, 26 Oct 2013 16:12:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: libstdc++
X-Bugzilla-Version: 4.7.4
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: redi at gcc dot gnu.org
X-Bugzilla-Status: RESOLVED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: 4.9.0
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: target_milestone
Message-ID: <bug-58804-4-xbilV0yuI8@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-58804-4@http.gcc.gnu.org/bugzilla/>
References: <bug-58804-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: 2013-10/txt/msg01938.txt.bz2
Content-length: 291

http://gcc.gnu.org/bugzilla/show_bug.cgi?idX804

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.9.0


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

* [Bug rtl-optimization/58679] [4.9 regression] ICE in create_pre_exit, at mode-switching.c:421 with -mavx after r202915
  2013-10-10  8:46 [Bug rtl-optimization/58679] New: [4.9 regression] ICE in create_pre_exit, at mode-switching.c:421 with -mavx after r202915 izamyatin at gmail dot com
                   ` (5 preceding siblings ...)
  2013-10-26 16:05 ` ubizjak at gmail dot com
@ 2013-10-26 16:13 ` amylaar at gcc dot gnu.org
  2013-10-26 16:20 ` ebotcazou at gcc dot gnu.org
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: amylaar at gcc dot gnu.org @ 2013-10-26 16:13 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #10 from Jorn Wolfgang Rennecke <amylaar at gcc dot gnu.org> ---
(In reply to Uroš Bizjak from comment #7)

> CC author. Hopefully, following part will be reverted:
> 
> 2013-10-25  Vladimir Makarov <vmakarov@redhat.com>
> 
>         [...]
>         * lra-spills.c (lra_final_code_change): Remove useless move insns.

For the return value sanity checks, we need only a subset of these moves
preserved.
Ones that are
- in the exit block, and
- likely_spilled_p, and
- pertain to the function result register, or a part of it.
>From gcc-bugs-return-432797-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sat Oct 26 16:17:57 2013
Return-Path: <gcc-bugs-return-432797-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 27177 invoked by alias); 26 Oct 2013 16:17:57 -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 27149 invoked by uid 48); 26 Oct 2013 16:17:54 -0000
From: "mustrumr97 at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/58792] [4.9 Regression] ICE at mode-switching.c:421 when compiling clang lib/AST/MicrosoftCXXABI.cpp
Date: Sat, 26 Oct 2013 16:17:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: target
X-Bugzilla-Version: 4.9.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: mustrumr97 at gmail dot com
X-Bugzilla-Status: RESOLVED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: ubizjak at gmail dot com
X-Bugzilla-Target-Milestone: 4.7.4
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: attachments.isobsolete attachments.created
Message-ID: <bug-58792-4-GwiMRaZ1o3@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-58792-4@http.gcc.gnu.org/bugzilla/>
References: <bug-58792-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: 2013-10/txt/msg01941.txt.bz2
Content-length: 961

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

Hristo Venev <mustrumr97 at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #31044|0                           |1
        is obsolete|                            |

--- Comment #8 from Hristo Venev <mustrumr97 at gmail dot com> ---
Created attachment 31092
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=31092&action=edit
Reduced testcase

b.cpp: In function ‘int f(int)’:
b.cpp:7:1: internal compiler error: in create_pre_exit, at mode-switching.c:422

GCC fails to compile gcc libstdc++-v3/libsupc++/eh_terminate.cc.

libstdc++-v3/libsupc++/eh_terminate.cc: In function ‘void (*
std::set_terminate(std::terminate_handler))()’:
libstdc++-v3/libsupc++/eh_terminate.cc:85:1: internal compiler error: in
create_pre_exit, at mode-switching.c:422
>From gcc-bugs-return-432798-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sat Oct 26 16:18:31 2013
Return-Path: <gcc-bugs-return-432798-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 28034 invoked by alias); 26 Oct 2013 16:18:31 -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 28004 invoked by uid 48); 26 Oct 2013 16:18:28 -0000
From: "mustrumr97 at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/58792] [4.9 Regression] ICE at mode-switching.c:421 when compiling clang lib/AST/MicrosoftCXXABI.cpp
Date: Sat, 26 Oct 2013 16:18:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: target
X-Bugzilla-Version: 4.9.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: mustrumr97 at gmail dot com
X-Bugzilla-Status: NEW
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: ubizjak at gmail dot com
X-Bugzilla-Target-Milestone: 4.7.4
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: bug_status resolution
Message-ID: <bug-58792-4-x3nXkKwvVo@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-58792-4@http.gcc.gnu.org/bugzilla/>
References: <bug-58792-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: 2013-10/txt/msg01942.txt.bz2
Content-length: 343

http://gcc.gnu.org/bugzilla/show_bug.cgi?idX792

Hristo Venev <mustrumr97 at gmail dot com> changed:

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


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

* [Bug rtl-optimization/58679] [4.9 regression] ICE in create_pre_exit, at mode-switching.c:421 with -mavx after r202915
  2013-10-10  8:46 [Bug rtl-optimization/58679] New: [4.9 regression] ICE in create_pre_exit, at mode-switching.c:421 with -mavx after r202915 izamyatin at gmail dot com
                   ` (6 preceding siblings ...)
  2013-10-26 16:13 ` amylaar at gcc dot gnu.org
@ 2013-10-26 16:20 ` ebotcazou at gcc dot gnu.org
  2013-10-26 16:22 ` amylaar at gcc dot gnu.org
  2013-10-27 20:57 ` ubizjak at gmail dot com
  9 siblings, 0 replies; 11+ messages in thread
From: ebotcazou at gcc dot gnu.org @ 2013-10-26 16:20 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #11 from Eric Botcazou <ebotcazou at gcc dot gnu.org> ---
> There is also a wider issue: the documentation in passes.texi is incorrect
> now.
> It says:
> "Unlike the reload pass, intermediate LRA decisions are reflected in
>  RTL as much as possible."
> Now, with the removal of REG_DEAD / REG_UNUSED notes, the complete opposite
> is true.  These notes are a bit fuzzy after reload, but their fuzzyness is
> well-defined - i.e. the notes pertain to a death in the same BB, unless
> superceded by a simultaneous (with use) or later set.

Are you really sure these notes are still present after reload?  The comment
and the code at line 1170 of reload1.c are clear enough.

Here's the result of "grep -c REG_READ" for a private target not using LRA:

unwind-dw2-fde.i.150r.expand:0
unwind-dw2-fde.i.151r.sibling:0
unwind-dw2-fde.i.153r.initvals:0
unwind-dw2-fde.i.154r.unshare:0
unwind-dw2-fde.i.155r.vregs:0
unwind-dw2-fde.i.156r.into_cfglayout:0
unwind-dw2-fde.i.157r.jump:0
unwind-dw2-fde.i.158r.subreg1:0
unwind-dw2-fde.i.159r.dfinit:0
unwind-dw2-fde.i.160r.cse1:0
unwind-dw2-fde.i.161r.fwprop1:869
unwind-dw2-fde.i.162r.cprop1:869
unwind-dw2-fde.i.163r.pre:867
unwind-dw2-fde.i.165r.cprop2:865
unwind-dw2-fde.i.167r.cse_local:667
unwind-dw2-fde.i.168r.ce1:1627
unwind-dw2-fde.i.169r.reginfo:863
unwind-dw2-fde.i.170r.loop2:863
unwind-dw2-fde.i.171r.loop2_init:863
unwind-dw2-fde.i.172r.loop2_invariant:4402
unwind-dw2-fde.i.176r.loop2_done:863
unwind-dw2-fde.i.178r.cprop3:863
unwind-dw2-fde.i.179r.cse2:856
unwind-dw2-fde.i.180r.dse1:827
unwind-dw2-fde.i.181r.fwprop2:833
unwind-dw2-fde.i.183r.init-regs:833
unwind-dw2-fde.i.184r.ud_dce:833
unwind-dw2-fde.i.185r.combine:792
unwind-dw2-fde.i.186r.ce2:1045
unwind-dw2-fde.i.188r.regmove:731
unwind-dw2-fde.i.189r.outof_cfglayout:731
unwind-dw2-fde.i.190r.split1:731
unwind-dw2-fde.i.191r.subreg2:731
unwind-dw2-fde.i.195r.asmcons:731
unwind-dw2-fde.i.197r.sched1:731
unwind-dw2-fde.i.198r.ira:731
unwind-dw2-fde.i.199r.reload:0
unwind-dw2-fde.i.200r.postreload:0
unwind-dw2-fde.i.202r.split2:0
unwind-dw2-fde.i.206r.pro_and_epilogue:0
unwind-dw2-fde.i.207r.dse2:711
unwind-dw2-fde.i.208r.csa:697
unwind-dw2-fde.i.209r.peephole2:697
unwind-dw2-fde.i.210r.ce3:856
unwind-dw2-fde.i.212r.cprop_hardreg:697
unwind-dw2-fde.i.213r.rtl_dce:696
unwind-dw2-fde.i.214r.bbro:710
unwind-dw2-fde.i.216r.split4:710
unwind-dw2-fde.i.217r.sched2:703
unwind-dw2-fde.i.220r.alignments:703
unwind-dw2-fde.i.221r.compgotos:703
unwind-dw2-fde.i.225r.barriers:703
unwind-dw2-fde.i.226r.dbr:616
unwind-dw2-fde.i.227r.split5:616
unwind-dw2-fde.i.229r.shorten:616
unwind-dw2-fde.i.230r.nothrow:616
unwind-dw2-fde.i.232r.final:616
unwind-dw2-fde.i.233r.dfinish:616
unwind-dw2-fde.i.235r.mach2:616


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

* [Bug rtl-optimization/58679] [4.9 regression] ICE in create_pre_exit, at mode-switching.c:421 with -mavx after r202915
  2013-10-10  8:46 [Bug rtl-optimization/58679] New: [4.9 regression] ICE in create_pre_exit, at mode-switching.c:421 with -mavx after r202915 izamyatin at gmail dot com
                   ` (7 preceding siblings ...)
  2013-10-26 16:20 ` ebotcazou at gcc dot gnu.org
@ 2013-10-26 16:22 ` amylaar at gcc dot gnu.org
  2013-10-27 20:57 ` ubizjak at gmail dot com
  9 siblings, 0 replies; 11+ messages in thread
From: amylaar at gcc dot gnu.org @ 2013-10-26 16:22 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #12 from Jorn Wolfgang Rennecke <amylaar at gcc dot gnu.org> ---
(In reply to Jorn Wolfgang Rennecke from comment #10)
> (In reply to Uroš Bizjak from comment #7)
>  
> > CC author. Hopefully, following part will be reverted:
> > 
> > 2013-10-25  Vladimir Makarov <vmakarov@redhat.com>
> > 
> >         [...]
> >         * lra-spills.c (lra_final_code_change): Remove useless move insns.
> 
> For the return value sanity checks, we need only a subset of these moves
> preserved.
> Ones that are
> - in the exit block, and
> - likely_spilled_p, and
> - pertain to the function result register, or a part of it.

P.S.: the fact that we have no-op moves like that indicates potential
trouble - it means this likely spilled register is also live before
the return value copy.  So if we need to spill it to do a mode switch,
we are between a rock and a hard place.
>From gcc-bugs-return-432801-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sat Oct 26 16:30:28 2013
Return-Path: <gcc-bugs-return-432801-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 5464 invoked by alias); 26 Oct 2013 16:30: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 5413 invoked by uid 48); 26 Oct 2013 16:30:24 -0000
From: "ubizjak at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/58792] [4.9 Regression] ICE at mode-switching.c:421 when compiling clang lib/AST/MicrosoftCXXABI.cpp
Date: Sat, 26 Oct 2013 16:30:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: target
X-Bugzilla-Version: 4.9.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: ubizjak at gmail dot com
X-Bugzilla-Status: NEW
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: ubizjak at gmail dot com
X-Bugzilla-Target-Milestone: 4.7.4
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-58792-4-A5bik8EWcT@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-58792-4@http.gcc.gnu.org/bugzilla/>
References: <bug-58792-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: 2013-10/txt/msg01945.txt.bz2
Content-length: 741

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

--- Comment #9 from Uroš Bizjak <ubizjak at gmail dot com> ---
(In reply to Hristo Venev from comment #8)
> Created attachment 31092 [details]
> Reduced testcase
> 
> b.cpp: In function ‘int f(int)’:
> b.cpp:7:1: internal compiler error: in create_pre_exit, at
> mode-switching.c:422
> 
> GCC fails to compile gcc libstdc++-v3/libsupc++/eh_terminate.cc.
> 
> libstdc++-v3/libsupc++/eh_terminate.cc: In function ‘void (*
> std::set_terminate(std::terminate_handler))()’:
> libstdc++-v3/libsupc++/eh_terminate.cc:85:1: internal compiler error: in
> create_pre_exit, at mode-switching.c:422

If this is with today's compiler, then this is PR58679.
>From gcc-bugs-return-432802-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sat Oct 26 17:30:31 2013
Return-Path: <gcc-bugs-return-432802-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 31201 invoked by alias); 26 Oct 2013 17:30: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 31156 invoked by uid 48); 26 Oct 2013 17:30:26 -0000
From: "thomas.braun@virtuell-zuhause.de" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/58888] New: [c++11] Rejects-valid: static member with auto and initializer
Date: Sat, 26 Oct 2013 17:30: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: 4.8.2
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: thomas.braun@virtuell-zuhause.de
X-Bugzilla-Status: UNCONFIRMED
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
Message-ID: <bug-58888-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: 2013-10/txt/msg01946.txt.bz2
Content-length: 1364

http://gcc.gnu.org/bugzilla/show_bug.cgi?idX888

            Bug ID: 58888
           Summary: [c++11] Rejects-valid: static member with auto and
                    initializer
           Product: gcc
           Version: 4.8.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: thomas.braun@virtuell-zuhause.de

The following code is rejected by
~/gcc-4.8.2/bin/g++ -std=c++11 test.cpp
########
#include <iostream>

struct A
{
  static constexpr auto b{1.0};
};

constexpr decltype(A::b) A::b;

int main(int argc, char** argv)
{
  std::cout << &A::b << std::endl;
}
########

with the message

#########
test.cpp:46:30: error: invalid use of 'auto'
   static constexpr auto b{1.0};
                              ^
test.cpp:49:30: error: invalid type in declaration before ';' token
 constexpr decltype(A::b) A::b;
                              ^
test.cpp:49:30: error: declaration of 'constexpr<typeprefixerror> A::b' outside
of class is not definition [-fpermissive]
#########

I'm using g++ (GCC) 4.8.2.

My interpretation of &7.1.6.4 is that this code is valid, clang accepts the
code and
http://stackoverflow.com/questions/12834874/auto-static-in-class-constant-initalization-with-meta-programming
also suggests that it is valid.


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

* [Bug rtl-optimization/58679] [4.9 regression] ICE in create_pre_exit, at mode-switching.c:421 with -mavx after r202915
  2013-10-10  8:46 [Bug rtl-optimization/58679] New: [4.9 regression] ICE in create_pre_exit, at mode-switching.c:421 with -mavx after r202915 izamyatin at gmail dot com
                   ` (8 preceding siblings ...)
  2013-10-26 16:22 ` amylaar at gcc dot gnu.org
@ 2013-10-27 20:57 ` ubizjak at gmail dot com
  9 siblings, 0 replies; 11+ messages in thread
From: ubizjak at gmail dot com @ 2013-10-27 20:57 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #15 from Uroš Bizjak <ubizjak at gmail dot com> ---
Fixed by the revert.

The first problem, reported in Comment #0 was actually due to missing registers
in ix86_function_value_regno_p, so multi-register output was not properly
detected. This problem was fixed by [1].

The second problem was indeed due to missing output value copy, where the copy
insn was removed as useless move insn. This problem was fixed by a revert.

I have committed a couple of testcases that cover both issues.

[1] http://gcc.gnu.org/ml/gcc-patches/2013-10/msg01606.html
>From gcc-bugs-return-432843-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sun Oct 27 21:35:36 2013
Return-Path: <gcc-bugs-return-432843-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 31784 invoked by alias); 27 Oct 2013 21:35:35 -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 31466 invoked by uid 48); 27 Oct 2013 21:35:30 -0000
From: "glisse at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/58897] New: Improve 128/64 division
Date: Sun, 27 Oct 2013 21:35:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: new
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: target
X-Bugzilla-Version: 4.9.0
X-Bugzilla-Keywords: missed-optimization
X-Bugzilla-Severity: enhancement
X-Bugzilla-Who: glisse at gcc dot gnu.org
X-Bugzilla-Status: UNCONFIRMED
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 keywords bug_severity priority component assigned_to reporter cf_gcctarget
Message-ID: <bug-58897-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: 2013-10/txt/msg01987.txt.bz2
Content-length: 1026

http://gcc.gnu.org/bugzilla/show_bug.cgi?idX897

            Bug ID: 58897
           Summary: Improve 128/64 division
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: enhancement
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: glisse at gcc dot gnu.org
            Target: x86_64-linux-gnu

typedef unsigned __int128 ui;
ui f(ui a, unsigned long b){
  return a/b;
}

is compiled to a library call to __udivti3, which is implemented as a rather
long loop. However, it seems to me that 2 calls to divq should do it (and
sometimes only 1 if we have range information on the result).


Ideally the following would eventually compile to just mul+div, but that's
probably too complicated for now.

unsigned long prod(unsigned long a, unsigned long b, unsigned long m){
  if (a >= m || b >= m) __builtin_unreachable ();
  return ((unsigned __int128) a * b) % m;
}


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

end of thread, other threads:[~2013-10-27 20:57 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-10-10  8:46 [Bug rtl-optimization/58679] New: [4.9 regression] ICE in create_pre_exit, at mode-switching.c:421 with -mavx after r202915 izamyatin at gmail dot com
2013-10-10 12:02 ` [Bug rtl-optimization/58679] " rguenth at gcc dot gnu.org
2013-10-26  7:38 ` ubizjak at gmail dot com
2013-10-26 11:42 ` ubizjak at gmail dot com
2013-10-26 13:25 ` amylaar at gcc dot gnu.org
2013-10-26 14:35 ` ubizjak at gmail dot com
2013-10-26 16:05 ` ubizjak at gmail dot com
2013-10-26 16:13 ` amylaar at gcc dot gnu.org
2013-10-26 16:20 ` ebotcazou at gcc dot gnu.org
2013-10-26 16:22 ` amylaar at gcc dot gnu.org
2013-10-27 20:57 ` 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).