public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/60101] New: Long compile times when mixed complex floating point datatypes are used in lengthy expressions
@ 2014-02-06 19:51 thorstenkurth at me dot com
  2014-02-07 12:38 ` [Bug c/60101] [4.7/4.8/4.9 Regression] " rguenth at gcc dot gnu.org
                   ` (12 more replies)
  0 siblings, 13 replies; 14+ messages in thread
From: thorstenkurth at me dot com @ 2014-02-06 19:51 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 60101
           Summary: Long compile times when mixed complex floating point
                    datatypes are used in lengthy expressions
           Product: gcc
           Version: 4.8.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: thorstenkurth at me dot com

Created attachment 32071
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=32071&action=edit
Archive which includes test case.

In the example I copied below, the double.c file compiles instantly whereas the
float.c file takes very long. This is a truncated version of an even longer
file (more lines of code in the loop) and the compile time for the float.c file
grows like N^3, where N is the number of lines. Here is the output of the long
version for 4.8.2:

0x40ae17 do_spec_1
    ../../gcc-4.8.2-src/gcc-4.8.2/gcc/gcc.c:5269
0x40ae17 do_spec_1
    ../../gcc-4.8.2-src/gcc-4.8.2/gcc/gcc.c:5269
0x40c875 process_brace_body
    ../../gcc-4.8.2-src/gcc-4.8.2/gcc/gcc.c:5872
0x40c875 process_brace_body
    ../../gcc-4.8.2-src/gcc-4.8.2/gcc/gcc.c:5872
0x40c875 handle_braces
    ../../gcc-4.8.2-src/gcc-4.8.2/gcc/gcc.c:5786
0x40c875 handle_braces
    ../../gcc-4.8.2-src/gcc-4.8.2/gcc/gcc.c:5786
0x40ae17 do_spec_1
    ../../gcc-4.8.2-src/gcc-4.8.2/gcc/gcc.c:5269
0x40c875 process_brace_body
    ../../gcc-4.8.2-src/gcc-4.8.2/gcc/gcc.c:5872
and more messages like that

The attached files both compile, but they the float.c takes significantly
longer.
The only difference between those files is that the temporary variable sum is
double complex in the working version and float complex in the non-working
version. So I guess, the compiler tries to reorganize the complex
multiplications and additions so that intermediate floating point results can
be used (this is what I guess). Both files compile using the icc (>=11.0) and
clang/LLVM almost instantly. It also works for gcc<=4.4.


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

end of thread, other threads:[~2014-06-12 13:35 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-06 19:51 [Bug c/60101] New: Long compile times when mixed complex floating point datatypes are used in lengthy expressions thorstenkurth at me dot com
2014-02-07 12:38 ` [Bug c/60101] [4.7/4.8/4.9 Regression] " rguenth at gcc dot gnu.org
2014-02-10 13:59 ` mpolacek at gcc dot gnu.org
2014-02-10 17:29 ` mpolacek at gcc dot gnu.org
2014-02-10 17:43 ` mpolacek at gcc dot gnu.org
2014-02-10 18:12 ` jakub at gcc dot gnu.org
2014-02-10 20:07 ` mpolacek at gcc dot gnu.org
2014-02-11 13:10 ` manu at gcc dot gnu.org
2014-02-11 13:15 ` jakub at gcc dot gnu.org
2014-02-11 13:17 ` manu at gcc dot gnu.org
2014-02-12  7:36 ` jakub at gcc dot gnu.org
2014-02-12  7:40 ` [Bug c/60101] [4.7/4.8 " jakub at gcc dot gnu.org
2014-03-06  8:02 ` jakub at gcc dot gnu.org
2014-06-12 13:35 ` [Bug c/60101] [4.7 " rguenth at gcc dot gnu.org

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