public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "ubizjak at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/58853] [4.9 regression] ICE in expand_set_or_movmem_prologue_epilogue_by_misaligned_moves
Date: Tue, 05 Nov 2013 08:41:00 -0000	[thread overview]
Message-ID: <bug-58853-4-jly0VnlH4P@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-58853-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #3 from Uroš Bizjak <ubizjak at gmail dot com> ---
+1, x86 RTEMS build is broken without this fix. RTEMS uses -march=pentiumpro in
its default multilib configuration.
>From gcc-bugs-return-433526-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Tue Nov 05 09:07:48 2013
Return-Path: <gcc-bugs-return-433526-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 26637 invoked by alias); 5 Nov 2013 09:07:47 -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 25846 invoked by uid 48); 5 Nov 2013 09:05:44 -0000
From: "khurshid.normuradov at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/58999] New: sizeof ...(T) is very slow than clang
Date: Tue, 05 Nov 2013 09:07: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: unknown
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: khurshid.normuradov 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-58999-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-11/txt/msg00303.txt.bz2
Content-length: 2338

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

            Bug ID: 58999
           Summary: sizeof ...(T) is very slow than clang
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: khurshid.normuradov at gmail dot com

This code doesn't compiled well on gcc, but compiled well with clang, and very
fast.

template< int ... > struct index_sequence{   using type = index_sequence; };

template< typename T> using invoke = typename T :: type ;

template< typename T, typename U > struct concate;
template< int ...i, int ... j>
struct concate< index_sequence<i...>, index_sequence<j...> >
        : index_sequence< i... ,  (j + sizeof ... (i ) )... > {};
  //                                   \          /
  //                                    ----------
 //                                   I think here is slowly.
template< int n>
struct make_index_sequence_help : concate<
                          invoke< make_index_sequence_help<n/2>>,
                          invoke< make_index_sequence_help<n-n/2>>
                          > {};

template<> struct make_index_sequence_help <0> : index_sequence<>{};
template<> struct make_index_sequence_help <1> : index_sequence<0>{};

template< int n> using make_index_sequence = invoke<
make_index_sequence_help<n> >;


int main()
{
    using iseq = make_index_sequence< 1024 > ; // successfull
    using jseq = make_index_sequence< 1024 * 16 > ; // a lot of compile time!!!
    using kseq = make_index_sequence< 1024 * 64 > ; // can't compile: memory
exhauted!!!
};


When I change sizeof...(i)  to concrete number 's'  - compiled fastest as
clang.


template< int s, typename T, typename U > struct concate;
template< int s, int ...i, int ...j >
struct concate< s, index_sequence<i...>, index_sequence<j...> >
 :  index_sequence< i..., ( j + s ) ... > {};
//                              |_ changed sizeof...(i) to s
// and
template< int n >
struct make_index_sequence_help : concate<
                                  n / 2 ,
                          invoke< make_index_sequence_help< n / 2 > >,
                          invoke< make_index_sequence_help< n - n/2 > >
                           >{};


  parent reply	other threads:[~2013-11-05  8:41 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-23 14:05 [Bug rtl-optimization/58853] New: [4.9 regression] ICE after r203937 ysrumyan at gmail dot com
2013-10-23 14:40 ` [Bug rtl-optimization/58853] " izamyatin at gmail dot com
2013-10-23 14:45 ` hubicka at gcc dot gnu.org
2013-10-23 17:52 ` [Bug target/58853] [4.9 regression] ICE in expand_set_or_movmem_prologue_epilogue_by_misaligned_moves ebotcazou at gcc dot gnu.org
2013-11-05  8:41 ` ubizjak at gmail dot com [this message]
2013-11-05  9:19 ` hubicka at ucw dot cz
2013-11-07 13:56 ` hjl.tools at gmail dot com
2013-11-11 16:41 ` hubicka at ucw dot cz
2013-11-11 16:55 ` ubizjak at gmail dot com
2013-11-11 17:04 ` ubizjak at gmail dot com
2013-11-11 20:02 ` uros at gcc dot gnu.org
2013-11-11 20:12 ` ubizjak at gmail dot com
2013-11-14 21:27 ` uros at gcc dot gnu.org
2013-11-14 21:30 ` ubizjak at gmail dot com

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-58853-4-jly0VnlH4P@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).