Bug 59822 - [4.9 Regression] ice in compute_live_loop_exits with -O3
Summary: [4.9 Regression] ice in compute_live_loop_exits with -O3
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: tree-optimization (show other bugs)
Version: 4.9.0
: P3 normal
Target Milestone: 4.9.0
Assignee: Richard Biener
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-01-15 09:42 UTC by David Binderman
Modified: 2014-01-15 15:13 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2014-01-15 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Binderman 2014-01-15 09:42:18 UTC
I just tried to bootstrap trunk revision 206619 on an x86_64 Linux box.

Configure line is

../src/trunk/configure --prefix=/home/dcb/gcc/results 
    --enable-checking=yes --enable-languages=c,c++,fortran --disable-werror

In the generated Makefile, I changed BOOT_CFLAGS from
-g -O2 to -g -O3.

I got

../../src/trunk/gcc/config/i386/i386.c: In function ‘rtx_def* ix86_build_const_vector(machine_mode, bool, rtx)’:
../../src/trunk/gcc/config/i386/i386.c:18746:1: internal compiler error: in compute_live_loop_exits, at tree-ssa-loop-manip.c:237
 ix86_build_const_vector (enum machine_mode mode, bool vect, rtx value)
 ^
0xe978e5 compute_live_loop_exits
    ../../src/trunk/gcc/tree-ssa-loop-manip.c:237
0xe97cf8 add_exit_phis_var
    ../../src/trunk/gcc/tree-ssa-loop-manip.c:324
0xe97dfc add_exit_phis
    ../../src/trunk/gcc/tree-ssa-loop-manip.c:346
0xe9847b rewrite_into_loop_closed_ssa(bitmap_head*, unsigned int)
    ../../src/trunk/gcc/tree-ssa-loop-manip.c:540
0xf9f9bf vectorize_loops()
    ../../src/trunk/gcc/tree-vectorizer.c:579
0xeac556 tree_loop_vectorize
    ../../src/trunk/gcc/tree-ssa-loop.c:154
0xeac5e0 execute
    ../../src/trunk/gcc/tree-ssa-loop.c:189
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.

Interestingly, when I dropped BOOT_CLAGS back to -g -O2, the bootstrap
worked.
Comment 1 Richard Biener 2014-01-15 11:40:18 UTC
I guess --with-build-config=bootstrap-O3 is affected then.  Confirmed, reducing.
Comment 2 Richard Biener 2014-01-15 12:16:59 UTC
typedef struct rtvec_def *rtvec;
enum machine_mode { VOIDmode };
struct rtvec_def { void *elem[1]; };
extern void *const_tiny_rtx[2];
void
ix86_build_const_vector (enum machine_mode mode, bool vect, 
                         void *value, rtvec v, int n_elt)
{
  int i;
  for (i = 1; i < n_elt; ++i)  
    ((v)->elem[i]) = vect ? value : (const_tiny_rtx[(int) (mode)]);
}


I will have a look.
Comment 3 Richard Biener 2014-01-15 15:13:41 UTC
Author: rguenth
Date: Wed Jan 15 15:13:08 2014
New Revision: 206630

URL: http://gcc.gnu.org/viewcvs?rev=206630&root=gcc&view=rev
Log:
2014-01-15  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/59822
	* tree-vect-stmts.c (hoist_defs_of_uses): New function.
	(vectorizable_load): Use it to hoist defs of uses of invariant
	loads out of the loop.

	* g++.dg/torture/pr59822.C: New testcase.

Added:
    trunk/gcc/testsuite/g++.dg/torture/pr59822.C
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/tree-vect-stmts.c
Comment 4 Richard Biener 2014-01-15 15:13:46 UTC
Fixed.