public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/56270] New: loop over array of struct float causes compiler error: segmentation fault
@ 2013-02-09 23:41 4303843KIWEMNPULN at kabelmail dot de
  2013-02-09 23:47 ` [Bug tree-optimization/56270] " pinskia at gcc dot gnu.org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: 4303843KIWEMNPULN at kabelmail dot de @ 2013-02-09 23:41 UTC (permalink / raw)
  To: gcc-bugs


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

             Bug #: 56270
           Summary: loop over array of struct float causes compiler error:
                    segmentation fault
    Classification: Unclassified
           Product: gcc
           Version: 4.7.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: 4303843KIWEMNPULN@kabelmail.de


Created attachment 29408
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=29408
Preprocessed file, comment, compiler call, compiler configuration

Compiling a loop over an array of struct with members of type float leads to:
internal compiler error: Segmentation Fault

Occurs optimizing with -O3

Affected gcc versions: 4.7.2, 4.6.3, 4.6.1, 4.5.2 (at least)
NOT affected versions: 3.4.3 (at least)

Platforms: Solaris 11.1, Ubuntu 12.04.2 LTS (precise), Linux Mint 12 (Lisa);
(Ubuntu and LinuxMint in Virtual Box)

Solaris uname -a: SunOS xxx 5.11 11.1 i86pc i386 i86pc
Ubuntu uname -a Linux xxx 3.2.0-37-generic #58-Ubuntu SMP Thu Jan 24 15:28:10
UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
LinuxMint uname -a: Linux xxx 3.0.0-12-generic #20-Ubuntu SMP Fri Oct 7
14:56:25 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux


Attachment contains preprocessed file and further information


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

* [Bug tree-optimization/56270] loop over array of struct float causes compiler error: segmentation fault
  2013-02-09 23:41 [Bug c/56270] New: loop over array of struct float causes compiler error: segmentation fault 4303843KIWEMNPULN at kabelmail dot de
@ 2013-02-09 23:47 ` pinskia at gcc dot gnu.org
  2013-03-03 19:43 ` mikpe at it dot uu.se
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: pinskia at gcc dot gnu.org @ 2013-02-09 23:47 UTC (permalink / raw)
  To: gcc-bugs


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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|c                           |tree-optimization

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> 2013-02-09 23:47:26 UTC ---
pinskia@server:~/src/local$ ~/local-gcc/bin/x86_64-unknown-linux-gnu-gcc-4.7.0
-O3  t.c 
mbb.c: In function ‘Compute’:
mbb.c:33:6: internal compiler error: vector VEC(tree,base) index domain error,
in vectorizable_store at tree-vect-stmts.c:3920
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.


But works on the trunk.


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

* [Bug tree-optimization/56270] loop over array of struct float causes compiler error: segmentation fault
  2013-02-09 23:41 [Bug c/56270] New: loop over array of struct float causes compiler error: segmentation fault 4303843KIWEMNPULN at kabelmail dot de
  2013-02-09 23:47 ` [Bug tree-optimization/56270] " pinskia at gcc dot gnu.org
@ 2013-03-03 19:43 ` mikpe at it dot uu.se
  2013-03-04 10:57 ` rguenth at gcc dot gnu.org
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: mikpe at it dot uu.se @ 2013-03-03 19:43 UTC (permalink / raw)
  To: gcc-bugs


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

Mikael Pettersson <mikpe at it dot uu.se> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mikpe at it dot uu.se

--- Comment #2 from Mikael Pettersson <mikpe at it dot uu.se> 2013-03-03 19:43:14 UTC ---
This was fixed for 4.8 by Jan Hubicka's r193175, which rewrote finite_loop_p in
tree-ssa-loop-niter.c.  That patch doesn't work as-is in 4.7.2 (it applies but
uses other things which aren't in 4.7.2.)

The SEGV in 4.7.2 occurs in tree-vect-stmts.c:3938

3938              gcc_assert (useless_type_conversion_p (vectype,
3939                                                     TREE_TYPE
(vec_oprnd)));

because vec_oprnd is NULL at that point.


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

* [Bug tree-optimization/56270] loop over array of struct float causes compiler error: segmentation fault
  2013-02-09 23:41 [Bug c/56270] New: loop over array of struct float causes compiler error: segmentation fault 4303843KIWEMNPULN at kabelmail dot de
  2013-02-09 23:47 ` [Bug tree-optimization/56270] " pinskia at gcc dot gnu.org
  2013-03-03 19:43 ` mikpe at it dot uu.se
@ 2013-03-04 10:57 ` rguenth at gcc dot gnu.org
  2013-03-04 13:05 ` [Bug tree-optimization/56270] [4.6/4.7/4.8 Regression] " rguenth at gcc dot gnu.org
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu.org @ 2013-03-04 10:57 UTC (permalink / raw)
  To: gcc-bugs


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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ice-on-valid-code
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2013-03-04
         AssignedTo|unassigned at gcc dot       |rguenth at gcc dot gnu.org
                   |gnu.org                     |
     Ever Confirmed|0                           |1

--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> 2013-03-04 10:56:51 UTC ---
Confirmed.  Probably a latent issue on trunk.  Mine.


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

* [Bug tree-optimization/56270] [4.6/4.7/4.8 Regression] loop over array of struct float causes compiler error: segmentation fault
  2013-02-09 23:41 [Bug c/56270] New: loop over array of struct float causes compiler error: segmentation fault 4303843KIWEMNPULN at kabelmail dot de
                   ` (2 preceding siblings ...)
  2013-03-04 10:57 ` rguenth at gcc dot gnu.org
@ 2013-03-04 13:05 ` rguenth at gcc dot gnu.org
  2013-03-04 13:14 ` rguenth at gcc dot gnu.org
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu.org @ 2013-03-04 13:05 UTC (permalink / raw)
  To: gcc-bugs


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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to work|                            |4.3.6
   Target Milestone|---                         |4.6.4
            Summary|loop over array of struct   |[4.6/4.7/4.8 Regression]
                   |float causes compiler       |loop over array of struct
                   |error: segmentation fault   |float causes compiler
                   |                            |error: segmentation fault

--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> 2013-03-04 13:05:19 UTC ---
Also ICEs on trunk for me with -O1 -ftree-vectorize.  Works with 4.3 at least.


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

* [Bug tree-optimization/56270] [4.6/4.7/4.8 Regression] loop over array of struct float causes compiler error: segmentation fault
  2013-02-09 23:41 [Bug c/56270] New: loop over array of struct float causes compiler error: segmentation fault 4303843KIWEMNPULN at kabelmail dot de
                   ` (3 preceding siblings ...)
  2013-03-04 13:05 ` [Bug tree-optimization/56270] [4.6/4.7/4.8 Regression] " rguenth at gcc dot gnu.org
@ 2013-03-04 13:14 ` rguenth at gcc dot gnu.org
  2013-03-04 14:19 ` rguenth at gcc dot gnu.org
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu.org @ 2013-03-04 13:14 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #5 from Richard Biener <rguenth at gcc dot gnu.org> 2013-03-04 13:13:58 UTC ---
Reduced testcase:

typedef struct {
    float l, h;
} tFPinterval;

tFPinterval X[1024];
tFPinterval Y[1024];
tFPinterval Z[1024];

void Compute(void)
{
  int d;
  for (d= 0; d < 1024; d++)
    {
      Y[d].l= X[d].l + X[d].h;
      Y[d].h= Y[d].l;
      Z[d].l= X[d].l;
      Z[d].h= X[d].h;
    }
}


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

* [Bug tree-optimization/56270] [4.6/4.7/4.8 Regression] loop over array of struct float causes compiler error: segmentation fault
  2013-02-09 23:41 [Bug c/56270] New: loop over array of struct float causes compiler error: segmentation fault 4303843KIWEMNPULN at kabelmail dot de
                   ` (4 preceding siblings ...)
  2013-03-04 13:14 ` rguenth at gcc dot gnu.org
@ 2013-03-04 14:19 ` rguenth at gcc dot gnu.org
  2013-03-05  9:55 ` rguenth at gcc dot gnu.org
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu.org @ 2013-03-04 14:19 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #6 from Richard Biener <rguenth at gcc dot gnu.org> 2013-03-04 14:19:37 UTC ---
We don't properly "vectorize" the 2nd reference to the load (this time
unpermuted).  When vectorizing the 2nd SLP instance with that reference
we encounter

      /* Check if the chain of loads is already vectorized.  */
      if (STMT_VINFO_VEC_STMT (vinfo_for_stmt (first_stmt)))
        {
          *vec_stmt = STMT_VINFO_VEC_STMT (stmt_info);
          return true;
        }

but that leaves SLP_TREE_VEC_STMTS unpopulated.  Shared nodes between SLP
instances seem to be somewhat fragile ...

Especially in this case in which even wrong-code would occur as the
instances do not share the same permutation.

      if (slp
          && !SLP_INSTANCE_LOAD_PERMUTATION (slp_node_instance).exists ()
          && first_stmt != SLP_TREE_SCALAR_STMTS (slp_node)[0])
        first_stmt = SLP_TREE_SCALAR_STMTS (slp_node)[0];

also doesn't make much sense to me - instead it probably should be asserted:

      if (slp
          && first_stmt != SLP_TREE_SCALAR_STMTS (slp_node)[0])
        gcc_assert (SLP_INSTANCE_LOAD_PERMUTATION (slp_node_instance).exists
())

but bb-slp-29.c asserts here.

Easiest is for now to clear STMT_VINFO_VEC_STMT for all loads after
scheduling an SLP instance.


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

* [Bug tree-optimization/56270] [4.6/4.7/4.8 Regression] loop over array of struct float causes compiler error: segmentation fault
  2013-02-09 23:41 [Bug c/56270] New: loop over array of struct float causes compiler error: segmentation fault 4303843KIWEMNPULN at kabelmail dot de
                   ` (5 preceding siblings ...)
  2013-03-04 14:19 ` rguenth at gcc dot gnu.org
@ 2013-03-05  9:55 ` rguenth at gcc dot gnu.org
  2013-03-05  9:56 ` [Bug tree-optimization/56270] [4.6/4.7 " rguenth at gcc dot gnu.org
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu.org @ 2013-03-05  9:55 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #7 from Richard Biener <rguenth at gcc dot gnu.org> 2013-03-05 09:54:43 UTC ---
Author: rguenth
Date: Tue Mar  5 09:54:29 2013
New Revision: 196458

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=196458
Log:
2013-03-05  Richard Biener  <rguenther@suse.de>

    PR tree-optimization/56270
    * tree-vect-slp.c (vect_schedule_slp): Clear vectorized stmts
    of loads after scheduling an SLP instance.

    * gcc.dg/vect/slp-38.c: New testcase.

Added:
    trunk/gcc/testsuite/gcc.dg/vect/slp-38.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/tree-vect-slp.c


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

* [Bug tree-optimization/56270] [4.6/4.7 Regression] loop over array of struct float causes compiler error: segmentation fault
  2013-02-09 23:41 [Bug c/56270] New: loop over array of struct float causes compiler error: segmentation fault 4303843KIWEMNPULN at kabelmail dot de
                   ` (6 preceding siblings ...)
  2013-03-05  9:55 ` rguenth at gcc dot gnu.org
@ 2013-03-05  9:56 ` rguenth at gcc dot gnu.org
  2013-03-26 10:15 ` [Bug tree-optimization/56270] [4.6 " rguenth at gcc dot gnu.org
  2013-04-12 16:29 ` jakub at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu.org @ 2013-03-05  9:56 UTC (permalink / raw)
  To: gcc-bugs


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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to work|                            |4.8.0
            Summary|[4.6/4.7/4.8 Regression]    |[4.6/4.7 Regression] loop
                   |loop over array of struct   |over array of struct float
                   |float causes compiler       |causes compiler error:
                   |error: segmentation fault   |segmentation fault

--- Comment #8 from Richard Biener <rguenth at gcc dot gnu.org> 2013-03-05 09:55:18 UTC ---
Fixed on trunk sofar.


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

* [Bug tree-optimization/56270] [4.6 Regression] loop over array of struct float causes compiler error: segmentation fault
  2013-02-09 23:41 [Bug c/56270] New: loop over array of struct float causes compiler error: segmentation fault 4303843KIWEMNPULN at kabelmail dot de
                   ` (7 preceding siblings ...)
  2013-03-05  9:56 ` [Bug tree-optimization/56270] [4.6/4.7 " rguenth at gcc dot gnu.org
@ 2013-03-26 10:15 ` rguenth at gcc dot gnu.org
  2013-04-12 16:29 ` jakub at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu.org @ 2013-03-26 10:15 UTC (permalink / raw)
  To: gcc-bugs


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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to work|                            |4.7.3
            Summary|[4.6/4.7 Regression] loop   |[4.6 Regression] loop over
                   |over array of struct float  |array of struct float
                   |causes compiler error:      |causes compiler error:
                   |segmentation fault          |segmentation fault
      Known to fail|                            |4.7.2

--- Comment #9 from Richard Biener <rguenth at gcc dot gnu.org> 2013-03-26 10:15:31 UTC ---
Author: rguenth
Date: Tue Mar 26 10:12:52 2013
New Revision: 197096

URL: http://gcc.gnu.org/viewcvs?rev=197096&root=gcc&view=rev
Log:
2013-03-26  Richard Biener  <rguenther@suse.de>

        Backport from mainline
        2013-03-13  Richard Biener  <rguenther@suse.de>

    PR tree-optimization/56608
    * tree-vect-slp.c (vect_schedule_slp): Do not remove scalar
    calls when vectorizing basic-blocks.

    * gcc.dg/vect/fast-math-bb-slp-call-3.c: New testcase.

        2013-03-05  Richard Biener  <rguenther@suse.de>

    PR tree-optimization/56270
    * tree-vect-slp.c (vect_schedule_slp): Clear vectorized stmts
    of loads after scheduling an SLP instance.

    * gcc.dg/vect/slp-38.c: New testcase.

Added:
    branches/gcc-4_7-branch/gcc/testsuite/gcc.dg/vect/fast-math-bb-slp-call-3.c
    branches/gcc-4_7-branch/gcc/testsuite/gcc.dg/vect/slp-38.c
Modified:
    branches/gcc-4_7-branch/gcc/ChangeLog
    branches/gcc-4_7-branch/gcc/testsuite/ChangeLog
    branches/gcc-4_7-branch/gcc/tree-vect-slp.c


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

* [Bug tree-optimization/56270] [4.6 Regression] loop over array of struct float causes compiler error: segmentation fault
  2013-02-09 23:41 [Bug c/56270] New: loop over array of struct float causes compiler error: segmentation fault 4303843KIWEMNPULN at kabelmail dot de
                   ` (8 preceding siblings ...)
  2013-03-26 10:15 ` [Bug tree-optimization/56270] [4.6 " rguenth at gcc dot gnu.org
@ 2013-04-12 16:29 ` jakub at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu.org @ 2013-04-12 16:29 UTC (permalink / raw)
  To: gcc-bugs


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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|4.6.4                       |4.7.3

--- Comment #10 from Jakub Jelinek <jakub at gcc dot gnu.org> 2013-04-12 16:29:08 UTC ---
The 4.6 branch has been closed, fixed in GCC 4.7.3.


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

end of thread, other threads:[~2013-04-12 16:29 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-09 23:41 [Bug c/56270] New: loop over array of struct float causes compiler error: segmentation fault 4303843KIWEMNPULN at kabelmail dot de
2013-02-09 23:47 ` [Bug tree-optimization/56270] " pinskia at gcc dot gnu.org
2013-03-03 19:43 ` mikpe at it dot uu.se
2013-03-04 10:57 ` rguenth at gcc dot gnu.org
2013-03-04 13:05 ` [Bug tree-optimization/56270] [4.6/4.7/4.8 Regression] " rguenth at gcc dot gnu.org
2013-03-04 13:14 ` rguenth at gcc dot gnu.org
2013-03-04 14:19 ` rguenth at gcc dot gnu.org
2013-03-05  9:55 ` rguenth at gcc dot gnu.org
2013-03-05  9:56 ` [Bug tree-optimization/56270] [4.6/4.7 " rguenth at gcc dot gnu.org
2013-03-26 10:15 ` [Bug tree-optimization/56270] [4.6 " rguenth at gcc dot gnu.org
2013-04-12 16:29 ` jakub 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).