Bug 53748 - [4.8 Regression] ice in fold_convert_loc
Summary: [4.8 Regression] ice in fold_convert_loc
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: tree-optimization (show other bugs)
Version: 4.8.0
: P3 normal
Target Milestone: 4.8.0
Assignee: Jakub Jelinek
URL:
Keywords: ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2012-06-22 08:22 UTC by David Binderman
Modified: 2012-06-26 08:24 UTC (History)
4 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2012-06-22 00:00:00


Attachments
C source code (42.15 KB, text/x-csrc)
2012-06-22 08:22 UTC, David Binderman
Details
gcc48-pr53748.patch (717 bytes, patch)
2012-06-25 10:14 UTC, Jakub Jelinek
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description David Binderman 2012-06-22 08:22:17 UTC
Created attachment 27687 [details]
C source code

I just tried to compile the package ratpoints-2.1.3-5
on gcc-4.8 trunk dated 20120620 on an AMD x86_64 box.

The compiler said

find_points.c: In function 'find_points_work':
find_points.c:1236:6: internal compiler error: in fold_convert_loc, at fold-const.c:1986
 long find_points_work(ratpoints_args *args,
      ^
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

Preprocessed source code attached. Flag -O2 required.
Comment 1 Richard Biener 2012-06-22 08:54:58 UTC
Confirmed.  Happens in tree-ssa-phiopt.c in conditional_replacement.
Comment 2 H.J. Lu 2012-06-22 12:21:46 UTC
It is caused by revision 186905:

http://gcc.gnu.org/ml/gcc-cvs/2012-04/msg00858.html
Comment 3 Jakub Jelinek 2012-06-25 09:20:06 UTC
Reduced testcase:
typedef long long V __attribute__ ((__vector_size__ (16)));

void
foo (int x, V *y)
{
  *y = x ? ((V) { ~0UL, ~0UL }) : ((V) { 0LL, 0LL });
}
Comment 4 Jakub Jelinek 2012-06-25 10:14:43 UTC
Created attachment 27700 [details]
gcc48-pr53748.patch

UNtested fix.
Comment 5 Jakub Jelinek 2012-06-26 08:02:31 UTC
Author: jakub
Date: Tue Jun 26 08:02:20 2012
New Revision: 188975

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=188975
Log:
	PR tree-optimization/53748
	* tree-ssa-phiopt.c (conditional_replacement): Only optimize
	if arg0/arg1 have integral or pointer types.

	* gcc.c-torture/compile/pr53748.c: New test.

Added:
    trunk/gcc/testsuite/gcc.c-torture/compile/pr53748.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/tree-ssa-phiopt.c
Comment 6 Jakub Jelinek 2012-06-26 08:24:32 UTC
Fixed.